diff --git a/.github/workflows/sync-metalv1.yaml b/.github/workflows/sync-metalv1.yaml new file mode 100644 index 00000000..ec2eca05 --- /dev/null +++ b/.github/workflows/sync-metalv1.yaml @@ -0,0 +1,83 @@ +name: Sync metalv1 API spec + +on: + workflow_dispatch: + +jobs: + sync: + strategy: + matrix: + go-version: [1.19.x] + 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 Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - 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.metalv1 fetch + git add spec/services/metalv1 + echo `git commit -m 'sync: fetch ${{ steps.date.outputs.date }} spec and apply patches'` + - name: Apply spec patches + id: patch + if: ${{ always() && steps.fetch.conclusion == 'success' }} + run: | + make -f Makefile.metalv1 patch + git add spec/services/metalv1 + echo `git commit -m 'sync: patch spec with ${{ steps.date.outputs.date }} spec'` + - name: Generate code + id: generate + if: ${{ always() && steps.patch.conclusion == 'success' }} + run: | + make -f Makefile.metalv1 generate + git add services/metalv1 + 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@v5 + 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 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/.github/workflows/test-metalv1.yaml b/.github/workflows/test-metalv1.yaml new file mode 100644 index 00000000..9dae4bef --- /dev/null +++ b/.github/workflows/test-metalv1.yaml @@ -0,0 +1,31 @@ +name: Test metalv1 codegen + +on: + push: + paths: + - "**/metalv1/**" + pull_request: + paths: + - "**/metalv1/**" + +jobs: + test: + strategy: + matrix: + go-version: [1.19.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v4 + - name: Verify Patches + run: make -f Makefile.metalv1 patch + - name: Generate + run: | + make -f Makefile.metalv1 generate + # Expect all changes to be accounted for + ! git status --porcelain | grep . diff --git a/Makefile.metalv1 b/Makefile.metalv1 new file mode 100644 index 00000000..390c7264 --- /dev/null +++ b/Makefile.metalv1 @@ -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=metalv1 +SPEC_BASE_URL:=https://api.equinix.com/metal/v1/api-docs +SPEC_ROOT_FILE:=openapi3.yaml + +CODE_DIR=${CODE_BASE_DIR}/${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 + +all: pull fetch patch generate stage + +generate: clean codegen remove-unused mod patch-post fmt test + +pull: + ${CRI} pull ${OPENAPI_IMAGE} + +fetch: + ${SPEC_FETCHER} ${SPEC_BASE_URL} ${SPEC_FETCHED_DIR} ${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; \ + done + +patch-post: + # patch is idempotent, always starting with the generated files + for diff in $(shell find patches/post -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 go \ + --package-name ${PACKAGE_NAME} \ + --http-user-agent "${USER_AGENT}" \ + -p packageVersion=${PACKAGE_VERSION} \ + --git-user-id ${GIT_ORG} \ + --git-repo-id ${GIT_REPO}/services \ + -c /local/config/openapi-generator.json \ + -t /local/${TEMPLATE_DIR} \ + -o /local/${CODE_DIR} \ + -i /local/${SPEC_PATCHED_DIR}/${SPEC_ROOT_FILE} + +validate: + ${OPENAPI_GENERATOR} validate \ + --recommend \ + -i /local/${SPEC_PATCHED_DIR} + +remove-unused: + rm -rf ${CODE_DIR}/api \ + ${CODE_DIR}/.travis.yml \ + ${CODE_DIR}/git_push.sh \ + ${CODE_DIR}/.openapi-generator \ + ${CODE_DIR}/go.mod \ + ${CODE_DIR}/go.sum diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 00000000..e69de29b diff --git a/examples/services/metalv1/create_device_in_facility/go.mod b/examples/services/metalv1/create_device_in_facility/go.mod new file mode 100644 index 00000000..2ad77249 --- /dev/null +++ b/examples/services/metalv1/create_device_in_facility/go.mod @@ -0,0 +1,10 @@ +module github.com/equinix/equinix-sdk-go/examples/service/metalv1/create_device_in_facility + +go 1.16 + +require ( + github.com/equinix/equinix-sdk-go v0.0.0-00010101000000-000000000000 + sigs.k8s.io/yaml v1.2.0 +) + +replace github.com/equinix/equinix-sdk-go => ../../../.. diff --git a/examples/services/metalv1/create_device_in_facility/go.sum b/examples/services/metalv1/create_device_in_facility/go.sum new file mode 100644 index 00000000..ac469fa1 --- /dev/null +++ b/examples/services/metalv1/create_device_in_facility/go.sum @@ -0,0 +1,18 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/examples/services/metalv1/create_device_in_facility/main.go b/examples/services/metalv1/create_device_in_facility/main.go new file mode 100644 index 00000000..6f442456 --- /dev/null +++ b/examples/services/metalv1/create_device_in_facility/main.go @@ -0,0 +1,42 @@ +package main + +import ( + "context" + "flag" + "fmt" + "os" + + metal "github.com/equinix/equinix-sdk-go/services/metalv1" + "sigs.k8s.io/yaml" +) + +func main() { + var projectId string + flag.StringVar(&projectId, "projectId", "", "") + flag.Parse() + + configuration := metal.NewConfiguration() + configuration.Debug = true + configuration.AddDefaultHeader("X-Auth-Token", os.Getenv("METAL_AUTH_TOKEN")) + api_client := metal.NewAPIClient(configuration) + deviceRequest := metal.CreateDeviceRequest{ + DeviceCreateInFacilityInput: &metal.DeviceCreateInFacilityInput{ + Facility: []string{"fr2"}, + Plan: "c3.medium.x86", + OperatingSystem: "ubuntu_20_04", + }, + } + device, r, err := api_client.DevicesApi.CreateDevice(context.Background(), projectId).CreateDeviceRequest(deviceRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateDevice`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `CreateDevice`: Device + s, err := yaml.Marshal(device) + if err != nil { + panic(err) + } + + fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlans`: %v\n", string(s)) +} diff --git a/examples/services/metalv1/create_device_in_metro/go.mod b/examples/services/metalv1/create_device_in_metro/go.mod new file mode 100644 index 00000000..24061ac7 --- /dev/null +++ b/examples/services/metalv1/create_device_in_metro/go.mod @@ -0,0 +1,10 @@ +module github.com/equinix/equinix-sdk-go/examples/service/metalv1/create_device_in_metro + +go 1.16 + +require ( + github.com/equinix/equinix-sdk-go v0.1.1-0.20220706151426-4a8e1963e004 + sigs.k8s.io/yaml v1.2.0 +) + +replace github.com/equinix/equinix-sdk-go => ../../../.. diff --git a/examples/services/metalv1/create_device_in_metro/go.sum b/examples/services/metalv1/create_device_in_metro/go.sum new file mode 100644 index 00000000..ac469fa1 --- /dev/null +++ b/examples/services/metalv1/create_device_in_metro/go.sum @@ -0,0 +1,18 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/examples/services/metalv1/create_device_in_metro/main.go b/examples/services/metalv1/create_device_in_metro/main.go new file mode 100644 index 00000000..844f9689 --- /dev/null +++ b/examples/services/metalv1/create_device_in_metro/main.go @@ -0,0 +1,42 @@ +package main + +import ( + "context" + "flag" + "fmt" + "os" + + metal "github.com/equinix/equinix-sdk-go/services/metalv1" + "sigs.k8s.io/yaml" +) + +func main() { + var projectId string + flag.StringVar(&projectId, "projectId", "", "") + flag.Parse() + + configuration := metal.NewConfiguration() + configuration.Debug = true + configuration.AddDefaultHeader("X-Auth-Token", os.Getenv("METAL_AUTH_TOKEN")) + api_client := metal.NewAPIClient(configuration) + deviceRequest := metal.CreateDeviceRequest{ + DeviceCreateInMetroInput: &metal.DeviceCreateInMetroInput{ + Metro: "da", + Plan: "c3.medium.x86", + OperatingSystem: "ubuntu_20_04", + }, + } + device, r, err := api_client.DevicesApi.CreateDevice(context.Background(), projectId).CreateDeviceRequest(deviceRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateDevice`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `CreateDevice`: Device + s, err := yaml.Marshal(device) + if err != nil { + panic(err) + } + + fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlans`: %v\n", string(s)) +} diff --git a/examples/services/metalv1/plans/go.mod b/examples/services/metalv1/plans/go.mod new file mode 100644 index 00000000..0baf98ba --- /dev/null +++ b/examples/services/metalv1/plans/go.mod @@ -0,0 +1,10 @@ +module github.com/equinix/equinix-sdk-go/examples/service/metalv1/plans + +go 1.16 + +require ( + github.com/equinix/equinix-sdk-go v0.1.1-0.20220706151426-4a8e1963e004 + sigs.k8s.io/yaml v1.2.0 +) + +replace github.com/equinix/equinix-sdk-go => ../../../.. diff --git a/examples/services/metalv1/plans/go.sum b/examples/services/metalv1/plans/go.sum new file mode 100644 index 00000000..ac469fa1 --- /dev/null +++ b/examples/services/metalv1/plans/go.sum @@ -0,0 +1,18 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/examples/services/metalv1/plans/main.go b/examples/services/metalv1/plans/main.go new file mode 100644 index 00000000..2a729ba6 --- /dev/null +++ b/examples/services/metalv1/plans/main.go @@ -0,0 +1,36 @@ +package main + +import ( + "context" + "fmt" + "os" + + metal "github.com/equinix/equinix-sdk-go/services/metalv1" + "sigs.k8s.io/yaml" +) + +func main() { + // TODO Because the swagger2 spec can not declare that facilities can be + // returned with plan results, including available_in results in: + // available_in: + // - href: "" + include := []string{} + exclude := []string{"available_in"} + configuration := metal.NewConfiguration() + configuration.Debug = true + configuration.AddDefaultHeader("X-Auth-Token", os.Getenv("METAL_AUTH_TOKEN")) + api_client := metal.NewAPIClient(configuration) + resp, r, err := api_client.PlansApi.FindPlans(context.Background()).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PlansApi.FindPlans``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + // response from `FindPlans`: PlanList + s, err := yaml.Marshal(resp.Plans) + if err != nil { + panic(err) + } + + fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlans`: %v\n", string(s)) +} diff --git a/patches/.keep b/patches/.keep new file mode 100644 index 00000000..e69de29b diff --git a/patches/post/.keep b/patches/post/.keep new file mode 100644 index 00000000..e69de29b diff --git a/patches/services/metalv1/.keep b/patches/services/metalv1/.keep new file mode 100644 index 00000000..e69de29b diff --git a/script/mark_paginated.py b/script/mark_paginated.py new file mode 100755 index 00000000..67c9c27d --- /dev/null +++ b/script/mark_paginated.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 + +# This script isn't run from Makefile. It's here to help generate patch for the +# x-paginated object. The x-paginated object marks that all-pages-listing +# method should be generated for given operation, think listing of devices +# in a project with more than 20 devices. + +# example run: +# for o in `find spec/oas3.patched/paths -name '*.yaml'`; do script/mark_paginated.py $o; done + +import sys +import os +import os.path +import ruamel.yaml + +yaml = ruamel.yaml.YAML() +yaml.preserve_quotes = True + +ymlfile = sys.argv[1] + +def getYaml(fn): + with open(fn) as f: + return yaml.load(f.read()) + +paginated = False +paginatedProperty = None + +operation = getYaml(ymlfile) + +def toGolangPropertyName(s): + return "".join([w.capitalize() for w in s.split("_")]) + +refkey = "$ref" +if "get" in operation: + getop = operation['get'] + if "parameters" in getop: + getopparams = getop['parameters'] + for p in getopparams: + if refkey in p: + if "/components/parameters/Page.yaml" in p[refkey]: + schemaPathRelative = getop['responses']['200']['content']['application/json']['schema']['$ref'] + schemaPath = schemaPathRelative.split("../")[-1] + twoTopDirs = ymlfile.split("/")[:2] + specDir = os.path.dirname(ymlfile) + schemaFile = os.path.join(twoTopDirs[0], twoTopDirs[1], schemaPath) + responseSchema = getYaml(schemaFile) + responseProps = set(responseSchema['properties'].keys()) + oid = getop['operationId'] + if 'meta' in responseProps: + responseProps.remove("meta") + else: + print("%s => %s doesn't have 'meta', and therefore no PageNum etc" % (oid, schemaFile)) + break + if len(responseProps) > 1: + print("%s => %s has 'page' but ambiguous response type with args %s" % + (oid, schemaFile, responseProps)) + break + print("marking %s as paginated" % oid) + paginated = True + paginatedProperty = toGolangPropertyName(responseProps.pop()) + break + + +if paginated: + operation['get']['x-equinix-metal-paginated-property'] = paginatedProperty + with open(ymlfile,"w") as f: + yaml.dump(operation, f) + + diff --git a/services/metalv1/.gitignore b/services/metalv1/.gitignore new file mode 100644 index 00000000..daf913b1 --- /dev/null +++ b/services/metalv1/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/services/metalv1/.openapi-generator-ignore b/services/metalv1/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/services/metalv1/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/services/metalv1/README.md b/services/metalv1/README.md new file mode 100644 index 00000000..1ec738a1 --- /dev/null +++ b/services/metalv1/README.md @@ -0,0 +1,730 @@ +# Go API client for metalv1 + +# Introduction +Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. + +The API allows you to programmatically interact with all +of your Equinix Metal resources, including devices, networks, addresses, organizations, +projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. + +The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . + +# Common Parameters + +The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. + +## Pagination + +Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. + +The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. + +## Sorting + +Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). + +## Filtering + +Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. + +For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: + +```sh +curl -H 'X-Auth-Token: my_authentication_token' \\ + https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 +``` + +Only IP addresses with the `type` field set to `public_ipv4` will be returned. + +## Searching + +Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. + +To search resources you can use the `search` query parameter. + +## Include and Exclude + +For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. + +```json +{ + ... + \"project\": { + \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" + } +} +``` + +If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. + +For example: + +```sh +curl -H 'X-Auth-Token: my_authentication_token' \\ + https://api.equinix.com/metal/v1/user?include=projects +``` + +The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. + +To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). + +```sh +curl -H 'X-Auth-Token: my_authentication_token' \\ + https://api.equinix.com/metal/v1/user?include=emails,projects,memberships +``` + +You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): + +```sh +curl -H 'X-Auth-Token: my_authentication_token' \\ + https://api.equinix.com/metal/v1/user?include=memberships.projects +``` + +To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import metalv1 "github.com/equinix/equinix-sdk-go/services/metalv1" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `metalv1.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), metalv1.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `metalv1.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), metalv1.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `metalv1.ContextOperationServerIndices` and `metalv1.ContextOperationServerVariables` context maps. + +```golang +ctx := context.WithValue(context.Background(), metalv1.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), metalv1.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthenticationApi* | [**CreateAPIKey**](docs/AuthenticationApi.md#createapikey) | **Post** /user/api-keys | Create an API key +*AuthenticationApi* | [**CreateProjectAPIKey**](docs/AuthenticationApi.md#createprojectapikey) | **Post** /projects/{id}/api-keys | Create an API key for a project. +*AuthenticationApi* | [**DeleteAPIKey**](docs/AuthenticationApi.md#deleteapikey) | **Delete** /api-keys/{id} | Delete the API key +*AuthenticationApi* | [**DeleteUserAPIKey**](docs/AuthenticationApi.md#deleteuserapikey) | **Delete** /user/api-keys/{id} | Delete the API key +*AuthenticationApi* | [**FindAPIKeys**](docs/AuthenticationApi.md#findapikeys) | **Get** /user/api-keys | Retrieve all user API keys +*AuthenticationApi* | [**FindProjectAPIKeys**](docs/AuthenticationApi.md#findprojectapikeys) | **Get** /projects/{id}/api-keys | Retrieve all API keys for the project. +*BGPApi* | [**DeleteBgpSession**](docs/BGPApi.md#deletebgpsession) | **Delete** /bgp/sessions/{id} | Delete the BGP session +*BGPApi* | [**FindBgpConfigByProject**](docs/BGPApi.md#findbgpconfigbyproject) | **Get** /projects/{id}/bgp-config | Retrieve a bgp config +*BGPApi* | [**FindBgpSessionById**](docs/BGPApi.md#findbgpsessionbyid) | **Get** /bgp/sessions/{id} | Retrieve a BGP session +*BGPApi* | [**FindGlobalBgpRanges**](docs/BGPApi.md#findglobalbgpranges) | **Get** /projects/{id}/global-bgp-ranges | Retrieve all global bgp ranges +*BGPApi* | [**FindProjectBgpSessions**](docs/BGPApi.md#findprojectbgpsessions) | **Get** /projects/{id}/bgp/sessions | Retrieve all BGP sessions for project +*BGPApi* | [**RequestBgpConfig**](docs/BGPApi.md#requestbgpconfig) | **Post** /projects/{id}/bgp-configs | Requesting bgp config +*BGPApi* | [**UpdateBgpSession**](docs/BGPApi.md#updatebgpsession) | **Put** /bgp/sessions/{id} | Update the BGP session +*BatchesApi* | [**CreateDeviceBatch**](docs/BatchesApi.md#createdevicebatch) | **Post** /projects/{id}/devices/batch | Create a devices batch +*BatchesApi* | [**DeleteBatch**](docs/BatchesApi.md#deletebatch) | **Delete** /batches/{id} | Delete the Batch +*BatchesApi* | [**FindBatchById**](docs/BatchesApi.md#findbatchbyid) | **Get** /batches/{id} | Retrieve a Batch +*BatchesApi* | [**FindBatchesByProject**](docs/BatchesApi.md#findbatchesbyproject) | **Get** /projects/{id}/batches | Retrieve all batches by project +*CapacityApi* | [**CheckCapacityForFacility**](docs/CapacityApi.md#checkcapacityforfacility) | **Post** /capacity | Check capacity +*CapacityApi* | [**CheckCapacityForMetro**](docs/CapacityApi.md#checkcapacityformetro) | **Post** /capacity/metros | Check capacity for a metro +*CapacityApi* | [**FindCapacityForFacility**](docs/CapacityApi.md#findcapacityforfacility) | **Get** /capacity | View capacity +*CapacityApi* | [**FindCapacityForMetro**](docs/CapacityApi.md#findcapacityformetro) | **Get** /capacity/metros | View capacity for metros +*CapacityApi* | [**FindOrganizationCapacityPerFacility**](docs/CapacityApi.md#findorganizationcapacityperfacility) | **Get** /organizations/{id}/capacity | View available hardware plans per Facility for given organization +*CapacityApi* | [**FindOrganizationCapacityPerMetro**](docs/CapacityApi.md#findorganizationcapacitypermetro) | **Get** /organizations/{id}/capacity/metros | View available hardware plans per Metro for given organization +*ConsoleLogDetailsApi* | [**CaptureScreenshot**](docs/ConsoleLogDetailsApi.md#capturescreenshot) | **Get** /devices/{id}/diagnostics/screenshot | +*DevicesApi* | [**CreateBgpSession**](docs/DevicesApi.md#createbgpsession) | **Post** /devices/{id}/bgp/sessions | Create a BGP session +*DevicesApi* | [**CreateDevice**](docs/DevicesApi.md#createdevice) | **Post** /projects/{id}/devices | Create a device +*DevicesApi* | [**CreateIPAssignment**](docs/DevicesApi.md#createipassignment) | **Post** /devices/{id}/ips | Create an ip assignment +*DevicesApi* | [**DeleteDevice**](docs/DevicesApi.md#deletedevice) | **Delete** /devices/{id} | Delete the device +*DevicesApi* | [**FindBgpSessions**](docs/DevicesApi.md#findbgpsessions) | **Get** /devices/{id}/bgp/sessions | Retrieve all BGP sessions +*DevicesApi* | [**FindDeviceById**](docs/DevicesApi.md#finddevicebyid) | **Get** /devices/{id} | Retrieve a device +*DevicesApi* | [**FindDeviceCustomdata**](docs/DevicesApi.md#finddevicecustomdata) | **Get** /devices/{id}/customdata | Retrieve the custom metadata of an instance +*DevicesApi* | [**FindDeviceMetadataByID**](docs/DevicesApi.md#finddevicemetadatabyid) | **Get** /devices/{id}/metadata | Retrieve metadata +*DevicesApi* | [**FindDeviceUserdataByID**](docs/DevicesApi.md#finddeviceuserdatabyid) | **Get** /devices/{id}/userdata | Retrieve userdata +*DevicesApi* | [**FindIPAssignmentCustomdata**](docs/DevicesApi.md#findipassignmentcustomdata) | **Get** /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment +*DevicesApi* | [**FindIPAssignments**](docs/DevicesApi.md#findipassignments) | **Get** /devices/{id}/ips | Retrieve all ip assignments +*DevicesApi* | [**FindInstanceBandwidth**](docs/DevicesApi.md#findinstancebandwidth) | **Get** /devices/{id}/bandwidth | Retrieve an instance bandwidth +*DevicesApi* | [**FindOrganizationDevices**](docs/DevicesApi.md#findorganizationdevices) | **Get** /organizations/{id}/devices | Retrieve all devices of an organization +*DevicesApi* | [**FindProjectDevices**](docs/DevicesApi.md#findprojectdevices) | **Get** /projects/{id}/devices | Retrieve all devices of a project +*DevicesApi* | [**FindTraffic**](docs/DevicesApi.md#findtraffic) | **Get** /devices/{id}/traffic | Retrieve device traffic +*DevicesApi* | [**GetBgpNeighborData**](docs/DevicesApi.md#getbgpneighbordata) | **Get** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device +*DevicesApi* | [**GetDeviceFirmwareSets**](docs/DevicesApi.md#getdevicefirmwaresets) | **Get** /devices/{id}/firmware-sets | Get Device's associated Firmware Set +*DevicesApi* | [**GetDeviceHealthRollup**](docs/DevicesApi.md#getdevicehealthrollup) | **Get** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status +*DevicesApi* | [**PerformAction**](docs/DevicesApi.md#performaction) | **Post** /devices/{id}/actions | Perform an action +*DevicesApi* | [**UpdateDevice**](docs/DevicesApi.md#updatedevice) | **Put** /devices/{id} | Update the device +*EmailsApi* | [**CreateEmail**](docs/EmailsApi.md#createemail) | **Post** /emails | Create an email +*EmailsApi* | [**DeleteEmail**](docs/EmailsApi.md#deleteemail) | **Delete** /emails/{id} | Delete the email +*EmailsApi* | [**FindEmailById**](docs/EmailsApi.md#findemailbyid) | **Get** /emails/{id} | Retrieve an email +*EmailsApi* | [**UpdateEmail**](docs/EmailsApi.md#updateemail) | **Put** /emails/{id} | Update the email +*EventsApi* | [**FindDeviceEvents**](docs/EventsApi.md#finddeviceevents) | **Get** /devices/{id}/events | Retrieve device's events +*EventsApi* | [**FindEventById**](docs/EventsApi.md#findeventbyid) | **Get** /events/{id} | Retrieve an event +*EventsApi* | [**FindEvents**](docs/EventsApi.md#findevents) | **Get** /events | Retrieve current user's events +*EventsApi* | [**FindInterconnectionEvents**](docs/EventsApi.md#findinterconnectionevents) | **Get** /connections/{connection_id}/events | Retrieve interconnection events +*EventsApi* | [**FindInterconnectionPortEvents**](docs/EventsApi.md#findinterconnectionportevents) | **Get** /connections/{connection_id}/ports/{id}/events | Retrieve interconnection port events +*EventsApi* | [**FindOrganizationEvents**](docs/EventsApi.md#findorganizationevents) | **Get** /organizations/{id}/events | Retrieve organization's events +*EventsApi* | [**FindProjectEvents**](docs/EventsApi.md#findprojectevents) | **Get** /projects/{id}/events | Retrieve project's events +*EventsApi* | [**FindVirtualCircuitEvents**](docs/EventsApi.md#findvirtualcircuitevents) | **Get** /virtual-circuits/{id}/events | Retrieve virtual circuit events +*EventsApi* | [**FindVrfRouteEvents**](docs/EventsApi.md#findvrfrouteevents) | **Get** /routes/{id}/events | Retrieve VRF route events +*FacilitiesApi* | [**FindFacilities**](docs/FacilitiesApi.md#findfacilities) | **Get** /facilities | Retrieve all facilities +*FacilitiesApi* | [**FindFacilitiesByOrganization**](docs/FacilitiesApi.md#findfacilitiesbyorganization) | **Get** /organizations/{id}/facilities | Retrieve all facilities visible by the organization +*FacilitiesApi* | [**FindFacilitiesByProject**](docs/FacilitiesApi.md#findfacilitiesbyproject) | **Get** /projects/{id}/facilities | Retrieve all facilities visible by the project +*FirmwareSetsApi* | [**GetOrganizationFirmwareSets**](docs/FirmwareSetsApi.md#getorganizationfirmwaresets) | **Get** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets +*FirmwareSetsApi* | [**GetProjectFirmwareSets**](docs/FirmwareSetsApi.md#getprojectfirmwaresets) | **Get** /projects/{id}/firmware-sets | Get Project's Firmware Sets +*HardwareReservationsApi* | [**ActivateHardwareReservation**](docs/HardwareReservationsApi.md#activatehardwarereservation) | **Post** /hardware-reservations/{id}/activate | Activate a spare hardware reservation +*HardwareReservationsApi* | [**FindHardwareReservationById**](docs/HardwareReservationsApi.md#findhardwarereservationbyid) | **Get** /hardware-reservations/{id} | Retrieve a hardware reservation +*HardwareReservationsApi* | [**FindProjectHardwareReservations**](docs/HardwareReservationsApi.md#findprojecthardwarereservations) | **Get** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project +*HardwareReservationsApi* | [**MoveHardwareReservation**](docs/HardwareReservationsApi.md#movehardwarereservation) | **Post** /hardware-reservations/{id}/move | Move a hardware reservation +*IPAddressesApi* | [**DeleteIPAddress**](docs/IPAddressesApi.md#deleteipaddress) | **Delete** /ips/{id} | Unassign an ip address +*IPAddressesApi* | [**FindIPAddressById**](docs/IPAddressesApi.md#findipaddressbyid) | **Get** /ips/{id} | Retrieve an ip address +*IPAddressesApi* | [**FindIPAddressCustomdata**](docs/IPAddressesApi.md#findipaddresscustomdata) | **Get** /ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation or IP Assignment +*IPAddressesApi* | [**FindIPAvailabilities**](docs/IPAddressesApi.md#findipavailabilities) | **Get** /ips/{id}/available | Retrieve all available subnets of a particular reservation +*IPAddressesApi* | [**FindIPReservations**](docs/IPAddressesApi.md#findipreservations) | **Get** /projects/{id}/ips | Retrieve all ip reservations +*IPAddressesApi* | [**RequestIPReservation**](docs/IPAddressesApi.md#requestipreservation) | **Post** /projects/{id}/ips | Requesting IP reservations +*IPAddressesApi* | [**UpdateIPAddress**](docs/IPAddressesApi.md#updateipaddress) | **Patch** /ips/{id} | Update an ip address +*IncidentsApi* | [**FindIncidents**](docs/IncidentsApi.md#findincidents) | **Get** /incidents | Retrieve the number of incidents +*InterconnectionsApi* | [**CreateInterconnectionPortVirtualCircuit**](docs/InterconnectionsApi.md#createinterconnectionportvirtualcircuit) | **Post** /connections/{connection_id}/ports/{port_id}/virtual-circuits | Create a new Virtual Circuit +*InterconnectionsApi* | [**CreateOrganizationInterconnection**](docs/InterconnectionsApi.md#createorganizationinterconnection) | **Post** /organizations/{organization_id}/connections | Request a new interconnection for the organization +*InterconnectionsApi* | [**CreateProjectInterconnection**](docs/InterconnectionsApi.md#createprojectinterconnection) | **Post** /projects/{project_id}/connections | Request a new interconnection for the project's organization +*InterconnectionsApi* | [**DeleteInterconnection**](docs/InterconnectionsApi.md#deleteinterconnection) | **Delete** /connections/{connection_id} | Delete interconnection +*InterconnectionsApi* | [**DeleteVirtualCircuit**](docs/InterconnectionsApi.md#deletevirtualcircuit) | **Delete** /virtual-circuits/{id} | Delete a virtual circuit +*InterconnectionsApi* | [**GetInterconnection**](docs/InterconnectionsApi.md#getinterconnection) | **Get** /connections/{connection_id} | Get interconnection +*InterconnectionsApi* | [**GetInterconnectionPort**](docs/InterconnectionsApi.md#getinterconnectionport) | **Get** /connections/{connection_id}/ports/{id} | Get a interconnection port +*InterconnectionsApi* | [**GetVirtualCircuit**](docs/InterconnectionsApi.md#getvirtualcircuit) | **Get** /virtual-circuits/{id} | Get a virtual circuit +*InterconnectionsApi* | [**ListInterconnectionPortVirtualCircuits**](docs/InterconnectionsApi.md#listinterconnectionportvirtualcircuits) | **Get** /connections/{connection_id}/ports/{port_id}/virtual-circuits | List a interconnection port's virtual circuits +*InterconnectionsApi* | [**ListInterconnectionPorts**](docs/InterconnectionsApi.md#listinterconnectionports) | **Get** /connections/{connection_id}/ports | List a interconnection's ports +*InterconnectionsApi* | [**ListInterconnectionVirtualCircuits**](docs/InterconnectionsApi.md#listinterconnectionvirtualcircuits) | **Get** /connections/{connection_id}/virtual-circuits | List a interconnection's virtual circuits +*InterconnectionsApi* | [**OrganizationListInterconnections**](docs/InterconnectionsApi.md#organizationlistinterconnections) | **Get** /organizations/{organization_id}/connections | List organization connections +*InterconnectionsApi* | [**ProjectListInterconnections**](docs/InterconnectionsApi.md#projectlistinterconnections) | **Get** /projects/{project_id}/connections | List project connections +*InterconnectionsApi* | [**UpdateInterconnection**](docs/InterconnectionsApi.md#updateinterconnection) | **Put** /connections/{connection_id} | Update interconnection +*InterconnectionsApi* | [**UpdateVirtualCircuit**](docs/InterconnectionsApi.md#updatevirtualcircuit) | **Put** /virtual-circuits/{id} | Update a virtual circuit +*InvitationsApi* | [**AcceptInvitation**](docs/InvitationsApi.md#acceptinvitation) | **Put** /invitations/{id} | Accept an invitation +*InvitationsApi* | [**DeclineInvitation**](docs/InvitationsApi.md#declineinvitation) | **Delete** /invitations/{id} | Decline an invitation +*InvitationsApi* | [**FindInvitationById**](docs/InvitationsApi.md#findinvitationbyid) | **Get** /invitations/{id} | View an invitation +*InvoicesApi* | [**FindOrganizationInvoices**](docs/InvoicesApi.md#findorganizationinvoices) | **Get** /organizations/{id}/invoices | Retrieve all invoices for an organization +*InvoicesApi* | [**GetInvoiceById**](docs/InvoicesApi.md#getinvoicebyid) | **Get** /invoices/{id} | Retrieve an invoice +*LicensesApi* | [**CreateLicense**](docs/LicensesApi.md#createlicense) | **Post** /projects/{id}/licenses | Create a License +*LicensesApi* | [**DeleteLicense**](docs/LicensesApi.md#deletelicense) | **Delete** /licenses/{id} | Delete the license +*LicensesApi* | [**FindLicenseById**](docs/LicensesApi.md#findlicensebyid) | **Get** /licenses/{id} | Retrieve a license +*LicensesApi* | [**FindProjectLicenses**](docs/LicensesApi.md#findprojectlicenses) | **Get** /projects/{id}/licenses | Retrieve all licenses +*LicensesApi* | [**UpdateLicense**](docs/LicensesApi.md#updatelicense) | **Put** /licenses/{id} | Update the license +*MembershipsApi* | [**DeleteMembership**](docs/MembershipsApi.md#deletemembership) | **Delete** /memberships/{id} | Delete the membership +*MembershipsApi* | [**FindMembershipById**](docs/MembershipsApi.md#findmembershipbyid) | **Get** /memberships/{id} | Retrieve a membership +*MembershipsApi* | [**UpdateMembership**](docs/MembershipsApi.md#updatemembership) | **Put** /memberships/{id} | Update the membership +*MetalGatewaysApi* | [**CreateMetalGateway**](docs/MetalGatewaysApi.md#createmetalgateway) | **Post** /projects/{project_id}/metal-gateways | Create a metal gateway +*MetalGatewaysApi* | [**CreateMetalGatewayElasticIp**](docs/MetalGatewaysApi.md#createmetalgatewayelasticip) | **Post** /metal-gateways/{id}/ips | Create a Metal Gateway Elastic IP +*MetalGatewaysApi* | [**DeleteMetalGateway**](docs/MetalGatewaysApi.md#deletemetalgateway) | **Delete** /metal-gateways/{id} | Deletes the metal gateway +*MetalGatewaysApi* | [**FindMetalGatewayById**](docs/MetalGatewaysApi.md#findmetalgatewaybyid) | **Get** /metal-gateways/{id} | Returns the metal gateway +*MetalGatewaysApi* | [**FindMetalGatewaysByProject**](docs/MetalGatewaysApi.md#findmetalgatewaysbyproject) | **Get** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project +*MetalGatewaysApi* | [**GetMetalGatewayElasticIps**](docs/MetalGatewaysApi.md#getmetalgatewayelasticips) | **Get** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs +*MetrosApi* | [**FindMetros**](docs/MetrosApi.md#findmetros) | **Get** /locations/metros | Retrieve all metros +*MetrosApi* | [**GetMetro**](docs/MetrosApi.md#getmetro) | **Get** /locations/metros/{id} | Retrieve a specific Metro's details +*OTPsApi* | [**FindEnsureOtp**](docs/OTPsApi.md#findensureotp) | **Post** /user/otp/verify/{otp} | Verify user by providing an OTP +*OTPsApi* | [**FindRecoveryCodes**](docs/OTPsApi.md#findrecoverycodes) | **Get** /user/otp/recovery-codes | Retrieve my recovery codes +*OTPsApi* | [**ReceiveCodes**](docs/OTPsApi.md#receivecodes) | **Post** /user/otp/sms/receive | Receive an OTP per sms +*OTPsApi* | [**RegenerateCodes**](docs/OTPsApi.md#regeneratecodes) | **Post** /user/otp/recovery-codes | Generate new recovery codes +*OperatingSystemsApi* | [**FindOperatingSystemVersion**](docs/OperatingSystemsApi.md#findoperatingsystemversion) | **Get** /operating-system-versions | Retrieve all operating system versions +*OperatingSystemsApi* | [**FindOperatingSystems**](docs/OperatingSystemsApi.md#findoperatingsystems) | **Get** /operating-systems | Retrieve all operating systems +*OrganizationsApi* | [**CreateOrganization**](docs/OrganizationsApi.md#createorganization) | **Post** /organizations | Create an organization +*OrganizationsApi* | [**CreateOrganizationInvitation**](docs/OrganizationsApi.md#createorganizationinvitation) | **Post** /organizations/{id}/invitations | Create an invitation for an organization +*OrganizationsApi* | [**CreateOrganizationProject**](docs/OrganizationsApi.md#createorganizationproject) | **Post** /organizations/{id}/projects | Create a project for the organization +*OrganizationsApi* | [**CreatePaymentMethod**](docs/OrganizationsApi.md#createpaymentmethod) | **Post** /organizations/{id}/payment-methods | Create a payment method for the given organization +*OrganizationsApi* | [**DeleteOrganization**](docs/OrganizationsApi.md#deleteorganization) | **Delete** /organizations/{id} | Delete the organization +*OrganizationsApi* | [**FindOperatingSystemsByOrganization**](docs/OrganizationsApi.md#findoperatingsystemsbyorganization) | **Get** /organizations/{id}/operating-systems | Retrieve all operating systems visible by the organization +*OrganizationsApi* | [**FindOrganizationById**](docs/OrganizationsApi.md#findorganizationbyid) | **Get** /organizations/{id} | Retrieve an organization's details +*OrganizationsApi* | [**FindOrganizationCustomdata**](docs/OrganizationsApi.md#findorganizationcustomdata) | **Get** /organizations/{id}/customdata | Retrieve the custom metadata of an organization +*OrganizationsApi* | [**FindOrganizationInvitations**](docs/OrganizationsApi.md#findorganizationinvitations) | **Get** /organizations/{id}/invitations | Retrieve organization invitations +*OrganizationsApi* | [**FindOrganizationPaymentMethods**](docs/OrganizationsApi.md#findorganizationpaymentmethods) | **Get** /organizations/{id}/payment-methods | Retrieve all payment methods of an organization +*OrganizationsApi* | [**FindOrganizationProjects**](docs/OrganizationsApi.md#findorganizationprojects) | **Get** /organizations/{id}/projects | Retrieve all projects of an organization +*OrganizationsApi* | [**FindOrganizationTransfers**](docs/OrganizationsApi.md#findorganizationtransfers) | **Get** /organizations/{id}/transfers | Retrieve all project transfer requests from or to an organization +*OrganizationsApi* | [**FindOrganizations**](docs/OrganizationsApi.md#findorganizations) | **Get** /organizations | Retrieve all organizations +*OrganizationsApi* | [**FindPlansByOrganization**](docs/OrganizationsApi.md#findplansbyorganization) | **Get** /organizations/{id}/plans | Retrieve all plans visible by the organization +*OrganizationsApi* | [**UpdateOrganization**](docs/OrganizationsApi.md#updateorganization) | **Put** /organizations/{id} | Update the organization +*PasswordResetTokensApi* | [**CreatePasswordResetToken**](docs/PasswordResetTokensApi.md#createpasswordresettoken) | **Post** /reset-password | Create a password reset token +*PasswordResetTokensApi* | [**ResetPassword**](docs/PasswordResetTokensApi.md#resetpassword) | **Delete** /reset-password | Reset current user password +*PaymentMethodsApi* | [**DeletePaymentMethod**](docs/PaymentMethodsApi.md#deletepaymentmethod) | **Delete** /payment-methods/{id} | Delete the payment method +*PaymentMethodsApi* | [**FindPaymentMethodById**](docs/PaymentMethodsApi.md#findpaymentmethodbyid) | **Get** /payment-methods/{id} | Retrieve a payment method +*PaymentMethodsApi* | [**UpdatePaymentMethod**](docs/PaymentMethodsApi.md#updatepaymentmethod) | **Put** /payment-methods/{id} | Update the payment method +*PlansApi* | [**FindPlans**](docs/PlansApi.md#findplans) | **Get** /plans | Retrieve all plans +*PlansApi* | [**FindPlansByProject**](docs/PlansApi.md#findplansbyproject) | **Get** /projects/{id}/plans | Retrieve all plans visible by the project +*PortsApi* | [**AssignNativeVlan**](docs/PortsApi.md#assignnativevlan) | **Post** /ports/{id}/native-vlan | Assign a native VLAN +*PortsApi* | [**AssignPort**](docs/PortsApi.md#assignport) | **Post** /ports/{id}/assign | Assign a port to virtual network +*PortsApi* | [**BondPort**](docs/PortsApi.md#bondport) | **Post** /ports/{id}/bond | Enabling bonding +*PortsApi* | [**ConvertLayer2**](docs/PortsApi.md#convertlayer2) | **Post** /ports/{id}/convert/layer-2 | Convert to Layer 2 +*PortsApi* | [**ConvertLayer3**](docs/PortsApi.md#convertlayer3) | **Post** /ports/{id}/convert/layer-3 | Convert to Layer 3 +*PortsApi* | [**CreatePortVlanAssignmentBatch**](docs/PortsApi.md#createportvlanassignmentbatch) | **Post** /ports/{id}/vlan-assignments/batches | Create a new Port-VLAN Assignment management batch +*PortsApi* | [**DeleteNativeVlan**](docs/PortsApi.md#deletenativevlan) | **Delete** /ports/{id}/native-vlan | Remove native VLAN +*PortsApi* | [**DisbondPort**](docs/PortsApi.md#disbondport) | **Post** /ports/{id}/disbond | Disabling bonding +*PortsApi* | [**FindPortById**](docs/PortsApi.md#findportbyid) | **Get** /ports/{id} | Retrieve a port +*PortsApi* | [**FindPortVlanAssignmentBatchByPortIdAndBatchId**](docs/PortsApi.md#findportvlanassignmentbatchbyportidandbatchid) | **Get** /ports/{id}/vlan-assignments/batches/{batch_id} | Retrieve a VLAN Assignment Batch's details +*PortsApi* | [**FindPortVlanAssignmentBatches**](docs/PortsApi.md#findportvlanassignmentbatches) | **Get** /ports/{id}/vlan-assignments/batches | List the VLAN Assignment Batches for a port +*PortsApi* | [**FindPortVlanAssignmentByPortIdAndAssignmentId**](docs/PortsApi.md#findportvlanassignmentbyportidandassignmentid) | **Get** /ports/{id}/vlan-assignments/{assignment_id} | Show a particular Port VLAN assignment's details +*PortsApi* | [**FindPortVlanAssignments**](docs/PortsApi.md#findportvlanassignments) | **Get** /ports/{id}/vlan-assignments | List Current VLAN assignments for a port +*PortsApi* | [**UnassignPort**](docs/PortsApi.md#unassignport) | **Post** /ports/{id}/unassign | Unassign a port +*ProjectsApi* | [**CreateProject**](docs/ProjectsApi.md#createproject) | **Post** /projects | Create a project +*ProjectsApi* | [**CreateProjectInvitation**](docs/ProjectsApi.md#createprojectinvitation) | **Post** /projects/{project_id}/invitations | Create an invitation for a project +*ProjectsApi* | [**CreateTransferRequest**](docs/ProjectsApi.md#createtransferrequest) | **Post** /projects/{id}/transfers | Create a transfer request +*ProjectsApi* | [**DeleteProject**](docs/ProjectsApi.md#deleteproject) | **Delete** /projects/{id} | Delete the project +*ProjectsApi* | [**FindIPReservationCustomdata**](docs/ProjectsApi.md#findipreservationcustomdata) | **Get** /projects/{project_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation +*ProjectsApi* | [**FindProjectById**](docs/ProjectsApi.md#findprojectbyid) | **Get** /projects/{id} | Retrieve a project +*ProjectsApi* | [**FindProjectCustomdata**](docs/ProjectsApi.md#findprojectcustomdata) | **Get** /projects/{id}/customdata | Retrieve the custom metadata of a project +*ProjectsApi* | [**FindProjectInvitations**](docs/ProjectsApi.md#findprojectinvitations) | **Get** /projects/{project_id}/invitations | Retrieve project invitations +*ProjectsApi* | [**FindProjectMemberships**](docs/ProjectsApi.md#findprojectmemberships) | **Get** /projects/{project_id}/memberships | Retrieve project memberships +*ProjectsApi* | [**FindProjects**](docs/ProjectsApi.md#findprojects) | **Get** /projects | Retrieve all projects +*ProjectsApi* | [**UpdateProject**](docs/ProjectsApi.md#updateproject) | **Put** /projects/{id} | Update the project +*SSHKeysApi* | [**CreateProjectSSHKey**](docs/SSHKeysApi.md#createprojectsshkey) | **Post** /projects/{id}/ssh-keys | Create a ssh key for the given project +*SSHKeysApi* | [**CreateSSHKey**](docs/SSHKeysApi.md#createsshkey) | **Post** /ssh-keys | Create a ssh key for the current user +*SSHKeysApi* | [**DeleteSSHKey**](docs/SSHKeysApi.md#deletesshkey) | **Delete** /ssh-keys/{id} | Delete the ssh key +*SSHKeysApi* | [**FindDeviceSSHKeys**](docs/SSHKeysApi.md#finddevicesshkeys) | **Get** /devices/{id}/ssh-keys | Retrieve a device's ssh keys +*SSHKeysApi* | [**FindProjectSSHKeys**](docs/SSHKeysApi.md#findprojectsshkeys) | **Get** /projects/{id}/ssh-keys | Retrieve a project's ssh keys +*SSHKeysApi* | [**FindSSHKeyById**](docs/SSHKeysApi.md#findsshkeybyid) | **Get** /ssh-keys/{id} | Retrieve a ssh key +*SSHKeysApi* | [**FindSSHKeys**](docs/SSHKeysApi.md#findsshkeys) | **Get** /ssh-keys | Retrieve all ssh keys +*SSHKeysApi* | [**UpdateSSHKey**](docs/SSHKeysApi.md#updatesshkey) | **Put** /ssh-keys/{id} | Update the ssh key +*SelfServiceReservationsApi* | [**CreateSelfServiceReservation**](docs/SelfServiceReservationsApi.md#createselfservicereservation) | **Post** /projects/{project_id}/self-service/reservations | Create a reservation +*SelfServiceReservationsApi* | [**FindSelfServiceReservation**](docs/SelfServiceReservationsApi.md#findselfservicereservation) | **Get** /projects/{project_id}/self-service/reservations/{id} | Retrieve a reservation +*SelfServiceReservationsApi* | [**FindSelfServiceReservations**](docs/SelfServiceReservationsApi.md#findselfservicereservations) | **Get** /projects/{project_id}/self-service/reservations | Retrieve all reservations +*SpotMarketApi* | [**CreateSpotMarketRequest**](docs/SpotMarketApi.md#createspotmarketrequest) | **Post** /projects/{id}/spot-market-requests | Create a spot market request +*SpotMarketApi* | [**DeleteSpotMarketRequest**](docs/SpotMarketApi.md#deletespotmarketrequest) | **Delete** /spot-market-requests/{id} | Delete the spot market request +*SpotMarketApi* | [**FindMetroSpotMarketPrices**](docs/SpotMarketApi.md#findmetrospotmarketprices) | **Get** /market/spot/prices/metros | Get current spot market prices for metros +*SpotMarketApi* | [**FindSpotMarketPrices**](docs/SpotMarketApi.md#findspotmarketprices) | **Get** /market/spot/prices | Get current spot market prices +*SpotMarketApi* | [**FindSpotMarketPricesHistory**](docs/SpotMarketApi.md#findspotmarketpriceshistory) | **Get** /market/spot/prices/history | Get spot market prices for a given period of time +*SpotMarketApi* | [**FindSpotMarketRequestById**](docs/SpotMarketApi.md#findspotmarketrequestbyid) | **Get** /spot-market-requests/{id} | Retrieve a spot market request +*SpotMarketApi* | [**ListSpotMarketRequests**](docs/SpotMarketApi.md#listspotmarketrequests) | **Get** /projects/{id}/spot-market-requests | List spot market requests +*SupportRequestApi* | [**RequestSuppert**](docs/SupportRequestApi.md#requestsuppert) | **Post** /support-requests | Create a support ticket +*TransferRequestsApi* | [**AcceptTransferRequest**](docs/TransferRequestsApi.md#accepttransferrequest) | **Put** /transfers/{id} | Accept a transfer request +*TransferRequestsApi* | [**DeclineTransferRequest**](docs/TransferRequestsApi.md#declinetransferrequest) | **Delete** /transfers/{id} | Decline a transfer request +*TransferRequestsApi* | [**FindTransferRequestById**](docs/TransferRequestsApi.md#findtransferrequestbyid) | **Get** /transfers/{id} | View a transfer request +*TwoFactorAuthApi* | [**DisableTfaApp**](docs/TwoFactorAuthApi.md#disabletfaapp) | **Delete** /user/otp/app | Disable two factor authentication +*TwoFactorAuthApi* | [**DisableTfaSms**](docs/TwoFactorAuthApi.md#disabletfasms) | **Delete** /user/otp/sms | Disable two factor authentication +*TwoFactorAuthApi* | [**EnableTfaApp**](docs/TwoFactorAuthApi.md#enabletfaapp) | **Post** /user/otp/app | Enable two factor auth using app +*TwoFactorAuthApi* | [**EnableTfaSms**](docs/TwoFactorAuthApi.md#enabletfasms) | **Post** /user/otp/sms | Enable two factor auth using sms +*UsagesApi* | [**FindDeviceUsages**](docs/UsagesApi.md#finddeviceusages) | **Get** /devices/{id}/usages | Retrieve all usages for device +*UsagesApi* | [**FindProjectUsage**](docs/UsagesApi.md#findprojectusage) | **Get** /projects/{id}/usages | Retrieve all usages for project +*UserVerificationTokensApi* | [**ConsumeVerificationRequest**](docs/UserVerificationTokensApi.md#consumeverificationrequest) | **Put** /verify-email | Verify a user using an email verification token +*UserVerificationTokensApi* | [**CreateValidationRequest**](docs/UserVerificationTokensApi.md#createvalidationrequest) | **Post** /verify-email | Create an email verification request +*UserdataApi* | [**ValidateUserdata**](docs/UserdataApi.md#validateuserdata) | **Post** /userdata/validate | Validate user data +*UsersApi* | [**CreateUser**](docs/UsersApi.md#createuser) | **Post** /users | Create a user +*UsersApi* | [**FindCurrentUser**](docs/UsersApi.md#findcurrentuser) | **Get** /user | Retrieve the current user +*UsersApi* | [**FindInvitations**](docs/UsersApi.md#findinvitations) | **Get** /invitations | Retrieve current user invitations +*UsersApi* | [**FindUserById**](docs/UsersApi.md#finduserbyid) | **Get** /users/{id} | Retrieve a user +*UsersApi* | [**FindUserCustomdata**](docs/UsersApi.md#findusercustomdata) | **Get** /users/{id}/customdata | Retrieve the custom metadata of a user +*UsersApi* | [**FindUsers**](docs/UsersApi.md#findusers) | **Get** /users | Retrieve all users +*UsersApi* | [**UpdateCurrentUser**](docs/UsersApi.md#updatecurrentuser) | **Put** /user | Update the current user +*VLANsApi* | [**CreateVirtualNetwork**](docs/VLANsApi.md#createvirtualnetwork) | **Post** /projects/{id}/virtual-networks | Create a virtual network +*VLANsApi* | [**DeleteVirtualNetwork**](docs/VLANsApi.md#deletevirtualnetwork) | **Delete** /virtual-networks/{id} | Delete a virtual network +*VLANsApi* | [**FindVirtualNetworks**](docs/VLANsApi.md#findvirtualnetworks) | **Get** /projects/{id}/virtual-networks | Retrieve all virtual networks +*VLANsApi* | [**GetVirtualNetwork**](docs/VLANsApi.md#getvirtualnetwork) | **Get** /virtual-networks/{id} | Get a virtual network +*VRFsApi* | [**BgpDynamicNeighborsIdGet**](docs/VRFsApi.md#bgpdynamicneighborsidget) | **Get** /bgp-dynamic-neighbors/{id} | Retrieve a BGP Dynamic Neighbor +*VRFsApi* | [**CreateBgpDynamicNeighbor**](docs/VRFsApi.md#createbgpdynamicneighbor) | **Post** /metal-gateways/{id}/bgp-dynamic-neighbors | Create a VRF BGP Dynamic Neighbor range +*VRFsApi* | [**CreateVrf**](docs/VRFsApi.md#createvrf) | **Post** /projects/{id}/vrfs | Create a new VRF in the specified project +*VRFsApi* | [**CreateVrfRoute**](docs/VRFsApi.md#createvrfroute) | **Post** /vrfs/{id}/routes | Create a VRF route +*VRFsApi* | [**DeleteBgpDynamicNeighborById**](docs/VRFsApi.md#deletebgpdynamicneighborbyid) | **Delete** /bgp-dynamic-neighbors/{id} | Delete a VRF BGP Dynamic Neighbor +*VRFsApi* | [**DeleteVrf**](docs/VRFsApi.md#deletevrf) | **Delete** /vrfs/{id} | Delete the VRF +*VRFsApi* | [**DeleteVrfRouteById**](docs/VRFsApi.md#deletevrfroutebyid) | **Delete** /routes/{id} | Delete a VRF Route +*VRFsApi* | [**FindVrfById**](docs/VRFsApi.md#findvrfbyid) | **Get** /vrfs/{id} | Retrieve a VRF +*VRFsApi* | [**FindVrfIpReservation**](docs/VRFsApi.md#findvrfipreservation) | **Get** /vrfs/{vrf_id}/ips/{id} | Retrieve all VRF IP Reservations in the VRF +*VRFsApi* | [**FindVrfIpReservations**](docs/VRFsApi.md#findvrfipreservations) | **Get** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF +*VRFsApi* | [**FindVrfRouteById**](docs/VRFsApi.md#findvrfroutebyid) | **Get** /routes/{id} | Retrieve a VRF Route +*VRFsApi* | [**FindVrfs**](docs/VRFsApi.md#findvrfs) | **Get** /projects/{id}/vrfs | Retrieve all VRFs in the project +*VRFsApi* | [**GetBgpDynamicNeighbors**](docs/VRFsApi.md#getbgpdynamicneighbors) | **Get** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +*VRFsApi* | [**GetVrfRoutes**](docs/VRFsApi.md#getvrfroutes) | **Get** /vrfs/{id}/routes | Retrieve all routes in the VRF +*VRFsApi* | [**UpdateVrf**](docs/VRFsApi.md#updatevrf) | **Put** /vrfs/{id} | Update the VRF +*VRFsApi* | [**UpdateVrfRouteById**](docs/VRFsApi.md#updatevrfroutebyid) | **Put** /routes/{id} | Update a VRF Route + + +## Documentation For Models + + - [ActivateHardwareReservationRequest](docs/ActivateHardwareReservationRequest.md) + - [Address](docs/Address.md) + - [Attribute](docs/Attribute.md) + - [AttributeData](docs/AttributeData.md) + - [AuthToken](docs/AuthToken.md) + - [AuthTokenInput](docs/AuthTokenInput.md) + - [AuthTokenList](docs/AuthTokenList.md) + - [AuthTokenProject](docs/AuthTokenProject.md) + - [AuthTokenUser](docs/AuthTokenUser.md) + - [BGPSessionInput](docs/BGPSessionInput.md) + - [BGPSessionInputAddressFamily](docs/BGPSessionInputAddressFamily.md) + - [Batch](docs/Batch.md) + - [BatchesList](docs/BatchesList.md) + - [BgpConfig](docs/BgpConfig.md) + - [BgpConfigDeploymentType](docs/BgpConfigDeploymentType.md) + - [BgpConfigRequestInput](docs/BgpConfigRequestInput.md) + - [BgpConfigRequestInputDeploymentType](docs/BgpConfigRequestInputDeploymentType.md) + - [BgpConfigStatus](docs/BgpConfigStatus.md) + - [BgpDynamicNeighbor](docs/BgpDynamicNeighbor.md) + - [BgpDynamicNeighborCreateInput](docs/BgpDynamicNeighborCreateInput.md) + - [BgpDynamicNeighborList](docs/BgpDynamicNeighborList.md) + - [BgpDynamicNeighborState](docs/BgpDynamicNeighborState.md) + - [BgpNeighborData](docs/BgpNeighborData.md) + - [BgpRoute](docs/BgpRoute.md) + - [BgpSession](docs/BgpSession.md) + - [BgpSessionAddressFamily](docs/BgpSessionAddressFamily.md) + - [BgpSessionList](docs/BgpSessionList.md) + - [BgpSessionNeighbors](docs/BgpSessionNeighbors.md) + - [BondPortData](docs/BondPortData.md) + - [CapacityCheckPerFacilityInfo](docs/CapacityCheckPerFacilityInfo.md) + - [CapacityCheckPerFacilityList](docs/CapacityCheckPerFacilityList.md) + - [CapacityCheckPerMetroInfo](docs/CapacityCheckPerMetroInfo.md) + - [CapacityCheckPerMetroList](docs/CapacityCheckPerMetroList.md) + - [CapacityInput](docs/CapacityInput.md) + - [CapacityLevelPerBaremetal](docs/CapacityLevelPerBaremetal.md) + - [CapacityList](docs/CapacityList.md) + - [Component](docs/Component.md) + - [Coordinates](docs/Coordinates.md) + - [CreateDeviceRequest](docs/CreateDeviceRequest.md) + - [CreateEmailInput](docs/CreateEmailInput.md) + - [CreateMetalGatewayRequest](docs/CreateMetalGatewayRequest.md) + - [CreateOrganizationInterconnectionRequest](docs/CreateOrganizationInterconnectionRequest.md) + - [CreateSelfServiceReservationRequest](docs/CreateSelfServiceReservationRequest.md) + - [CreateSelfServiceReservationRequestPeriod](docs/CreateSelfServiceReservationRequestPeriod.md) + - [CreateSelfServiceReservationRequestPeriodCount](docs/CreateSelfServiceReservationRequestPeriodCount.md) + - [CreateSelfServiceReservationRequestPeriodUnit](docs/CreateSelfServiceReservationRequestPeriodUnit.md) + - [DedicatedPortCreateInput](docs/DedicatedPortCreateInput.md) + - [DedicatedPortCreateInputMode](docs/DedicatedPortCreateInputMode.md) + - [DedicatedPortCreateInputType](docs/DedicatedPortCreateInputType.md) + - [Device](docs/Device.md) + - [DeviceActionInput](docs/DeviceActionInput.md) + - [DeviceActionInputType](docs/DeviceActionInputType.md) + - [DeviceActionsInner](docs/DeviceActionsInner.md) + - [DeviceCreateInFacilityInput](docs/DeviceCreateInFacilityInput.md) + - [DeviceCreateInMetroInput](docs/DeviceCreateInMetroInput.md) + - [DeviceCreateInput](docs/DeviceCreateInput.md) + - [DeviceCreateInputBillingCycle](docs/DeviceCreateInputBillingCycle.md) + - [DeviceCreatedBy](docs/DeviceCreatedBy.md) + - [DeviceHealthRollup](docs/DeviceHealthRollup.md) + - [DeviceHealthRollupHealthRollup](docs/DeviceHealthRollupHealthRollup.md) + - [DeviceList](docs/DeviceList.md) + - [DeviceMetro](docs/DeviceMetro.md) + - [DeviceProjectLite](docs/DeviceProjectLite.md) + - [DeviceState](docs/DeviceState.md) + - [DeviceUpdateInput](docs/DeviceUpdateInput.md) + - [DeviceUsage](docs/DeviceUsage.md) + - [DeviceUsageList](docs/DeviceUsageList.md) + - [Disk](docs/Disk.md) + - [Email](docs/Email.md) + - [EmailInput](docs/EmailInput.md) + - [Entitlement](docs/Entitlement.md) + - [Error](docs/Error.md) + - [Event](docs/Event.md) + - [EventList](docs/EventList.md) + - [FabricServiceToken](docs/FabricServiceToken.md) + - [FabricServiceTokenRole](docs/FabricServiceTokenRole.md) + - [FabricServiceTokenServiceTokenType](docs/FabricServiceTokenServiceTokenType.md) + - [FabricServiceTokenState](docs/FabricServiceTokenState.md) + - [Facility](docs/Facility.md) + - [FacilityFeaturesInner](docs/FacilityFeaturesInner.md) + - [FacilityInput](docs/FacilityInput.md) + - [FacilityList](docs/FacilityList.md) + - [Filesystem](docs/Filesystem.md) + - [FindFacilitiesIncludeParameterInner](docs/FindFacilitiesIncludeParameterInner.md) + - [FindIPAddressById200Response](docs/FindIPAddressById200Response.md) + - [FindIPAvailabilitiesCidrParameter](docs/FindIPAvailabilitiesCidrParameter.md) + - [FindIPReservationsTypesParameterInner](docs/FindIPReservationsTypesParameterInner.md) + - [FindMetalGatewayById200Response](docs/FindMetalGatewayById200Response.md) + - [FindOrganizationDevicesCategoriesParameterInner](docs/FindOrganizationDevicesCategoriesParameterInner.md) + - [FindOrganizationsPersonalParameter](docs/FindOrganizationsPersonalParameter.md) + - [FindPlansTypeParameter](docs/FindPlansTypeParameter.md) + - [FindProjectHardwareReservationsProvisionableParameter](docs/FindProjectHardwareReservationsProvisionableParameter.md) + - [FindProjectHardwareReservationsStateParameter](docs/FindProjectHardwareReservationsStateParameter.md) + - [FindTrafficBucketParameter](docs/FindTrafficBucketParameter.md) + - [FindTrafficDirectionParameter](docs/FindTrafficDirectionParameter.md) + - [FindTrafficIntervalParameter](docs/FindTrafficIntervalParameter.md) + - [FindTrafficTimeframeParameter](docs/FindTrafficTimeframeParameter.md) + - [FirmwareSet](docs/FirmwareSet.md) + - [FirmwareSetListResponse](docs/FirmwareSetListResponse.md) + - [FirmwareSetResponse](docs/FirmwareSetResponse.md) + - [GlobalBgpRange](docs/GlobalBgpRange.md) + - [GlobalBgpRangeList](docs/GlobalBgpRangeList.md) + - [HardwareReservation](docs/HardwareReservation.md) + - [HardwareReservationList](docs/HardwareReservationList.md) + - [Href](docs/Href.md) + - [IPAddress](docs/IPAddress.md) + - [IPAddressAddressFamily](docs/IPAddressAddressFamily.md) + - [IPAssignment](docs/IPAssignment.md) + - [IPAssignmentInput](docs/IPAssignmentInput.md) + - [IPAssignmentList](docs/IPAssignmentList.md) + - [IPAssignmentMetro](docs/IPAssignmentMetro.md) + - [IPAssignmentState](docs/IPAssignmentState.md) + - [IPAssignmentType](docs/IPAssignmentType.md) + - [IPAssignmentUpdateInput](docs/IPAssignmentUpdateInput.md) + - [IPAvailabilitiesList](docs/IPAvailabilitiesList.md) + - [IPReservation](docs/IPReservation.md) + - [IPReservationFacility](docs/IPReservationFacility.md) + - [IPReservationList](docs/IPReservationList.md) + - [IPReservationListIpAddressesInner](docs/IPReservationListIpAddressesInner.md) + - [IPReservationMetro](docs/IPReservationMetro.md) + - [IPReservationRequestInput](docs/IPReservationRequestInput.md) + - [IPReservationType](docs/IPReservationType.md) + - [InstancesBatchCreateInput](docs/InstancesBatchCreateInput.md) + - [InstancesBatchCreateInputBatchesInner](docs/InstancesBatchCreateInputBatchesInner.md) + - [Interconnection](docs/Interconnection.md) + - [InterconnectionList](docs/InterconnectionList.md) + - [InterconnectionMode](docs/InterconnectionMode.md) + - [InterconnectionPort](docs/InterconnectionPort.md) + - [InterconnectionPortList](docs/InterconnectionPortList.md) + - [InterconnectionPortRole](docs/InterconnectionPortRole.md) + - [InterconnectionPortStatus](docs/InterconnectionPortStatus.md) + - [InterconnectionRedundancy](docs/InterconnectionRedundancy.md) + - [InterconnectionType](docs/InterconnectionType.md) + - [InterconnectionUpdateInput](docs/InterconnectionUpdateInput.md) + - [Invitation](docs/Invitation.md) + - [InvitationInput](docs/InvitationInput.md) + - [InvitationList](docs/InvitationList.md) + - [InvitationRolesInner](docs/InvitationRolesInner.md) + - [Invoice](docs/Invoice.md) + - [InvoiceList](docs/InvoiceList.md) + - [License](docs/License.md) + - [LicenseCreateInput](docs/LicenseCreateInput.md) + - [LicenseList](docs/LicenseList.md) + - [LicenseUpdateInput](docs/LicenseUpdateInput.md) + - [LineItem](docs/LineItem.md) + - [Membership](docs/Membership.md) + - [MembershipInput](docs/MembershipInput.md) + - [MembershipList](docs/MembershipList.md) + - [Meta](docs/Meta.md) + - [Metadata](docs/Metadata.md) + - [MetadataNetwork](docs/MetadataNetwork.md) + - [MetadataNetworkNetwork](docs/MetadataNetworkNetwork.md) + - [MetadataNetworkNetworkBonding](docs/MetadataNetworkNetworkBonding.md) + - [MetalGateway](docs/MetalGateway.md) + - [MetalGatewayCreateInput](docs/MetalGatewayCreateInput.md) + - [MetalGatewayElasticIpCreateInput](docs/MetalGatewayElasticIpCreateInput.md) + - [MetalGatewayList](docs/MetalGatewayList.md) + - [MetalGatewayListMetalGatewaysInner](docs/MetalGatewayListMetalGatewaysInner.md) + - [MetalGatewayLite](docs/MetalGatewayLite.md) + - [MetalGatewayState](docs/MetalGatewayState.md) + - [Metro](docs/Metro.md) + - [MetroInput](docs/MetroInput.md) + - [MetroList](docs/MetroList.md) + - [Mount](docs/Mount.md) + - [MoveHardwareReservationRequest](docs/MoveHardwareReservationRequest.md) + - [NewPassword](docs/NewPassword.md) + - [OperatingSystem](docs/OperatingSystem.md) + - [OperatingSystemList](docs/OperatingSystemList.md) + - [Organization](docs/Organization.md) + - [OrganizationInput](docs/OrganizationInput.md) + - [OrganizationList](docs/OrganizationList.md) + - [ParentBlock](docs/ParentBlock.md) + - [Partition](docs/Partition.md) + - [PaymentMethod](docs/PaymentMethod.md) + - [PaymentMethodBillingAddress](docs/PaymentMethodBillingAddress.md) + - [PaymentMethodCreateInput](docs/PaymentMethodCreateInput.md) + - [PaymentMethodList](docs/PaymentMethodList.md) + - [PaymentMethodUpdateInput](docs/PaymentMethodUpdateInput.md) + - [Plan](docs/Plan.md) + - [PlanAvailableInInner](docs/PlanAvailableInInner.md) + - [PlanAvailableInInnerPrice](docs/PlanAvailableInInnerPrice.md) + - [PlanAvailableInMetrosInner](docs/PlanAvailableInMetrosInner.md) + - [PlanDeploymentTypesInner](docs/PlanDeploymentTypesInner.md) + - [PlanList](docs/PlanList.md) + - [PlanSpecs](docs/PlanSpecs.md) + - [PlanSpecsCpusInner](docs/PlanSpecsCpusInner.md) + - [PlanSpecsDrivesInner](docs/PlanSpecsDrivesInner.md) + - [PlanSpecsDrivesInnerCategory](docs/PlanSpecsDrivesInnerCategory.md) + - [PlanSpecsFeatures](docs/PlanSpecsFeatures.md) + - [PlanSpecsMemory](docs/PlanSpecsMemory.md) + - [PlanSpecsNicsInner](docs/PlanSpecsNicsInner.md) + - [PlanType](docs/PlanType.md) + - [Port](docs/Port.md) + - [PortAssignInput](docs/PortAssignInput.md) + - [PortConvertLayer3Input](docs/PortConvertLayer3Input.md) + - [PortConvertLayer3InputRequestIpsInner](docs/PortConvertLayer3InputRequestIpsInner.md) + - [PortData](docs/PortData.md) + - [PortNetworkType](docs/PortNetworkType.md) + - [PortType](docs/PortType.md) + - [PortVlanAssignment](docs/PortVlanAssignment.md) + - [PortVlanAssignmentBatch](docs/PortVlanAssignmentBatch.md) + - [PortVlanAssignmentBatchCreateInput](docs/PortVlanAssignmentBatchCreateInput.md) + - [PortVlanAssignmentBatchCreateInputVlanAssignmentsInner](docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md) + - [PortVlanAssignmentBatchList](docs/PortVlanAssignmentBatchList.md) + - [PortVlanAssignmentBatchState](docs/PortVlanAssignmentBatchState.md) + - [PortVlanAssignmentBatchVlanAssignmentsInner](docs/PortVlanAssignmentBatchVlanAssignmentsInner.md) + - [PortVlanAssignmentBatchVlanAssignmentsInnerState](docs/PortVlanAssignmentBatchVlanAssignmentsInnerState.md) + - [PortVlanAssignmentList](docs/PortVlanAssignmentList.md) + - [PortVlanAssignmentState](docs/PortVlanAssignmentState.md) + - [Project](docs/Project.md) + - [ProjectCreateFromRootInput](docs/ProjectCreateFromRootInput.md) + - [ProjectCreateFromRootInputType](docs/ProjectCreateFromRootInputType.md) + - [ProjectCreateInput](docs/ProjectCreateInput.md) + - [ProjectIdName](docs/ProjectIdName.md) + - [ProjectList](docs/ProjectList.md) + - [ProjectType](docs/ProjectType.md) + - [ProjectUpdateInput](docs/ProjectUpdateInput.md) + - [ProjectUsage](docs/ProjectUsage.md) + - [ProjectUsageList](docs/ProjectUsageList.md) + - [Raid](docs/Raid.md) + - [RecoveryCodeList](docs/RecoveryCodeList.md) + - [RequestIPReservation201Response](docs/RequestIPReservation201Response.md) + - [RequestIPReservationRequest](docs/RequestIPReservationRequest.md) + - [SSHKey](docs/SSHKey.md) + - [SSHKeyCreateInput](docs/SSHKeyCreateInput.md) + - [SSHKeyInput](docs/SSHKeyInput.md) + - [SSHKeyList](docs/SSHKeyList.md) + - [SelfServiceReservationItemRequest](docs/SelfServiceReservationItemRequest.md) + - [SelfServiceReservationItemResponse](docs/SelfServiceReservationItemResponse.md) + - [SelfServiceReservationList](docs/SelfServiceReservationList.md) + - [SelfServiceReservationResponse](docs/SelfServiceReservationResponse.md) + - [ServerInfo](docs/ServerInfo.md) + - [SpotMarketPricesList](docs/SpotMarketPricesList.md) + - [SpotMarketPricesPerMetroList](docs/SpotMarketPricesPerMetroList.md) + - [SpotMarketPricesPerMetroReport](docs/SpotMarketPricesPerMetroReport.md) + - [SpotMarketRequest](docs/SpotMarketRequest.md) + - [SpotMarketRequestCreateInput](docs/SpotMarketRequestCreateInput.md) + - [SpotMarketRequestCreateInputInstanceParameters](docs/SpotMarketRequestCreateInputInstanceParameters.md) + - [SpotMarketRequestList](docs/SpotMarketRequestList.md) + - [SpotMarketRequestMetro](docs/SpotMarketRequestMetro.md) + - [SpotPricesDatapoints](docs/SpotPricesDatapoints.md) + - [SpotPricesHistoryReport](docs/SpotPricesHistoryReport.md) + - [SpotPricesPerBaremetal](docs/SpotPricesPerBaremetal.md) + - [SpotPricesPerFacility](docs/SpotPricesPerFacility.md) + - [SpotPricesPerNewFacility](docs/SpotPricesPerNewFacility.md) + - [SpotPricesReport](docs/SpotPricesReport.md) + - [Storage](docs/Storage.md) + - [SupportRequestInput](docs/SupportRequestInput.md) + - [SupportRequestInputPriority](docs/SupportRequestInputPriority.md) + - [TransferRequest](docs/TransferRequest.md) + - [TransferRequestInput](docs/TransferRequestInput.md) + - [TransferRequestList](docs/TransferRequestList.md) + - [UpdateEmailInput](docs/UpdateEmailInput.md) + - [User](docs/User.md) + - [UserCreateInput](docs/UserCreateInput.md) + - [UserLimited](docs/UserLimited.md) + - [UserList](docs/UserList.md) + - [UserLite](docs/UserLite.md) + - [UserUpdateInput](docs/UserUpdateInput.md) + - [Userdata](docs/Userdata.md) + - [VerifyEmail](docs/VerifyEmail.md) + - [VirtualCircuit](docs/VirtualCircuit.md) + - [VirtualCircuitCreateInput](docs/VirtualCircuitCreateInput.md) + - [VirtualCircuitList](docs/VirtualCircuitList.md) + - [VirtualCircuitUpdateInput](docs/VirtualCircuitUpdateInput.md) + - [VirtualNetwork](docs/VirtualNetwork.md) + - [VirtualNetworkCreateInput](docs/VirtualNetworkCreateInput.md) + - [VirtualNetworkList](docs/VirtualNetworkList.md) + - [VlanFabricVcCreateInput](docs/VlanFabricVcCreateInput.md) + - [VlanFabricVcCreateInputServiceTokenType](docs/VlanFabricVcCreateInputServiceTokenType.md) + - [VlanFabricVcCreateInputType](docs/VlanFabricVcCreateInputType.md) + - [VlanVirtualCircuit](docs/VlanVirtualCircuit.md) + - [VlanVirtualCircuitCreateInput](docs/VlanVirtualCircuitCreateInput.md) + - [VlanVirtualCircuitStatus](docs/VlanVirtualCircuitStatus.md) + - [VlanVirtualCircuitType](docs/VlanVirtualCircuitType.md) + - [VlanVirtualCircuitUpdateInput](docs/VlanVirtualCircuitUpdateInput.md) + - [Vrf](docs/Vrf.md) + - [VrfCreateInput](docs/VrfCreateInput.md) + - [VrfFabricVcCreateInput](docs/VrfFabricVcCreateInput.md) + - [VrfIpReservation](docs/VrfIpReservation.md) + - [VrfIpReservationCreateInput](docs/VrfIpReservationCreateInput.md) + - [VrfIpReservationList](docs/VrfIpReservationList.md) + - [VrfIpReservationType](docs/VrfIpReservationType.md) + - [VrfList](docs/VrfList.md) + - [VrfMetalGateway](docs/VrfMetalGateway.md) + - [VrfMetalGatewayCreateInput](docs/VrfMetalGatewayCreateInput.md) + - [VrfRoute](docs/VrfRoute.md) + - [VrfRouteCreateInput](docs/VrfRouteCreateInput.md) + - [VrfRouteList](docs/VrfRouteList.md) + - [VrfRouteStatus](docs/VrfRouteStatus.md) + - [VrfRouteType](docs/VrfRouteType.md) + - [VrfRouteUpdateInput](docs/VrfRouteUpdateInput.md) + - [VrfUpdateInput](docs/VrfUpdateInput.md) + - [VrfVirtualCircuit](docs/VrfVirtualCircuit.md) + - [VrfVirtualCircuitCreateInput](docs/VrfVirtualCircuitCreateInput.md) + - [VrfVirtualCircuitStatus](docs/VrfVirtualCircuitStatus.md) + - [VrfVirtualCircuitUpdateInput](docs/VrfVirtualCircuitUpdateInput.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### x_auth_token + +- **Type**: API key +- **API key parameter name**: X-Auth-Token +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: X-Auth-Token and passed in as the auth context for each request. + +Example + +```golang +auth := context.WithValue( + context.Background(), + metalv1.ContextAPIKeys, + map[string]metalv1.APIKey{ + "X-Auth-Token": {Key: "API_KEY_STRING"}, + }, + ) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + +support@equinixmetal.com + diff --git a/services/metalv1/api_authentication.go b/services/metalv1/api_authentication.go new file mode 100644 index 00000000..35c777e1 --- /dev/null +++ b/services/metalv1/api_authentication.go @@ -0,0 +1,922 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// AuthenticationApiService AuthenticationApi service +type AuthenticationApiService service + +type ApiCreateAPIKeyRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + authTokenInput *AuthTokenInput + include *[]string +} + +// API key to create +func (r ApiCreateAPIKeyRequest) AuthTokenInput(authTokenInput AuthTokenInput) ApiCreateAPIKeyRequest { + r.authTokenInput = &authTokenInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateAPIKeyRequest) Include(include []string) ApiCreateAPIKeyRequest { + r.include = &include + return r +} + +func (r ApiCreateAPIKeyRequest) Execute() (*AuthToken, *http.Response, error) { + return r.ApiService.CreateAPIKeyExecute(r) +} + +/* +CreateAPIKey Create an API key + +Creates a API key for the current user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateAPIKeyRequest +*/ +func (a *AuthenticationApiService) CreateAPIKey(ctx context.Context) ApiCreateAPIKeyRequest { + return ApiCreateAPIKeyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthToken +func (a *AuthenticationApiService) CreateAPIKeyExecute(r ApiCreateAPIKeyRequest) (*AuthToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.CreateAPIKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/api-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authTokenInput == nil { + return localVarReturnValue, nil, reportError("authTokenInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authTokenInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateProjectAPIKeyRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + id string + authTokenInput *AuthTokenInput + include *[]string +} + +// API Key to create +func (r ApiCreateProjectAPIKeyRequest) AuthTokenInput(authTokenInput AuthTokenInput) ApiCreateProjectAPIKeyRequest { + r.authTokenInput = &authTokenInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateProjectAPIKeyRequest) Include(include []string) ApiCreateProjectAPIKeyRequest { + r.include = &include + return r +} + +func (r ApiCreateProjectAPIKeyRequest) Execute() (*AuthToken, *http.Response, error) { + return r.ApiService.CreateProjectAPIKeyExecute(r) +} + +/* +CreateProjectAPIKey Create an API key for a project. + +Creates an API key for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateProjectAPIKeyRequest +*/ +func (a *AuthenticationApiService) CreateProjectAPIKey(ctx context.Context, id string) ApiCreateProjectAPIKeyRequest { + return ApiCreateProjectAPIKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return AuthToken +func (a *AuthenticationApiService) CreateProjectAPIKeyExecute(r ApiCreateProjectAPIKeyRequest) (*AuthToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.CreateProjectAPIKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/api-keys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authTokenInput == nil { + return localVarReturnValue, nil, reportError("authTokenInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authTokenInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteAPIKeyRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + id string +} + +func (r ApiDeleteAPIKeyRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteAPIKeyExecute(r) +} + +/* +DeleteAPIKey Delete the API key + +Deletes the API key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id API Key UUID + @return ApiDeleteAPIKeyRequest +*/ +func (a *AuthenticationApiService) DeleteAPIKey(ctx context.Context, id string) ApiDeleteAPIKeyRequest { + return ApiDeleteAPIKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticationApiService) DeleteAPIKeyExecute(r ApiDeleteAPIKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.DeleteAPIKey") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteUserAPIKeyRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + id string +} + +func (r ApiDeleteUserAPIKeyRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserAPIKeyExecute(r) +} + +/* +DeleteUserAPIKey Delete the API key + +Deletes the current user API key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id API Key UUID + @return ApiDeleteUserAPIKeyRequest +*/ +func (a *AuthenticationApiService) DeleteUserAPIKey(ctx context.Context, id string) ApiDeleteUserAPIKeyRequest { + return ApiDeleteUserAPIKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticationApiService) DeleteUserAPIKeyExecute(r ApiDeleteUserAPIKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.DeleteUserAPIKey") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/api-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindAPIKeysRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + search *string + include *[]string +} + +// Search by description +func (r ApiFindAPIKeysRequest) Search(search string) ApiFindAPIKeysRequest { + r.search = &search + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindAPIKeysRequest) Include(include []string) ApiFindAPIKeysRequest { + r.include = &include + return r +} + +func (r ApiFindAPIKeysRequest) Execute() (*AuthTokenList, *http.Response, error) { + return r.ApiService.FindAPIKeysExecute(r) +} + +/* +FindAPIKeys Retrieve all user API keys + +Returns all API keys for the current user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindAPIKeysRequest +*/ +func (a *AuthenticationApiService) FindAPIKeys(ctx context.Context) ApiFindAPIKeysRequest { + return ApiFindAPIKeysRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthTokenList +func (a *AuthenticationApiService) FindAPIKeysExecute(r ApiFindAPIKeysRequest) (*AuthTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.FindAPIKeys") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/api-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectAPIKeysRequest struct { + ctx context.Context + ApiService *AuthenticationApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectAPIKeysRequest) Include(include []string) ApiFindProjectAPIKeysRequest { + r.include = &include + return r +} + +func (r ApiFindProjectAPIKeysRequest) Execute() (*AuthTokenList, *http.Response, error) { + return r.ApiService.FindProjectAPIKeysExecute(r) +} + +/* +FindProjectAPIKeys Retrieve all API keys for the project. + +Returns all API keys for a specific project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectAPIKeysRequest +*/ +func (a *AuthenticationApiService) FindProjectAPIKeys(ctx context.Context, id string) ApiFindProjectAPIKeysRequest { + return ApiFindProjectAPIKeysRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return AuthTokenList +func (a *AuthenticationApiService) FindProjectAPIKeysExecute(r ApiFindProjectAPIKeysRequest) (*AuthTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationApiService.FindProjectAPIKeys") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/api-keys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_batches.go b/services/metalv1/api_batches.go new file mode 100644 index 00000000..ec17ec91 --- /dev/null +++ b/services/metalv1/api_batches.go @@ -0,0 +1,643 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// BatchesApiService BatchesApi service +type BatchesApiService service + +type ApiCreateDeviceBatchRequest struct { + ctx context.Context + ApiService *BatchesApiService + id string + instancesBatchCreateInput *InstancesBatchCreateInput +} + +// Batches to create +func (r ApiCreateDeviceBatchRequest) InstancesBatchCreateInput(instancesBatchCreateInput InstancesBatchCreateInput) ApiCreateDeviceBatchRequest { + r.instancesBatchCreateInput = &instancesBatchCreateInput + return r +} + +func (r ApiCreateDeviceBatchRequest) Execute() (*BatchesList, *http.Response, error) { + return r.ApiService.CreateDeviceBatchExecute(r) +} + +/* +CreateDeviceBatch Create a devices batch + +Creates new devices in batch and provisions them in our datacenter. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateDeviceBatchRequest +*/ +func (a *BatchesApiService) CreateDeviceBatch(ctx context.Context, id string) ApiCreateDeviceBatchRequest { + return ApiCreateDeviceBatchRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BatchesList +func (a *BatchesApiService) CreateDeviceBatchExecute(r ApiCreateDeviceBatchRequest) (*BatchesList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchesList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BatchesApiService.CreateDeviceBatch") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/devices/batch" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.instancesBatchCreateInput == nil { + return localVarReturnValue, nil, reportError("instancesBatchCreateInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.instancesBatchCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteBatchRequest struct { + ctx context.Context + ApiService *BatchesApiService + id string + removeAssociatedInstances *bool +} + +// Delete all instances created from this batch +func (r ApiDeleteBatchRequest) RemoveAssociatedInstances(removeAssociatedInstances bool) ApiDeleteBatchRequest { + r.removeAssociatedInstances = &removeAssociatedInstances + return r +} + +func (r ApiDeleteBatchRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteBatchExecute(r) +} + +/* +DeleteBatch Delete the Batch + +Deletes the Batch. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Batch UUID + @return ApiDeleteBatchRequest +*/ +func (a *BatchesApiService) DeleteBatch(ctx context.Context, id string) ApiDeleteBatchRequest { + return ApiDeleteBatchRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *BatchesApiService) DeleteBatchExecute(r ApiDeleteBatchRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BatchesApiService.DeleteBatch") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/batches/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.removeAssociatedInstances != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "remove_associated_instances", r.removeAssociatedInstances, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindBatchByIdRequest struct { + ctx context.Context + ApiService *BatchesApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindBatchByIdRequest) Include(include []string) ApiFindBatchByIdRequest { + r.include = &include + return r +} + +func (r ApiFindBatchByIdRequest) Execute() (*Batch, *http.Response, error) { + return r.ApiService.FindBatchByIdExecute(r) +} + +/* +FindBatchById Retrieve a Batch + +Returns a Batch + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Batch UUID + @return ApiFindBatchByIdRequest +*/ +func (a *BatchesApiService) FindBatchById(ctx context.Context, id string) ApiFindBatchByIdRequest { + return ApiFindBatchByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Batch +func (a *BatchesApiService) FindBatchByIdExecute(r ApiFindBatchByIdRequest) (*Batch, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Batch + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BatchesApiService.FindBatchById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/batches/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindBatchesByProjectRequest struct { + ctx context.Context + ApiService *BatchesApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindBatchesByProjectRequest) Include(include []string) ApiFindBatchesByProjectRequest { + r.include = &include + return r +} + +func (r ApiFindBatchesByProjectRequest) Execute() (*BatchesList, *http.Response, error) { + return r.ApiService.FindBatchesByProjectExecute(r) +} + +/* +FindBatchesByProject Retrieve all batches by project + +Returns all batches for the given project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindBatchesByProjectRequest +*/ +func (a *BatchesApiService) FindBatchesByProject(ctx context.Context, id string) ApiFindBatchesByProjectRequest { + return ApiFindBatchesByProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BatchesList +func (a *BatchesApiService) FindBatchesByProjectExecute(r ApiFindBatchesByProjectRequest) (*BatchesList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchesList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BatchesApiService.FindBatchesByProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/batches" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_bgp.go b/services/metalv1/api_bgp.go new file mode 100644 index 00000000..681eb13d --- /dev/null +++ b/services/metalv1/api_bgp.go @@ -0,0 +1,1103 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// BGPApiService BGPApi service +type BGPApiService service + +type ApiDeleteBgpSessionRequest struct { + ctx context.Context + ApiService *BGPApiService + id string +} + +func (r ApiDeleteBgpSessionRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteBgpSessionExecute(r) +} + +/* +DeleteBgpSession Delete the BGP session + +Deletes the BGP session. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id BGP session UUID + @return ApiDeleteBgpSessionRequest +*/ +func (a *BGPApiService) DeleteBgpSession(ctx context.Context, id string) ApiDeleteBgpSessionRequest { + return ApiDeleteBgpSessionRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *BGPApiService) DeleteBgpSessionExecute(r ApiDeleteBgpSessionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.DeleteBgpSession") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/bgp/sessions/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindBgpConfigByProjectRequest struct { + ctx context.Context + ApiService *BGPApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindBgpConfigByProjectRequest) Include(include []string) ApiFindBgpConfigByProjectRequest { + r.include = &include + return r +} + +func (r ApiFindBgpConfigByProjectRequest) Execute() (*BgpConfig, *http.Response, error) { + return r.ApiService.FindBgpConfigByProjectExecute(r) +} + +/* +FindBgpConfigByProject Retrieve a bgp config + +Returns a bgp config + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindBgpConfigByProjectRequest +*/ +func (a *BGPApiService) FindBgpConfigByProject(ctx context.Context, id string) ApiFindBgpConfigByProjectRequest { + return ApiFindBgpConfigByProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpConfig +func (a *BGPApiService) FindBgpConfigByProjectExecute(r ApiFindBgpConfigByProjectRequest) (*BgpConfig, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpConfig + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.FindBgpConfigByProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/bgp-config" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindBgpSessionByIdRequest struct { + ctx context.Context + ApiService *BGPApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindBgpSessionByIdRequest) Include(include []string) ApiFindBgpSessionByIdRequest { + r.include = &include + return r +} + +func (r ApiFindBgpSessionByIdRequest) Execute() (*BgpSession, *http.Response, error) { + return r.ApiService.FindBgpSessionByIdExecute(r) +} + +/* +FindBgpSessionById Retrieve a BGP session + +Returns a BGP session + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id BGP session UUID + @return ApiFindBgpSessionByIdRequest +*/ +func (a *BGPApiService) FindBgpSessionById(ctx context.Context, id string) ApiFindBgpSessionByIdRequest { + return ApiFindBgpSessionByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpSession +func (a *BGPApiService) FindBgpSessionByIdExecute(r ApiFindBgpSessionByIdRequest) (*BgpSession, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpSession + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.FindBgpSessionById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/bgp/sessions/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindGlobalBgpRangesRequest struct { + ctx context.Context + ApiService *BGPApiService + id string +} + +func (r ApiFindGlobalBgpRangesRequest) Execute() (*GlobalBgpRangeList, *http.Response, error) { + return r.ApiService.FindGlobalBgpRangesExecute(r) +} + +/* +FindGlobalBgpRanges Retrieve all global bgp ranges + +Returns all global bgp ranges for a project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindGlobalBgpRangesRequest +*/ +func (a *BGPApiService) FindGlobalBgpRanges(ctx context.Context, id string) ApiFindGlobalBgpRangesRequest { + return ApiFindGlobalBgpRangesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GlobalBgpRangeList +func (a *BGPApiService) FindGlobalBgpRangesExecute(r ApiFindGlobalBgpRangesRequest) (*GlobalBgpRangeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GlobalBgpRangeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.FindGlobalBgpRanges") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/global-bgp-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectBgpSessionsRequest struct { + ctx context.Context + ApiService *BGPApiService + id string +} + +func (r ApiFindProjectBgpSessionsRequest) Execute() (*BgpSessionList, *http.Response, error) { + return r.ApiService.FindProjectBgpSessionsExecute(r) +} + +/* +FindProjectBgpSessions Retrieve all BGP sessions for project + +Provides a listing of available BGP sessions for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectBgpSessionsRequest +*/ +func (a *BGPApiService) FindProjectBgpSessions(ctx context.Context, id string) ApiFindProjectBgpSessionsRequest { + return ApiFindProjectBgpSessionsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpSessionList +func (a *BGPApiService) FindProjectBgpSessionsExecute(r ApiFindProjectBgpSessionsRequest) (*BgpSessionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpSessionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.FindProjectBgpSessions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/bgp/sessions" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestBgpConfigRequest struct { + ctx context.Context + ApiService *BGPApiService + id string + bgpConfigRequestInput *BgpConfigRequestInput + include *[]string +} + +// BGP config Request to create +func (r ApiRequestBgpConfigRequest) BgpConfigRequestInput(bgpConfigRequestInput BgpConfigRequestInput) ApiRequestBgpConfigRequest { + r.bgpConfigRequestInput = &bgpConfigRequestInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiRequestBgpConfigRequest) Include(include []string) ApiRequestBgpConfigRequest { + r.include = &include + return r +} + +func (r ApiRequestBgpConfigRequest) Execute() (*http.Response, error) { + return r.ApiService.RequestBgpConfigExecute(r) +} + +/* +RequestBgpConfig Requesting bgp config + +Requests to enable bgp configuration for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiRequestBgpConfigRequest +*/ +func (a *BGPApiService) RequestBgpConfig(ctx context.Context, id string) ApiRequestBgpConfigRequest { + return ApiRequestBgpConfigRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *BGPApiService) RequestBgpConfigExecute(r ApiRequestBgpConfigRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.RequestBgpConfig") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/bgp-configs" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bgpConfigRequestInput == nil { + return nil, reportError("bgpConfigRequestInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bgpConfigRequestInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUpdateBgpSessionRequest struct { + ctx context.Context + ApiService *BGPApiService + id string + body *bool +} + +// Default route +func (r ApiUpdateBgpSessionRequest) Body(body bool) ApiUpdateBgpSessionRequest { + r.body = &body + return r +} + +func (r ApiUpdateBgpSessionRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateBgpSessionExecute(r) +} + +/* +UpdateBgpSession Update the BGP session + +Updates the BGP session by either enabling or disabling the default route functionality. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id BGP session UUID + @return ApiUpdateBgpSessionRequest +*/ +func (a *BGPApiService) UpdateBgpSession(ctx context.Context, id string) ApiUpdateBgpSessionRequest { + return ApiUpdateBgpSessionRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *BGPApiService) UpdateBgpSessionExecute(r ApiUpdateBgpSessionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BGPApiService.UpdateBgpSession") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/bgp/sessions/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_capacity.go b/services/metalv1/api_capacity.go new file mode 100644 index 00000000..441e86eb --- /dev/null +++ b/services/metalv1/api_capacity.go @@ -0,0 +1,848 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// CapacityApiService CapacityApi service +type CapacityApiService service + +type ApiCheckCapacityForFacilityRequest struct { + ctx context.Context + ApiService *CapacityApiService + capacityInput *CapacityInput +} + +// Facility to check capacity in +func (r ApiCheckCapacityForFacilityRequest) CapacityInput(capacityInput CapacityInput) ApiCheckCapacityForFacilityRequest { + r.capacityInput = &capacityInput + return r +} + +func (r ApiCheckCapacityForFacilityRequest) Execute() (*CapacityCheckPerFacilityList, *http.Response, error) { + return r.ApiService.CheckCapacityForFacilityExecute(r) +} + +/* +CheckCapacityForFacility Check capacity + +Validates if a deploy can be fulfilled. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCheckCapacityForFacilityRequest + +Deprecated +*/ +func (a *CapacityApiService) CheckCapacityForFacility(ctx context.Context) ApiCheckCapacityForFacilityRequest { + return ApiCheckCapacityForFacilityRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CapacityCheckPerFacilityList +// +// Deprecated +func (a *CapacityApiService) CheckCapacityForFacilityExecute(r ApiCheckCapacityForFacilityRequest) (*CapacityCheckPerFacilityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityCheckPerFacilityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.CheckCapacityForFacility") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/capacity" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.capacityInput == nil { + return localVarReturnValue, nil, reportError("capacityInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.capacityInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCheckCapacityForMetroRequest struct { + ctx context.Context + ApiService *CapacityApiService + capacityInput *CapacityInput +} + +// Metro to check capacity in +func (r ApiCheckCapacityForMetroRequest) CapacityInput(capacityInput CapacityInput) ApiCheckCapacityForMetroRequest { + r.capacityInput = &capacityInput + return r +} + +func (r ApiCheckCapacityForMetroRequest) Execute() (*CapacityCheckPerMetroList, *http.Response, error) { + return r.ApiService.CheckCapacityForMetroExecute(r) +} + +/* +CheckCapacityForMetro Check capacity for a metro + +Validates if a deploy can be fulfilled in a metro. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCheckCapacityForMetroRequest +*/ +func (a *CapacityApiService) CheckCapacityForMetro(ctx context.Context) ApiCheckCapacityForMetroRequest { + return ApiCheckCapacityForMetroRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CapacityCheckPerMetroList +func (a *CapacityApiService) CheckCapacityForMetroExecute(r ApiCheckCapacityForMetroRequest) (*CapacityCheckPerMetroList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityCheckPerMetroList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.CheckCapacityForMetro") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/capacity/metros" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.capacityInput == nil { + return localVarReturnValue, nil, reportError("capacityInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.capacityInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindCapacityForFacilityRequest struct { + ctx context.Context + ApiService *CapacityApiService +} + +func (r ApiFindCapacityForFacilityRequest) Execute() (*CapacityList, *http.Response, error) { + return r.ApiService.FindCapacityForFacilityExecute(r) +} + +/* +FindCapacityForFacility View capacity + +Returns a list of facilities and plans with their current capacity. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindCapacityForFacilityRequest +*/ +func (a *CapacityApiService) FindCapacityForFacility(ctx context.Context) ApiFindCapacityForFacilityRequest { + return ApiFindCapacityForFacilityRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CapacityList +func (a *CapacityApiService) FindCapacityForFacilityExecute(r ApiFindCapacityForFacilityRequest) (*CapacityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.FindCapacityForFacility") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/capacity" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindCapacityForMetroRequest struct { + ctx context.Context + ApiService *CapacityApiService +} + +func (r ApiFindCapacityForMetroRequest) Execute() (*CapacityList, *http.Response, error) { + return r.ApiService.FindCapacityForMetroExecute(r) +} + +/* +FindCapacityForMetro View capacity for metros + +Returns a list of metros and plans with their current capacity. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindCapacityForMetroRequest +*/ +func (a *CapacityApiService) FindCapacityForMetro(ctx context.Context) ApiFindCapacityForMetroRequest { + return ApiFindCapacityForMetroRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CapacityList +func (a *CapacityApiService) FindCapacityForMetroExecute(r ApiFindCapacityForMetroRequest) (*CapacityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.FindCapacityForMetro") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/capacity/metros" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationCapacityPerFacilityRequest struct { + ctx context.Context + ApiService *CapacityApiService + id string +} + +func (r ApiFindOrganizationCapacityPerFacilityRequest) Execute() (*CapacityList, *http.Response, error) { + return r.ApiService.FindOrganizationCapacityPerFacilityExecute(r) +} + +/* +FindOrganizationCapacityPerFacility View available hardware plans per Facility for given organization + +Returns a list of facilities and plans with their current capacity. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationCapacityPerFacilityRequest +*/ +func (a *CapacityApiService) FindOrganizationCapacityPerFacility(ctx context.Context, id string) ApiFindOrganizationCapacityPerFacilityRequest { + return ApiFindOrganizationCapacityPerFacilityRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CapacityList +func (a *CapacityApiService) FindOrganizationCapacityPerFacilityExecute(r ApiFindOrganizationCapacityPerFacilityRequest) (*CapacityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.FindOrganizationCapacityPerFacility") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/capacity" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationCapacityPerMetroRequest struct { + ctx context.Context + ApiService *CapacityApiService + id string +} + +func (r ApiFindOrganizationCapacityPerMetroRequest) Execute() (*CapacityList, *http.Response, error) { + return r.ApiService.FindOrganizationCapacityPerMetroExecute(r) +} + +/* +FindOrganizationCapacityPerMetro View available hardware plans per Metro for given organization + +Returns a list of metros and plans with their current capacity. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationCapacityPerMetroRequest +*/ +func (a *CapacityApiService) FindOrganizationCapacityPerMetro(ctx context.Context, id string) ApiFindOrganizationCapacityPerMetroRequest { + return ApiFindOrganizationCapacityPerMetroRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return CapacityList +func (a *CapacityApiService) FindOrganizationCapacityPerMetroExecute(r ApiFindOrganizationCapacityPerMetroRequest) (*CapacityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CapacityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CapacityApiService.FindOrganizationCapacityPerMetro") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/capacity/metros" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_console_log_details.go b/services/metalv1/api_console_log_details.go new file mode 100644 index 00000000..a12edeb4 --- /dev/null +++ b/services/metalv1/api_console_log_details.go @@ -0,0 +1,175 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" +) + +// ConsoleLogDetailsApiService ConsoleLogDetailsApi service +type ConsoleLogDetailsApiService service + +type ApiCaptureScreenshotRequest struct { + ctx context.Context + ApiService *ConsoleLogDetailsApiService + id string +} + +func (r ApiCaptureScreenshotRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.CaptureScreenshotExecute(r) +} + +/* +CaptureScreenshot Method for CaptureScreenshot + +Capture a screenshot from the device, if supported, via the BMC. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiCaptureScreenshotRequest +*/ +func (a *ConsoleLogDetailsApiService) CaptureScreenshot(ctx context.Context, id string) ApiCaptureScreenshotRequest { + return ApiCaptureScreenshotRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *ConsoleLogDetailsApiService) CaptureScreenshotExecute(r ApiCaptureScreenshotRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConsoleLogDetailsApiService.CaptureScreenshot") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/diagnostics/screenshot" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/jpeg", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 501 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_devices.go b/services/metalv1/api_devices.go new file mode 100644 index 00000000..6eadedfa --- /dev/null +++ b/services/metalv1/api_devices.go @@ -0,0 +1,3478 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// DevicesApiService DevicesApi service +type DevicesApiService service + +type ApiCreateBgpSessionRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + bGPSessionInput *BGPSessionInput + include *[]string +} + +// BGP session to create +func (r ApiCreateBgpSessionRequest) BGPSessionInput(bGPSessionInput BGPSessionInput) ApiCreateBgpSessionRequest { + r.bGPSessionInput = &bGPSessionInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateBgpSessionRequest) Include(include []string) ApiCreateBgpSessionRequest { + r.include = &include + return r +} + +func (r ApiCreateBgpSessionRequest) Execute() (*BgpSession, *http.Response, error) { + return r.ApiService.CreateBgpSessionExecute(r) +} + +/* +CreateBgpSession Create a BGP session + +Creates a BGP session. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiCreateBgpSessionRequest +*/ +func (a *DevicesApiService) CreateBgpSession(ctx context.Context, id string) ApiCreateBgpSessionRequest { + return ApiCreateBgpSessionRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpSession +func (a *DevicesApiService) CreateBgpSessionExecute(r ApiCreateBgpSessionRequest) (*BgpSession, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpSession + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.CreateBgpSession") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/bgp/sessions" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bGPSessionInput == nil { + return localVarReturnValue, nil, reportError("bGPSessionInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bGPSessionInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateDeviceRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + createDeviceRequest *CreateDeviceRequest + include *[]string + exclude *[]string +} + +// Device to create +func (r ApiCreateDeviceRequest) CreateDeviceRequest(createDeviceRequest CreateDeviceRequest) ApiCreateDeviceRequest { + r.createDeviceRequest = &createDeviceRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateDeviceRequest) Include(include []string) ApiCreateDeviceRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateDeviceRequest) Exclude(exclude []string) ApiCreateDeviceRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateDeviceRequest) Execute() (*Device, *http.Response, error) { + return r.ApiService.CreateDeviceExecute(r) +} + +/* +CreateDevice Create a device + +Creates a new device and provisions it in the specified location. + +Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateDeviceRequest +*/ +func (a *DevicesApiService) CreateDevice(ctx context.Context, id string) ApiCreateDeviceRequest { + return ApiCreateDeviceRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Device +func (a *DevicesApiService) CreateDeviceExecute(r ApiCreateDeviceRequest) (*Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.CreateDevice") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/devices" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDeviceRequest == nil { + return localVarReturnValue, nil, reportError("createDeviceRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDeviceRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateIPAssignmentRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + iPAssignmentInput *IPAssignmentInput + include *[]string + exclude *[]string +} + +// IPAssignment to create +func (r ApiCreateIPAssignmentRequest) IPAssignmentInput(iPAssignmentInput IPAssignmentInput) ApiCreateIPAssignmentRequest { + r.iPAssignmentInput = &iPAssignmentInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateIPAssignmentRequest) Include(include []string) ApiCreateIPAssignmentRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateIPAssignmentRequest) Exclude(exclude []string) ApiCreateIPAssignmentRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateIPAssignmentRequest) Execute() (*IPAssignment, *http.Response, error) { + return r.ApiService.CreateIPAssignmentExecute(r) +} + +/* +CreateIPAssignment Create an ip assignment + +Creates an ip assignment for a device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiCreateIPAssignmentRequest +*/ +func (a *DevicesApiService) CreateIPAssignment(ctx context.Context, id string) ApiCreateIPAssignmentRequest { + return ApiCreateIPAssignmentRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAssignment +func (a *DevicesApiService) CreateIPAssignmentExecute(r ApiCreateIPAssignmentRequest) (*IPAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.CreateIPAssignment") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.iPAssignmentInput == nil { + return localVarReturnValue, nil, reportError("iPAssignmentInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAssignmentInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDeviceRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + forceDelete *bool +} + +// Force the deletion of the device, by detaching any storage volume still active. +func (r ApiDeleteDeviceRequest) ForceDelete(forceDelete bool) ApiDeleteDeviceRequest { + r.forceDelete = &forceDelete + return r +} + +func (r ApiDeleteDeviceRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteDeviceExecute(r) +} + +/* +DeleteDevice Delete the device + +Deletes a device and deprovisions it in our datacenter. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiDeleteDeviceRequest +*/ +func (a *DevicesApiService) DeleteDevice(ctx context.Context, id string) ApiDeleteDeviceRequest { + return ApiDeleteDeviceRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) DeleteDeviceExecute(r ApiDeleteDeviceRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.DeleteDevice") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forceDelete != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force_delete", r.forceDelete, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindBgpSessionsRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindBgpSessionsRequest) Include(include []string) ApiFindBgpSessionsRequest { + r.include = &include + return r +} + +func (r ApiFindBgpSessionsRequest) Execute() (*BgpSessionList, *http.Response, error) { + return r.ApiService.FindBgpSessionsExecute(r) +} + +/* +FindBgpSessions Retrieve all BGP sessions + +Provides a listing of available BGP sessions for the device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindBgpSessionsRequest +*/ +func (a *DevicesApiService) FindBgpSessions(ctx context.Context, id string) ApiFindBgpSessionsRequest { + return ApiFindBgpSessionsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpSessionList +func (a *DevicesApiService) FindBgpSessionsExecute(r ApiFindBgpSessionsRequest) (*BgpSessionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpSessionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindBgpSessions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/bgp/sessions" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindDeviceByIdRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindDeviceByIdRequest) Include(include []string) ApiFindDeviceByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindDeviceByIdRequest) Exclude(exclude []string) ApiFindDeviceByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindDeviceByIdRequest) Execute() (*Device, *http.Response, error) { + return r.ApiService.FindDeviceByIdExecute(r) +} + +/* +FindDeviceById Retrieve a device + +Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. + + State value can be one of: active inactive queued or provisioning + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindDeviceByIdRequest +*/ +func (a *DevicesApiService) FindDeviceById(ctx context.Context, id string) ApiFindDeviceByIdRequest { + return ApiFindDeviceByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Device +func (a *DevicesApiService) FindDeviceByIdExecute(r ApiFindDeviceByIdRequest) (*Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindDeviceById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindDeviceCustomdataRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string +} + +func (r ApiFindDeviceCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindDeviceCustomdataExecute(r) +} + +/* +FindDeviceCustomdata Retrieve the custom metadata of an instance + +Provides the custom metadata stored for this instance in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Instance UUID + @return ApiFindDeviceCustomdataRequest +*/ +func (a *DevicesApiService) FindDeviceCustomdata(ctx context.Context, id string) ApiFindDeviceCustomdataRequest { + return ApiFindDeviceCustomdataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) FindDeviceCustomdataExecute(r ApiFindDeviceCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindDeviceCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindDeviceMetadataByIDRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string +} + +func (r ApiFindDeviceMetadataByIDRequest) Execute() (*Metadata, *http.Response, error) { + return r.ApiService.FindDeviceMetadataByIDExecute(r) +} + +/* +FindDeviceMetadataByID Retrieve metadata + +Retrieve device metadata + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindDeviceMetadataByIDRequest +*/ +func (a *DevicesApiService) FindDeviceMetadataByID(ctx context.Context, id string) ApiFindDeviceMetadataByIDRequest { + return ApiFindDeviceMetadataByIDRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Metadata +func (a *DevicesApiService) FindDeviceMetadataByIDExecute(r ApiFindDeviceMetadataByIDRequest) (*Metadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Metadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindDeviceMetadataByID") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/metadata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindDeviceUserdataByIDRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string +} + +func (r ApiFindDeviceUserdataByIDRequest) Execute() (*Userdata, *http.Response, error) { + return r.ApiService.FindDeviceUserdataByIDExecute(r) +} + +/* +FindDeviceUserdataByID Retrieve userdata + +Retrieve device userdata + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindDeviceUserdataByIDRequest +*/ +func (a *DevicesApiService) FindDeviceUserdataByID(ctx context.Context, id string) ApiFindDeviceUserdataByIDRequest { + return ApiFindDeviceUserdataByIDRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Userdata +func (a *DevicesApiService) FindDeviceUserdataByIDExecute(r ApiFindDeviceUserdataByIDRequest) (*Userdata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Userdata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindDeviceUserdataByID") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/userdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindIPAssignmentCustomdataRequest struct { + ctx context.Context + ApiService *DevicesApiService + instanceId string + id string +} + +func (r ApiFindIPAssignmentCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindIPAssignmentCustomdataExecute(r) +} + +/* +FindIPAssignmentCustomdata Retrieve the custom metadata of an IP Assignment + +Provides the custom metadata stored for this IP Assignment in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance UUID + @param id Ip Assignment UUID + @return ApiFindIPAssignmentCustomdataRequest +*/ +func (a *DevicesApiService) FindIPAssignmentCustomdata(ctx context.Context, instanceId string, id string) ApiFindIPAssignmentCustomdataRequest { + return ApiFindIPAssignmentCustomdataRequest{ + ApiService: a, + ctx: ctx, + instanceId: instanceId, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) FindIPAssignmentCustomdataExecute(r ApiFindIPAssignmentCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindIPAssignmentCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{instance_id}/ips/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"instance_id"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindIPAssignmentsRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindIPAssignmentsRequest) Include(include []string) ApiFindIPAssignmentsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindIPAssignmentsRequest) Exclude(exclude []string) ApiFindIPAssignmentsRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindIPAssignmentsRequest) Execute() (*IPAssignmentList, *http.Response, error) { + return r.ApiService.FindIPAssignmentsExecute(r) +} + +/* +FindIPAssignments Retrieve all ip assignments + +Returns all ip assignments for a device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindIPAssignmentsRequest +*/ +func (a *DevicesApiService) FindIPAssignments(ctx context.Context, id string) ApiFindIPAssignmentsRequest { + return ApiFindIPAssignmentsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAssignmentList +func (a *DevicesApiService) FindIPAssignmentsExecute(r ApiFindIPAssignmentsRequest) (*IPAssignmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAssignmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindIPAssignments") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindInstanceBandwidthRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + from *string + until *string +} + +// Timestamp from range +func (r ApiFindInstanceBandwidthRequest) From(from string) ApiFindInstanceBandwidthRequest { + r.from = &from + return r +} + +// Timestamp to range +func (r ApiFindInstanceBandwidthRequest) Until(until string) ApiFindInstanceBandwidthRequest { + r.until = &until + return r +} + +func (r ApiFindInstanceBandwidthRequest) Execute() (*http.Response, error) { + return r.ApiService.FindInstanceBandwidthExecute(r) +} + +/* +FindInstanceBandwidth Retrieve an instance bandwidth + +Retrieve an instance bandwidth for a given period of time. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindInstanceBandwidthRequest +*/ +func (a *DevicesApiService) FindInstanceBandwidth(ctx context.Context, id string) ApiFindInstanceBandwidthRequest { + return ApiFindInstanceBandwidthRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) FindInstanceBandwidthExecute(r ApiFindInstanceBandwidthRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindInstanceBandwidth") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/bandwidth" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.from == nil { + return nil, reportError("from is required and must be specified") + } + if r.until == nil { + return nil, reportError("until is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindOrganizationDevicesRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + search *string + categories *[]FindOrganizationDevicesCategoriesParameterInner + facility *string + hostname *string + reserved *bool + tag *string + type_ *string + hasTerminationTime *bool + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. +func (r ApiFindOrganizationDevicesRequest) Search(search string) ApiFindOrganizationDevicesRequest { + r.search = &search + return r +} + +// Filter by plan category +func (r ApiFindOrganizationDevicesRequest) Categories(categories []FindOrganizationDevicesCategoriesParameterInner) ApiFindOrganizationDevicesRequest { + r.categories = &categories + return r +} + +// Filter by device facility +func (r ApiFindOrganizationDevicesRequest) Facility(facility string) ApiFindOrganizationDevicesRequest { + r.facility = &facility + return r +} + +// Filter by partial hostname +func (r ApiFindOrganizationDevicesRequest) Hostname(hostname string) ApiFindOrganizationDevicesRequest { + r.hostname = &hostname + return r +} + +// Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. +func (r ApiFindOrganizationDevicesRequest) Reserved(reserved bool) ApiFindOrganizationDevicesRequest { + r.reserved = &reserved + return r +} + +// Filter by device tag +func (r ApiFindOrganizationDevicesRequest) Tag(tag string) ApiFindOrganizationDevicesRequest { + r.tag = &tag + return r +} + +// Filter by instance type (ondemand,spot,reserved) +func (r ApiFindOrganizationDevicesRequest) Type_(type_ string) ApiFindOrganizationDevicesRequest { + r.type_ = &type_ + return r +} + +// Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. +func (r ApiFindOrganizationDevicesRequest) HasTerminationTime(hasTerminationTime bool) ApiFindOrganizationDevicesRequest { + r.hasTerminationTime = &hasTerminationTime + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationDevicesRequest) Include(include []string) ApiFindOrganizationDevicesRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindOrganizationDevicesRequest) Exclude(exclude []string) ApiFindOrganizationDevicesRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindOrganizationDevicesRequest) Page(page int32) ApiFindOrganizationDevicesRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationDevicesRequest) PerPage(perPage int32) ApiFindOrganizationDevicesRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationDevicesRequest) Execute() (*DeviceList, *http.Response, error) { + return r.ApiService.FindOrganizationDevicesExecute(r) +} + +/* +FindOrganizationDevices Retrieve all devices of an organization + +Provides a collection of devices for a given organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationDevicesRequest +*/ +func (a *DevicesApiService) FindOrganizationDevices(ctx context.Context, id string) ApiFindOrganizationDevicesRequest { + return ApiFindOrganizationDevicesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceList +func (a *DevicesApiService) FindOrganizationDevicesExecute(r ApiFindOrganizationDevicesRequest) (*DeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindOrganizationDevices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/devices" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.categories != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "categories", r.categories, "csv") + } + if r.facility != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") + } + if r.hostname != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "hostname", r.hostname, "") + } + if r.reserved != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "reserved", r.reserved, "") + } + if r.tag != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.hasTerminationTime != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_termination_time", r.hasTerminationTime, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return DeviceList +func (r ApiFindOrganizationDevicesRequest) ExecuteWithPagination() (*DeviceList, error) { + + var items DeviceList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Devices = append(items.Devices, page.Devices...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindProjectDevicesRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + search *string + categories *[]FindOrganizationDevicesCategoriesParameterInner + facility *string + metro *string + hostname *string + reserved *bool + tag *string + type_ *string + hasTerminationTime *bool + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. +func (r ApiFindProjectDevicesRequest) Search(search string) ApiFindProjectDevicesRequest { + r.search = &search + return r +} + +// Filter by plan category +func (r ApiFindProjectDevicesRequest) Categories(categories []FindOrganizationDevicesCategoriesParameterInner) ApiFindProjectDevicesRequest { + r.categories = &categories + return r +} + +// Filter by device facility +func (r ApiFindProjectDevicesRequest) Facility(facility string) ApiFindProjectDevicesRequest { + r.facility = &facility + return r +} + +// Filter by device metro +func (r ApiFindProjectDevicesRequest) Metro(metro string) ApiFindProjectDevicesRequest { + r.metro = &metro + return r +} + +// Filter by partial hostname +func (r ApiFindProjectDevicesRequest) Hostname(hostname string) ApiFindProjectDevicesRequest { + r.hostname = &hostname + return r +} + +// Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. +func (r ApiFindProjectDevicesRequest) Reserved(reserved bool) ApiFindProjectDevicesRequest { + r.reserved = &reserved + return r +} + +// Filter by device tag +func (r ApiFindProjectDevicesRequest) Tag(tag string) ApiFindProjectDevicesRequest { + r.tag = &tag + return r +} + +// Filter by instance type (ondemand,spot,reserved) +func (r ApiFindProjectDevicesRequest) Type_(type_ string) ApiFindProjectDevicesRequest { + r.type_ = &type_ + return r +} + +// Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. +func (r ApiFindProjectDevicesRequest) HasTerminationTime(hasTerminationTime bool) ApiFindProjectDevicesRequest { + r.hasTerminationTime = &hasTerminationTime + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectDevicesRequest) Include(include []string) ApiFindProjectDevicesRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectDevicesRequest) Exclude(exclude []string) ApiFindProjectDevicesRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindProjectDevicesRequest) Page(page int32) ApiFindProjectDevicesRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectDevicesRequest) PerPage(perPage int32) ApiFindProjectDevicesRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectDevicesRequest) Execute() (*DeviceList, *http.Response, error) { + return r.ApiService.FindProjectDevicesExecute(r) +} + +/* +FindProjectDevices Retrieve all devices of a project + +Provides a collection of devices for a given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectDevicesRequest +*/ +func (a *DevicesApiService) FindProjectDevices(ctx context.Context, id string) ApiFindProjectDevicesRequest { + return ApiFindProjectDevicesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceList +func (a *DevicesApiService) FindProjectDevicesExecute(r ApiFindProjectDevicesRequest) (*DeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindProjectDevices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/devices" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.categories != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "categories", r.categories, "csv") + } + if r.facility != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") + } + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } + if r.hostname != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "hostname", r.hostname, "") + } + if r.reserved != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "reserved", r.reserved, "") + } + if r.tag != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tag", r.tag, "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.hasTerminationTime != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_termination_time", r.hasTerminationTime, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return DeviceList +func (r ApiFindProjectDevicesRequest) ExecuteWithPagination() (*DeviceList, error) { + + var items DeviceList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Devices = append(items.Devices, page.Devices...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindTrafficRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + direction *FindTrafficDirectionParameter + interval *FindTrafficIntervalParameter + bucket *FindTrafficBucketParameter + timeframe *FindTrafficTimeframeParameter +} + +// Traffic direction +func (r ApiFindTrafficRequest) Direction(direction FindTrafficDirectionParameter) ApiFindTrafficRequest { + r.direction = &direction + return r +} + +// Traffic interval +func (r ApiFindTrafficRequest) Interval(interval FindTrafficIntervalParameter) ApiFindTrafficRequest { + r.interval = &interval + return r +} + +// Traffic bucket +func (r ApiFindTrafficRequest) Bucket(bucket FindTrafficBucketParameter) ApiFindTrafficRequest { + r.bucket = &bucket + return r +} + +func (r ApiFindTrafficRequest) Timeframe(timeframe FindTrafficTimeframeParameter) ApiFindTrafficRequest { + r.timeframe = &timeframe + return r +} + +func (r ApiFindTrafficRequest) Execute() (*http.Response, error) { + return r.ApiService.FindTrafficExecute(r) +} + +/* +FindTraffic Retrieve device traffic + +Returns traffic for a specific device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindTrafficRequest +*/ +func (a *DevicesApiService) FindTraffic(ctx context.Context, id string) ApiFindTrafficRequest { + return ApiFindTrafficRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) FindTrafficExecute(r ApiFindTrafficRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.FindTraffic") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/traffic" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.direction == nil { + return nil, reportError("direction is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "direction", r.direction, "") + if r.interval != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "") + } + if r.bucket != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bucket", r.bucket, "") + } + if r.timeframe != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeframe", r.timeframe, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetBgpNeighborDataRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetBgpNeighborDataRequest) Include(include []string) ApiGetBgpNeighborDataRequest { + r.include = &include + return r +} + +func (r ApiGetBgpNeighborDataRequest) Execute() (*BgpSessionNeighbors, *http.Response, error) { + return r.ApiService.GetBgpNeighborDataExecute(r) +} + +/* +GetBgpNeighborData Retrieve BGP neighbor data for this device + +Provides a summary of the BGP neighbor data associated to the BGP sessions for this device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiGetBgpNeighborDataRequest +*/ +func (a *DevicesApiService) GetBgpNeighborData(ctx context.Context, id string) ApiGetBgpNeighborDataRequest { + return ApiGetBgpNeighborDataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpSessionNeighbors +func (a *DevicesApiService) GetBgpNeighborDataExecute(r ApiGetBgpNeighborDataRequest) (*BgpSessionNeighbors, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpSessionNeighbors + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.GetBgpNeighborData") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/bgp/neighbors" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDeviceFirmwareSetsRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string +} + +func (r ApiGetDeviceFirmwareSetsRequest) Execute() (*FirmwareSetResponse, *http.Response, error) { + return r.ApiService.GetDeviceFirmwareSetsExecute(r) +} + +/* +GetDeviceFirmwareSets Get Device's associated Firmware Set + +Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiGetDeviceFirmwareSetsRequest +*/ +func (a *DevicesApiService) GetDeviceFirmwareSets(ctx context.Context, id string) ApiGetDeviceFirmwareSetsRequest { + return ApiGetDeviceFirmwareSetsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FirmwareSetResponse +func (a *DevicesApiService) GetDeviceFirmwareSetsExecute(r ApiGetDeviceFirmwareSetsRequest) (*FirmwareSetResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FirmwareSetResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.GetDeviceFirmwareSets") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/firmware-sets" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDeviceHealthRollupRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string +} + +func (r ApiGetDeviceHealthRollupRequest) Execute() (*DeviceHealthRollup, *http.Response, error) { + return r.ApiService.GetDeviceHealthRollupExecute(r) +} + +/* +GetDeviceHealthRollup Get Device's Health Status + +Returns the health rollup status of the device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiGetDeviceHealthRollupRequest +*/ +func (a *DevicesApiService) GetDeviceHealthRollup(ctx context.Context, id string) ApiGetDeviceHealthRollupRequest { + return ApiGetDeviceHealthRollupRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceHealthRollup +func (a *DevicesApiService) GetDeviceHealthRollupExecute(r ApiGetDeviceHealthRollupRequest) (*DeviceHealthRollup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceHealthRollup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.GetDeviceHealthRollup") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/diagnostics/health/rollup" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPerformActionRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + deviceActionInput *DeviceActionInput +} + +// Action to perform +func (r ApiPerformActionRequest) DeviceActionInput(deviceActionInput DeviceActionInput) ApiPerformActionRequest { + r.deviceActionInput = &deviceActionInput + return r +} + +func (r ApiPerformActionRequest) Execute() (*http.Response, error) { + return r.ApiService.PerformActionExecute(r) +} + +/* +PerformAction Perform an action + +Performs an action for the given device. Possible actions include: power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue OS.) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiPerformActionRequest +*/ +func (a *DevicesApiService) PerformAction(ctx context.Context, id string) ApiPerformActionRequest { + return ApiPerformActionRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *DevicesApiService) PerformActionExecute(r ApiPerformActionRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.PerformAction") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/actions" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceActionInput == nil { + return nil, reportError("deviceActionInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceActionInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiUpdateDeviceRequest struct { + ctx context.Context + ApiService *DevicesApiService + id string + deviceUpdateInput *DeviceUpdateInput + include *[]string + exclude *[]string +} + +// Device to update +func (r ApiUpdateDeviceRequest) DeviceUpdateInput(deviceUpdateInput DeviceUpdateInput) ApiUpdateDeviceRequest { + r.deviceUpdateInput = &deviceUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateDeviceRequest) Include(include []string) ApiUpdateDeviceRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateDeviceRequest) Exclude(exclude []string) ApiUpdateDeviceRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateDeviceRequest) Execute() (*Device, *http.Response, error) { + return r.ApiService.UpdateDeviceExecute(r) +} + +/* +UpdateDevice Update the device + +Updates the device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiUpdateDeviceRequest +*/ +func (a *DevicesApiService) UpdateDevice(ctx context.Context, id string) ApiUpdateDeviceRequest { + return ApiUpdateDeviceRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Device +func (a *DevicesApiService) UpdateDeviceExecute(r ApiUpdateDeviceRequest) (*Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DevicesApiService.UpdateDevice") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceUpdateInput == nil { + return localVarReturnValue, nil, reportError("deviceUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_emails.go b/services/metalv1/api_emails.go new file mode 100644 index 00000000..77bd0b1d --- /dev/null +++ b/services/metalv1/api_emails.go @@ -0,0 +1,632 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// EmailsApiService EmailsApi service +type EmailsApiService service + +type ApiCreateEmailRequest struct { + ctx context.Context + ApiService *EmailsApiService + createEmailInput *CreateEmailInput +} + +// Email to create +func (r ApiCreateEmailRequest) CreateEmailInput(createEmailInput CreateEmailInput) ApiCreateEmailRequest { + r.createEmailInput = &createEmailInput + return r +} + +func (r ApiCreateEmailRequest) Execute() (*Email, *http.Response, error) { + return r.ApiService.CreateEmailExecute(r) +} + +/* +CreateEmail Create an email + +Add a new email address to the current user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateEmailRequest +*/ +func (a *EmailsApiService) CreateEmail(ctx context.Context) ApiCreateEmailRequest { + return ApiCreateEmailRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Email +func (a *EmailsApiService) CreateEmailExecute(r ApiCreateEmailRequest) (*Email, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Email + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EmailsApiService.CreateEmail") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/emails" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createEmailInput == nil { + return localVarReturnValue, nil, reportError("createEmailInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createEmailInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteEmailRequest struct { + ctx context.Context + ApiService *EmailsApiService + id string +} + +func (r ApiDeleteEmailRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteEmailExecute(r) +} + +/* +DeleteEmail Delete the email + +Deletes the email. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Email UUID + @return ApiDeleteEmailRequest +*/ +func (a *EmailsApiService) DeleteEmail(ctx context.Context, id string) ApiDeleteEmailRequest { + return ApiDeleteEmailRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *EmailsApiService) DeleteEmailExecute(r ApiDeleteEmailRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EmailsApiService.DeleteEmail") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/emails/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindEmailByIdRequest struct { + ctx context.Context + ApiService *EmailsApiService + id string +} + +func (r ApiFindEmailByIdRequest) Execute() (*Email, *http.Response, error) { + return r.ApiService.FindEmailByIdExecute(r) +} + +/* +FindEmailById Retrieve an email + +Provides one of the user’s emails. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Email UUID + @return ApiFindEmailByIdRequest +*/ +func (a *EmailsApiService) FindEmailById(ctx context.Context, id string) ApiFindEmailByIdRequest { + return ApiFindEmailByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Email +func (a *EmailsApiService) FindEmailByIdExecute(r ApiFindEmailByIdRequest) (*Email, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Email + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EmailsApiService.FindEmailById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/emails/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateEmailRequest struct { + ctx context.Context + ApiService *EmailsApiService + id string + updateEmailInput *UpdateEmailInput +} + +// email to update +func (r ApiUpdateEmailRequest) UpdateEmailInput(updateEmailInput UpdateEmailInput) ApiUpdateEmailRequest { + r.updateEmailInput = &updateEmailInput + return r +} + +func (r ApiUpdateEmailRequest) Execute() (*Email, *http.Response, error) { + return r.ApiService.UpdateEmailExecute(r) +} + +/* +UpdateEmail Update the email + +Updates the email. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Email UUID + @return ApiUpdateEmailRequest +*/ +func (a *EmailsApiService) UpdateEmail(ctx context.Context, id string) ApiUpdateEmailRequest { + return ApiUpdateEmailRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Email +func (a *EmailsApiService) UpdateEmailExecute(r ApiUpdateEmailRequest) (*Email, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Email + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EmailsApiService.UpdateEmail") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/emails/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.updateEmailInput == nil { + return localVarReturnValue, nil, reportError("updateEmailInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateEmailInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_events.go b/services/metalv1/api_events.go new file mode 100644 index 00000000..94f303ae --- /dev/null +++ b/services/metalv1/api_events.go @@ -0,0 +1,1817 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// EventsApiService EventsApi service +type EventsApiService service + +type ApiFindDeviceEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindDeviceEventsRequest) Include(include []string) ApiFindDeviceEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindDeviceEventsRequest) Exclude(exclude []string) ApiFindDeviceEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindDeviceEventsRequest) Page(page int32) ApiFindDeviceEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindDeviceEventsRequest) PerPage(perPage int32) ApiFindDeviceEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindDeviceEventsRequest) Execute() (*EventList, *http.Response, error) { + return r.ApiService.FindDeviceEventsExecute(r) +} + +/* +FindDeviceEvents Retrieve device's events + +Returns a list of events pertaining to a specific device + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindDeviceEventsRequest +*/ +func (a *EventsApiService) FindDeviceEvents(ctx context.Context, id string) ApiFindDeviceEventsRequest { + return ApiFindDeviceEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventList +func (a *EventsApiService) FindDeviceEventsExecute(r ApiFindDeviceEventsRequest) (*EventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindDeviceEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return EventList +func (r ApiFindDeviceEventsRequest) ExecuteWithPagination() (*EventList, error) { + + var items EventList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Events = append(items.Events, page.Events...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindEventByIdRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindEventByIdRequest) Include(include []string) ApiFindEventByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindEventByIdRequest) Exclude(exclude []string) ApiFindEventByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindEventByIdRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.FindEventByIdExecute(r) +} + +/* +FindEventById Retrieve an event + +Returns a single event if the user has access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Event UUID + @return ApiFindEventByIdRequest +*/ +func (a *EventsApiService) FindEventById(ctx context.Context, id string) ApiFindEventByIdRequest { + return ApiFindEventByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsApiService) FindEventByIdExecute(r ApiFindEventByIdRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindEventById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindEventsRequest) Include(include []string) ApiFindEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindEventsRequest) Exclude(exclude []string) ApiFindEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindEventsRequest) Page(page int32) ApiFindEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindEventsRequest) PerPage(perPage int32) ApiFindEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindEventsRequest) Execute() (*EventList, *http.Response, error) { + return r.ApiService.FindEventsExecute(r) +} + +/* +FindEvents Retrieve current user's events + +Returns a list of the current user’s events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindEventsRequest +*/ +func (a *EventsApiService) FindEvents(ctx context.Context) ApiFindEventsRequest { + return ApiFindEventsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EventList +func (a *EventsApiService) FindEventsExecute(r ApiFindEventsRequest) (*EventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return EventList +func (r ApiFindEventsRequest) ExecuteWithPagination() (*EventList, error) { + + var items EventList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Events = append(items.Events, page.Events...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindInterconnectionEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + connectionId string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindInterconnectionEventsRequest) Include(include []string) ApiFindInterconnectionEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindInterconnectionEventsRequest) Exclude(exclude []string) ApiFindInterconnectionEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindInterconnectionEventsRequest) Page(page int32) ApiFindInterconnectionEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindInterconnectionEventsRequest) PerPage(perPage int32) ApiFindInterconnectionEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindInterconnectionEventsRequest) Execute() (*EventList, *http.Response, error) { + return r.ApiService.FindInterconnectionEventsExecute(r) +} + +/* +FindInterconnectionEvents Retrieve interconnection events + +Returns a list of the interconnection events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId Interconnection UUID + @return ApiFindInterconnectionEventsRequest +*/ +func (a *EventsApiService) FindInterconnectionEvents(ctx context.Context, connectionId string) ApiFindInterconnectionEventsRequest { + return ApiFindInterconnectionEventsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return EventList +func (a *EventsApiService) FindInterconnectionEventsExecute(r ApiFindInterconnectionEventsRequest) (*EventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindInterconnectionEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return EventList +func (r ApiFindInterconnectionEventsRequest) ExecuteWithPagination() (*EventList, error) { + + var items EventList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Events = append(items.Events, page.Events...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindInterconnectionPortEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + connectionId string + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindInterconnectionPortEventsRequest) Include(include []string) ApiFindInterconnectionPortEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindInterconnectionPortEventsRequest) Exclude(exclude []string) ApiFindInterconnectionPortEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindInterconnectionPortEventsRequest) Page(page int32) ApiFindInterconnectionPortEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindInterconnectionPortEventsRequest) PerPage(perPage int32) ApiFindInterconnectionPortEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindInterconnectionPortEventsRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.FindInterconnectionPortEventsExecute(r) +} + +/* +FindInterconnectionPortEvents Retrieve interconnection port events + +Returns a list of the interconnection port events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId Interconnection UUID + @param id Interconnection Port UUID + @return ApiFindInterconnectionPortEventsRequest +*/ +func (a *EventsApiService) FindInterconnectionPortEvents(ctx context.Context, connectionId string, id string) ApiFindInterconnectionPortEventsRequest { + return ApiFindInterconnectionPortEventsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + id: id, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsApiService) FindInterconnectionPortEventsExecute(r ApiFindInterconnectionPortEventsRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindInterconnectionPortEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/ports/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationEventsRequest) Include(include []string) ApiFindOrganizationEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindOrganizationEventsRequest) Exclude(exclude []string) ApiFindOrganizationEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindOrganizationEventsRequest) Page(page int32) ApiFindOrganizationEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationEventsRequest) PerPage(perPage int32) ApiFindOrganizationEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationEventsRequest) Execute() (*EventList, *http.Response, error) { + return r.ApiService.FindOrganizationEventsExecute(r) +} + +/* +FindOrganizationEvents Retrieve organization's events + +Returns a list of events for a single organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationEventsRequest +*/ +func (a *EventsApiService) FindOrganizationEvents(ctx context.Context, id string) ApiFindOrganizationEventsRequest { + return ApiFindOrganizationEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventList +func (a *EventsApiService) FindOrganizationEventsExecute(r ApiFindOrganizationEventsRequest) (*EventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindOrganizationEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return EventList +func (r ApiFindOrganizationEventsRequest) ExecuteWithPagination() (*EventList, error) { + + var items EventList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Events = append(items.Events, page.Events...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindProjectEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectEventsRequest) Include(include []string) ApiFindProjectEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectEventsRequest) Exclude(exclude []string) ApiFindProjectEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindProjectEventsRequest) Page(page int32) ApiFindProjectEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectEventsRequest) PerPage(perPage int32) ApiFindProjectEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectEventsRequest) Execute() (*EventList, *http.Response, error) { + return r.ApiService.FindProjectEventsExecute(r) +} + +/* +FindProjectEvents Retrieve project's events + +Returns a list of events for a single project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectEventsRequest +*/ +func (a *EventsApiService) FindProjectEvents(ctx context.Context, id string) ApiFindProjectEventsRequest { + return ApiFindProjectEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EventList +func (a *EventsApiService) FindProjectEventsExecute(r ApiFindProjectEventsRequest) (*EventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindProjectEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return EventList +func (r ApiFindProjectEventsRequest) ExecuteWithPagination() (*EventList, error) { + + var items EventList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Events = append(items.Events, page.Events...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindVirtualCircuitEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVirtualCircuitEventsRequest) Include(include []string) ApiFindVirtualCircuitEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVirtualCircuitEventsRequest) Exclude(exclude []string) ApiFindVirtualCircuitEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindVirtualCircuitEventsRequest) Page(page int32) ApiFindVirtualCircuitEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindVirtualCircuitEventsRequest) PerPage(perPage int32) ApiFindVirtualCircuitEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindVirtualCircuitEventsRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.FindVirtualCircuitEventsExecute(r) +} + +/* +FindVirtualCircuitEvents Retrieve virtual circuit events + +Returns a list of the virtual circuit events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Circuit UUID + @return ApiFindVirtualCircuitEventsRequest +*/ +func (a *EventsApiService) FindVirtualCircuitEvents(ctx context.Context, id string) ApiFindVirtualCircuitEventsRequest { + return ApiFindVirtualCircuitEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsApiService) FindVirtualCircuitEventsExecute(r ApiFindVirtualCircuitEventsRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindVirtualCircuitEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-circuits/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfRouteEventsRequest struct { + ctx context.Context + ApiService *EventsApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfRouteEventsRequest) Include(include []string) ApiFindVrfRouteEventsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfRouteEventsRequest) Exclude(exclude []string) ApiFindVrfRouteEventsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindVrfRouteEventsRequest) Page(page int32) ApiFindVrfRouteEventsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindVrfRouteEventsRequest) PerPage(perPage int32) ApiFindVrfRouteEventsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindVrfRouteEventsRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.FindVrfRouteEventsExecute(r) +} + +/* +FindVrfRouteEvents Retrieve VRF route events + +Returns a list of the VRF route events + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF Route UUID + @return ApiFindVrfRouteEventsRequest +*/ +func (a *EventsApiService) FindVrfRouteEvents(ctx context.Context, id string) ApiFindVrfRouteEventsRequest { + return ApiFindVrfRouteEventsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsApiService) FindVrfRouteEventsExecute(r ApiFindVrfRouteEventsRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsApiService.FindVrfRouteEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/routes/{id}/events" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_facilities.go b/services/metalv1/api_facilities.go new file mode 100644 index 00000000..96fc1d17 --- /dev/null +++ b/services/metalv1/api_facilities.go @@ -0,0 +1,520 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// FacilitiesApiService FacilitiesApi service +type FacilitiesApiService service + +type ApiFindFacilitiesRequest struct { + ctx context.Context + ApiService *FacilitiesApiService + include *[]FindFacilitiesIncludeParameterInner + exclude *[]FindFacilitiesIncludeParameterInner +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindFacilitiesRequest) Include(include []FindFacilitiesIncludeParameterInner) ApiFindFacilitiesRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindFacilitiesRequest) Exclude(exclude []FindFacilitiesIncludeParameterInner) ApiFindFacilitiesRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindFacilitiesRequest) Execute() (*FacilityList, *http.Response, error) { + return r.ApiService.FindFacilitiesExecute(r) +} + +/* +FindFacilities Retrieve all facilities + +Provides a listing of available datacenters where you can provision Packet devices. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindFacilitiesRequest + +Deprecated +*/ +func (a *FacilitiesApiService) FindFacilities(ctx context.Context) ApiFindFacilitiesRequest { + return ApiFindFacilitiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FacilityList +// +// Deprecated +func (a *FacilitiesApiService) FindFacilitiesExecute(r ApiFindFacilitiesRequest) (*FacilityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FacilityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FacilitiesApiService.FindFacilities") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/facilities" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindFacilitiesByOrganizationRequest struct { + ctx context.Context + ApiService *FacilitiesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindFacilitiesByOrganizationRequest) Include(include []string) ApiFindFacilitiesByOrganizationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindFacilitiesByOrganizationRequest) Exclude(exclude []string) ApiFindFacilitiesByOrganizationRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindFacilitiesByOrganizationRequest) Execute() (*FacilityList, *http.Response, error) { + return r.ApiService.FindFacilitiesByOrganizationExecute(r) +} + +/* +FindFacilitiesByOrganization Retrieve all facilities visible by the organization + +Returns a listing of available datacenters for the given organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindFacilitiesByOrganizationRequest + +Deprecated +*/ +func (a *FacilitiesApiService) FindFacilitiesByOrganization(ctx context.Context, id string) ApiFindFacilitiesByOrganizationRequest { + return ApiFindFacilitiesByOrganizationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FacilityList +// +// Deprecated +func (a *FacilitiesApiService) FindFacilitiesByOrganizationExecute(r ApiFindFacilitiesByOrganizationRequest) (*FacilityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FacilityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FacilitiesApiService.FindFacilitiesByOrganization") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/facilities" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindFacilitiesByProjectRequest struct { + ctx context.Context + ApiService *FacilitiesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindFacilitiesByProjectRequest) Include(include []string) ApiFindFacilitiesByProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindFacilitiesByProjectRequest) Exclude(exclude []string) ApiFindFacilitiesByProjectRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindFacilitiesByProjectRequest) Execute() (*FacilityList, *http.Response, error) { + return r.ApiService.FindFacilitiesByProjectExecute(r) +} + +/* +FindFacilitiesByProject Retrieve all facilities visible by the project + +Returns a listing of available datacenters for the given project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindFacilitiesByProjectRequest + +Deprecated +*/ +func (a *FacilitiesApiService) FindFacilitiesByProject(ctx context.Context, id string) ApiFindFacilitiesByProjectRequest { + return ApiFindFacilitiesByProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FacilityList +// +// Deprecated +func (a *FacilitiesApiService) FindFacilitiesByProjectExecute(r ApiFindFacilitiesByProjectRequest) (*FacilityList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FacilityList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FacilitiesApiService.FindFacilitiesByProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/facilities" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_firmware_sets.go b/services/metalv1/api_firmware_sets.go new file mode 100644 index 00000000..f2a0cb26 --- /dev/null +++ b/services/metalv1/api_firmware_sets.go @@ -0,0 +1,320 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// FirmwareSetsApiService FirmwareSetsApi service +type FirmwareSetsApiService service + +type ApiGetOrganizationFirmwareSetsRequest struct { + ctx context.Context + ApiService *FirmwareSetsApiService + id string + page *int32 + perPage *int32 +} + +// page number to return +func (r ApiGetOrganizationFirmwareSetsRequest) Page(page int32) ApiGetOrganizationFirmwareSetsRequest { + r.page = &page + return r +} + +// items returned per page. +func (r ApiGetOrganizationFirmwareSetsRequest) PerPage(perPage int32) ApiGetOrganizationFirmwareSetsRequest { + r.perPage = &perPage + return r +} + +func (r ApiGetOrganizationFirmwareSetsRequest) Execute() (*FirmwareSetListResponse, *http.Response, error) { + return r.ApiService.GetOrganizationFirmwareSetsExecute(r) +} + +/* +GetOrganizationFirmwareSets Get Organization's Firmware Sets + +Returns all firmware sets associated with the organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiGetOrganizationFirmwareSetsRequest +*/ +func (a *FirmwareSetsApiService) GetOrganizationFirmwareSets(ctx context.Context, id string) ApiGetOrganizationFirmwareSetsRequest { + return ApiGetOrganizationFirmwareSetsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FirmwareSetListResponse +func (a *FirmwareSetsApiService) GetOrganizationFirmwareSetsExecute(r ApiGetOrganizationFirmwareSetsRequest) (*FirmwareSetListResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FirmwareSetListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirmwareSetsApiService.GetOrganizationFirmwareSets") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/firmware-sets" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetProjectFirmwareSetsRequest struct { + ctx context.Context + ApiService *FirmwareSetsApiService + id string + page *int32 + perPage *int32 +} + +// page number to return +func (r ApiGetProjectFirmwareSetsRequest) Page(page int32) ApiGetProjectFirmwareSetsRequest { + r.page = &page + return r +} + +// items returned per page. +func (r ApiGetProjectFirmwareSetsRequest) PerPage(perPage int32) ApiGetProjectFirmwareSetsRequest { + r.perPage = &perPage + return r +} + +func (r ApiGetProjectFirmwareSetsRequest) Execute() (*FirmwareSetListResponse, *http.Response, error) { + return r.ApiService.GetProjectFirmwareSetsExecute(r) +} + +/* +GetProjectFirmwareSets Get Project's Firmware Sets + +Returns all firmware sets associated with the project or organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiGetProjectFirmwareSetsRequest +*/ +func (a *FirmwareSetsApiService) GetProjectFirmwareSets(ctx context.Context, id string) ApiGetProjectFirmwareSetsRequest { + return ApiGetProjectFirmwareSetsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FirmwareSetListResponse +func (a *FirmwareSetsApiService) GetProjectFirmwareSetsExecute(r ApiGetProjectFirmwareSetsRequest) (*FirmwareSetListResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FirmwareSetListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FirmwareSetsApiService.GetProjectFirmwareSets") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/firmware-sets" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_hardware_reservations.go b/services/metalv1/api_hardware_reservations.go new file mode 100644 index 00000000..0315dd36 --- /dev/null +++ b/services/metalv1/api_hardware_reservations.go @@ -0,0 +1,800 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// HardwareReservationsApiService HardwareReservationsApi service +type HardwareReservationsApiService service + +type ApiActivateHardwareReservationRequest struct { + ctx context.Context + ApiService *HardwareReservationsApiService + id string + include *[]string + exclude *[]string + activateHardwareReservationRequest *ActivateHardwareReservationRequest +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiActivateHardwareReservationRequest) Include(include []string) ApiActivateHardwareReservationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiActivateHardwareReservationRequest) Exclude(exclude []string) ApiActivateHardwareReservationRequest { + r.exclude = &exclude + return r +} + +// Note to attach to the reservation +func (r ApiActivateHardwareReservationRequest) ActivateHardwareReservationRequest(activateHardwareReservationRequest ActivateHardwareReservationRequest) ApiActivateHardwareReservationRequest { + r.activateHardwareReservationRequest = &activateHardwareReservationRequest + return r +} + +func (r ApiActivateHardwareReservationRequest) Execute() (*HardwareReservation, *http.Response, error) { + return r.ApiService.ActivateHardwareReservationExecute(r) +} + +/* +ActivateHardwareReservation Activate a spare hardware reservation + +Activate a spare hardware reservation + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Hardware Reservation UUID + @return ApiActivateHardwareReservationRequest +*/ +func (a *HardwareReservationsApiService) ActivateHardwareReservation(ctx context.Context, id string) ApiActivateHardwareReservationRequest { + return ApiActivateHardwareReservationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return HardwareReservation +func (a *HardwareReservationsApiService) ActivateHardwareReservationExecute(r ApiActivateHardwareReservationRequest) (*HardwareReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HardwareReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HardwareReservationsApiService.ActivateHardwareReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/hardware-reservations/{id}/activate" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.activateHardwareReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindHardwareReservationByIdRequest struct { + ctx context.Context + ApiService *HardwareReservationsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindHardwareReservationByIdRequest) Include(include []string) ApiFindHardwareReservationByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindHardwareReservationByIdRequest) Exclude(exclude []string) ApiFindHardwareReservationByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindHardwareReservationByIdRequest) Execute() (*HardwareReservation, *http.Response, error) { + return r.ApiService.FindHardwareReservationByIdExecute(r) +} + +/* +FindHardwareReservationById Retrieve a hardware reservation + +Returns a single hardware reservation + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id HardwareReservation UUID + @return ApiFindHardwareReservationByIdRequest +*/ +func (a *HardwareReservationsApiService) FindHardwareReservationById(ctx context.Context, id string) ApiFindHardwareReservationByIdRequest { + return ApiFindHardwareReservationByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return HardwareReservation +func (a *HardwareReservationsApiService) FindHardwareReservationByIdExecute(r ApiFindHardwareReservationByIdRequest) (*HardwareReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HardwareReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HardwareReservationsApiService.FindHardwareReservationById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/hardware-reservations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectHardwareReservationsRequest struct { + ctx context.Context + ApiService *HardwareReservationsApiService + id string + query *string + state *FindProjectHardwareReservationsStateParameter + provisionable *FindProjectHardwareReservationsProvisionableParameter + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Search by facility code, plan name, project name, reservation short ID or device hostname +func (r ApiFindProjectHardwareReservationsRequest) Query(query string) ApiFindProjectHardwareReservationsRequest { + r.query = &query + return r +} + +// Filter by hardware reservation state +func (r ApiFindProjectHardwareReservationsRequest) State(state FindProjectHardwareReservationsStateParameter) ApiFindProjectHardwareReservationsRequest { + r.state = &state + return r +} + +// Filter hardware reservation that is provisionable +func (r ApiFindProjectHardwareReservationsRequest) Provisionable(provisionable FindProjectHardwareReservationsProvisionableParameter) ApiFindProjectHardwareReservationsRequest { + r.provisionable = &provisionable + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectHardwareReservationsRequest) Include(include []string) ApiFindProjectHardwareReservationsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectHardwareReservationsRequest) Exclude(exclude []string) ApiFindProjectHardwareReservationsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindProjectHardwareReservationsRequest) Page(page int32) ApiFindProjectHardwareReservationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectHardwareReservationsRequest) PerPage(perPage int32) ApiFindProjectHardwareReservationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectHardwareReservationsRequest) Execute() (*HardwareReservationList, *http.Response, error) { + return r.ApiService.FindProjectHardwareReservationsExecute(r) +} + +/* +FindProjectHardwareReservations Retrieve all hardware reservations for a given project + +Provides a collection of hardware reservations for a given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectHardwareReservationsRequest +*/ +func (a *HardwareReservationsApiService) FindProjectHardwareReservations(ctx context.Context, id string) ApiFindProjectHardwareReservationsRequest { + return ApiFindProjectHardwareReservationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return HardwareReservationList +func (a *HardwareReservationsApiService) FindProjectHardwareReservationsExecute(r ApiFindProjectHardwareReservationsRequest) (*HardwareReservationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HardwareReservationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HardwareReservationsApiService.FindProjectHardwareReservations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/hardware-reservations" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.query != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "query", r.query, "") + } + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "") + } + if r.provisionable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provisionable", r.provisionable, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return HardwareReservationList +func (r ApiFindProjectHardwareReservationsRequest) ExecuteWithPagination() (*HardwareReservationList, error) { + + var items HardwareReservationList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.HardwareReservations = append(items.HardwareReservations, page.HardwareReservations...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiMoveHardwareReservationRequest struct { + ctx context.Context + ApiService *HardwareReservationsApiService + id string + moveHardwareReservationRequest *MoveHardwareReservationRequest + include *[]string + exclude *[]string +} + +// Destination Project UUID +func (r ApiMoveHardwareReservationRequest) MoveHardwareReservationRequest(moveHardwareReservationRequest MoveHardwareReservationRequest) ApiMoveHardwareReservationRequest { + r.moveHardwareReservationRequest = &moveHardwareReservationRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiMoveHardwareReservationRequest) Include(include []string) ApiMoveHardwareReservationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiMoveHardwareReservationRequest) Exclude(exclude []string) ApiMoveHardwareReservationRequest { + r.exclude = &exclude + return r +} + +func (r ApiMoveHardwareReservationRequest) Execute() (*HardwareReservation, *http.Response, error) { + return r.ApiService.MoveHardwareReservationExecute(r) +} + +/* +MoveHardwareReservation Move a hardware reservation + +Move a hardware reservation to another project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Hardware Reservation UUID + @return ApiMoveHardwareReservationRequest +*/ +func (a *HardwareReservationsApiService) MoveHardwareReservation(ctx context.Context, id string) ApiMoveHardwareReservationRequest { + return ApiMoveHardwareReservationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return HardwareReservation +func (a *HardwareReservationsApiService) MoveHardwareReservationExecute(r ApiMoveHardwareReservationRequest) (*HardwareReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HardwareReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HardwareReservationsApiService.MoveHardwareReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/hardware-reservations/{id}/move" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.moveHardwareReservationRequest == nil { + return localVarReturnValue, nil, reportError("moveHardwareReservationRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.moveHardwareReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_incidents.go b/services/metalv1/api_incidents.go new file mode 100644 index 00000000..022f6be1 --- /dev/null +++ b/services/metalv1/api_incidents.go @@ -0,0 +1,155 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// IncidentsApiService IncidentsApi service +type IncidentsApiService service + +type ApiFindIncidentsRequest struct { + ctx context.Context + ApiService *IncidentsApiService + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindIncidentsRequest) Include(include []string) ApiFindIncidentsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindIncidentsRequest) Exclude(exclude []string) ApiFindIncidentsRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindIncidentsRequest) Execute() (*http.Response, error) { + return r.ApiService.FindIncidentsExecute(r) +} + +/* +FindIncidents Retrieve the number of incidents + +Retrieve the number of incidents. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindIncidentsRequest +*/ +func (a *IncidentsApiService) FindIncidents(ctx context.Context) ApiFindIncidentsRequest { + return ApiFindIncidentsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *IncidentsApiService) FindIncidentsExecute(r ApiFindIncidentsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IncidentsApiService.FindIncidents") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/incidents" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_interconnections.go b/services/metalv1/api_interconnections.go new file mode 100644 index 00000000..cb2d5fe4 --- /dev/null +++ b/services/metalv1/api_interconnections.go @@ -0,0 +1,2477 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// InterconnectionsApiService InterconnectionsApi service +type InterconnectionsApiService service + +type ApiCreateInterconnectionPortVirtualCircuitRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + portId string + virtualCircuitCreateInput *VirtualCircuitCreateInput +} + +// Virtual Circuit details +func (r ApiCreateInterconnectionPortVirtualCircuitRequest) VirtualCircuitCreateInput(virtualCircuitCreateInput VirtualCircuitCreateInput) ApiCreateInterconnectionPortVirtualCircuitRequest { + r.virtualCircuitCreateInput = &virtualCircuitCreateInput + return r +} + +func (r ApiCreateInterconnectionPortVirtualCircuitRequest) Execute() (*VirtualCircuit, *http.Response, error) { + return r.ApiService.CreateInterconnectionPortVirtualCircuitExecute(r) +} + +/* +CreateInterconnectionPortVirtualCircuit Create a new Virtual Circuit + +Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, along with the NNI VLAN value. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId UUID of the interconnection + @param portId UUID of the interconnection port + @return ApiCreateInterconnectionPortVirtualCircuitRequest +*/ +func (a *InterconnectionsApiService) CreateInterconnectionPortVirtualCircuit(ctx context.Context, connectionId string, portId string) ApiCreateInterconnectionPortVirtualCircuitRequest { + return ApiCreateInterconnectionPortVirtualCircuitRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + portId: portId, + } +} + +// Execute executes the request +// +// @return VirtualCircuit +func (a *InterconnectionsApiService) CreateInterconnectionPortVirtualCircuitExecute(r ApiCreateInterconnectionPortVirtualCircuitRequest) (*VirtualCircuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.CreateInterconnectionPortVirtualCircuit") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/ports/{port_id}/virtual-circuits" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"port_id"+"}", url.PathEscape(parameterValueToString(r.portId, "portId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualCircuitCreateInput == nil { + return localVarReturnValue, nil, reportError("virtualCircuitCreateInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualCircuitCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateOrganizationInterconnectionRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + organizationId string + createOrganizationInterconnectionRequest *CreateOrganizationInterconnectionRequest + include *[]string + exclude *[]string +} + +// Dedicated port or shared interconnection (also known as Fabric VC) creation request +func (r ApiCreateOrganizationInterconnectionRequest) CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest CreateOrganizationInterconnectionRequest) ApiCreateOrganizationInterconnectionRequest { + r.createOrganizationInterconnectionRequest = &createOrganizationInterconnectionRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateOrganizationInterconnectionRequest) Include(include []string) ApiCreateOrganizationInterconnectionRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateOrganizationInterconnectionRequest) Exclude(exclude []string) ApiCreateOrganizationInterconnectionRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateOrganizationInterconnectionRequest) Execute() (*Interconnection, *http.Response, error) { + return r.ApiService.CreateOrganizationInterconnectionExecute(r) +} + +/* +CreateOrganizationInterconnection Request a new interconnection for the organization + +Creates a new interconnection request. A Project ID must be specified in the request body for connections on shared ports. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId UUID of the organization + @return ApiCreateOrganizationInterconnectionRequest +*/ +func (a *InterconnectionsApiService) CreateOrganizationInterconnection(ctx context.Context, organizationId string) ApiCreateOrganizationInterconnectionRequest { + return ApiCreateOrganizationInterconnectionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return Interconnection +func (a *InterconnectionsApiService) CreateOrganizationInterconnectionExecute(r ApiCreateOrganizationInterconnectionRequest) (*Interconnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interconnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.CreateOrganizationInterconnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{organization_id}/connections" + localVarPath = strings.Replace(localVarPath, "{"+"organization_id"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createOrganizationInterconnectionRequest == nil { + return localVarReturnValue, nil, reportError("createOrganizationInterconnectionRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createOrganizationInterconnectionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateProjectInterconnectionRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + projectId string + createOrganizationInterconnectionRequest *CreateOrganizationInterconnectionRequest + include *[]string + exclude *[]string +} + +// Dedicated port or shared interconnection (also known as Fabric VC) creation request +func (r ApiCreateProjectInterconnectionRequest) CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest CreateOrganizationInterconnectionRequest) ApiCreateProjectInterconnectionRequest { + r.createOrganizationInterconnectionRequest = &createOrganizationInterconnectionRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateProjectInterconnectionRequest) Include(include []string) ApiCreateProjectInterconnectionRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateProjectInterconnectionRequest) Exclude(exclude []string) ApiCreateProjectInterconnectionRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateProjectInterconnectionRequest) Execute() (*Interconnection, *http.Response, error) { + return r.ApiService.CreateProjectInterconnectionExecute(r) +} + +/* +CreateProjectInterconnection Request a new interconnection for the project's organization + +Creates a new interconnection request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId UUID of the project + @return ApiCreateProjectInterconnectionRequest +*/ +func (a *InterconnectionsApiService) CreateProjectInterconnection(ctx context.Context, projectId string) ApiCreateProjectInterconnectionRequest { + return ApiCreateProjectInterconnectionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Interconnection +func (a *InterconnectionsApiService) CreateProjectInterconnectionExecute(r ApiCreateProjectInterconnectionRequest) (*Interconnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interconnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.CreateProjectInterconnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/connections" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createOrganizationInterconnectionRequest == nil { + return localVarReturnValue, nil, reportError("createOrganizationInterconnectionRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createOrganizationInterconnectionRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteInterconnectionRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteInterconnectionRequest) Include(include []string) ApiDeleteInterconnectionRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteInterconnectionRequest) Exclude(exclude []string) ApiDeleteInterconnectionRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteInterconnectionRequest) Execute() (*Interconnection, *http.Response, error) { + return r.ApiService.DeleteInterconnectionExecute(r) +} + +/* +DeleteInterconnection Delete interconnection + +Delete a interconnection, its associated ports and virtual circuits. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId Interconnection UUID + @return ApiDeleteInterconnectionRequest +*/ +func (a *InterconnectionsApiService) DeleteInterconnection(ctx context.Context, connectionId string) ApiDeleteInterconnectionRequest { + return ApiDeleteInterconnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return Interconnection +func (a *InterconnectionsApiService) DeleteInterconnectionExecute(r ApiDeleteInterconnectionRequest) (*Interconnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interconnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.DeleteInterconnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteVirtualCircuitRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteVirtualCircuitRequest) Include(include []string) ApiDeleteVirtualCircuitRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteVirtualCircuitRequest) Exclude(exclude []string) ApiDeleteVirtualCircuitRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteVirtualCircuitRequest) Execute() (*VirtualCircuit, *http.Response, error) { + return r.ApiService.DeleteVirtualCircuitExecute(r) +} + +/* +DeleteVirtualCircuit Delete a virtual circuit + +Delete a virtual circuit from a Dedicated Port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Circuit UUID + @return ApiDeleteVirtualCircuitRequest +*/ +func (a *InterconnectionsApiService) DeleteVirtualCircuit(ctx context.Context, id string) ApiDeleteVirtualCircuitRequest { + return ApiDeleteVirtualCircuitRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualCircuit +func (a *InterconnectionsApiService) DeleteVirtualCircuitExecute(r ApiDeleteVirtualCircuitRequest) (*VirtualCircuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.DeleteVirtualCircuit") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-circuits/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInterconnectionRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetInterconnectionRequest) Include(include []string) ApiGetInterconnectionRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetInterconnectionRequest) Exclude(exclude []string) ApiGetInterconnectionRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetInterconnectionRequest) Execute() (*Interconnection, *http.Response, error) { + return r.ApiService.GetInterconnectionExecute(r) +} + +/* +GetInterconnection Get interconnection + +Get the details of a interconnection + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId Interconnection UUID + @return ApiGetInterconnectionRequest +*/ +func (a *InterconnectionsApiService) GetInterconnection(ctx context.Context, connectionId string) ApiGetInterconnectionRequest { + return ApiGetInterconnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return Interconnection +func (a *InterconnectionsApiService) GetInterconnectionExecute(r ApiGetInterconnectionRequest) (*Interconnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interconnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.GetInterconnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInterconnectionPortRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetInterconnectionPortRequest) Include(include []string) ApiGetInterconnectionPortRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetInterconnectionPortRequest) Exclude(exclude []string) ApiGetInterconnectionPortRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetInterconnectionPortRequest) Execute() (*InterconnectionPort, *http.Response, error) { + return r.ApiService.GetInterconnectionPortExecute(r) +} + +/* +GetInterconnectionPort Get a interconnection port + +Get the details of an interconnection port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId UUID of the interconnection + @param id Port UUID + @return ApiGetInterconnectionPortRequest +*/ +func (a *InterconnectionsApiService) GetInterconnectionPort(ctx context.Context, connectionId string, id string) ApiGetInterconnectionPortRequest { + return ApiGetInterconnectionPortRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + id: id, + } +} + +// Execute executes the request +// +// @return InterconnectionPort +func (a *InterconnectionsApiService) GetInterconnectionPortExecute(r ApiGetInterconnectionPortRequest) (*InterconnectionPort, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterconnectionPort + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.GetInterconnectionPort") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/ports/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVirtualCircuitRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetVirtualCircuitRequest) Include(include []string) ApiGetVirtualCircuitRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetVirtualCircuitRequest) Exclude(exclude []string) ApiGetVirtualCircuitRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetVirtualCircuitRequest) Execute() (*VirtualCircuit, *http.Response, error) { + return r.ApiService.GetVirtualCircuitExecute(r) +} + +/* +GetVirtualCircuit Get a virtual circuit + +Get the details of a virtual circuit + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Circuit UUID + @return ApiGetVirtualCircuitRequest +*/ +func (a *InterconnectionsApiService) GetVirtualCircuit(ctx context.Context, id string) ApiGetVirtualCircuitRequest { + return ApiGetVirtualCircuitRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualCircuit +func (a *InterconnectionsApiService) GetVirtualCircuitExecute(r ApiGetVirtualCircuitRequest) (*VirtualCircuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.GetVirtualCircuit") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-circuits/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInterconnectionPortVirtualCircuitsRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + portId string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiListInterconnectionPortVirtualCircuitsRequest) Include(include []string) ApiListInterconnectionPortVirtualCircuitsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiListInterconnectionPortVirtualCircuitsRequest) Exclude(exclude []string) ApiListInterconnectionPortVirtualCircuitsRequest { + r.exclude = &exclude + return r +} + +func (r ApiListInterconnectionPortVirtualCircuitsRequest) Execute() (*VirtualCircuitList, *http.Response, error) { + return r.ApiService.ListInterconnectionPortVirtualCircuitsExecute(r) +} + +/* +ListInterconnectionPortVirtualCircuits List a interconnection port's virtual circuits + +List the virtual circuit record(s) associatiated with a particular interconnection port. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId UUID of the interconnection + @param portId UUID of the interconnection port + @return ApiListInterconnectionPortVirtualCircuitsRequest +*/ +func (a *InterconnectionsApiService) ListInterconnectionPortVirtualCircuits(ctx context.Context, connectionId string, portId string) ApiListInterconnectionPortVirtualCircuitsRequest { + return ApiListInterconnectionPortVirtualCircuitsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + portId: portId, + } +} + +// Execute executes the request +// +// @return VirtualCircuitList +func (a *InterconnectionsApiService) ListInterconnectionPortVirtualCircuitsExecute(r ApiListInterconnectionPortVirtualCircuitsRequest) (*VirtualCircuitList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuitList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.ListInterconnectionPortVirtualCircuits") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/ports/{port_id}/virtual-circuits" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"port_id"+"}", url.PathEscape(parameterValueToString(r.portId, "portId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInterconnectionPortsRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string +} + +func (r ApiListInterconnectionPortsRequest) Execute() (*InterconnectionPortList, *http.Response, error) { + return r.ApiService.ListInterconnectionPortsExecute(r) +} + +/* +ListInterconnectionPorts List a interconnection's ports + +List the ports associated to an interconnection. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId UUID of the interconnection + @return ApiListInterconnectionPortsRequest +*/ +func (a *InterconnectionsApiService) ListInterconnectionPorts(ctx context.Context, connectionId string) ApiListInterconnectionPortsRequest { + return ApiListInterconnectionPortsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return InterconnectionPortList +func (a *InterconnectionsApiService) ListInterconnectionPortsExecute(r ApiListInterconnectionPortsRequest) (*InterconnectionPortList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterconnectionPortList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.ListInterconnectionPorts") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/ports" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListInterconnectionVirtualCircuitsRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string +} + +func (r ApiListInterconnectionVirtualCircuitsRequest) Execute() (*VirtualCircuitList, *http.Response, error) { + return r.ApiService.ListInterconnectionVirtualCircuitsExecute(r) +} + +/* +ListInterconnectionVirtualCircuits List a interconnection's virtual circuits + +List the virtual circuit record(s) associated with a particular interconnection id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId UUID of the interconnection + @return ApiListInterconnectionVirtualCircuitsRequest +*/ +func (a *InterconnectionsApiService) ListInterconnectionVirtualCircuits(ctx context.Context, connectionId string) ApiListInterconnectionVirtualCircuitsRequest { + return ApiListInterconnectionVirtualCircuitsRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return VirtualCircuitList +func (a *InterconnectionsApiService) ListInterconnectionVirtualCircuitsExecute(r ApiListInterconnectionVirtualCircuitsRequest) (*VirtualCircuitList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuitList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.ListInterconnectionVirtualCircuits") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}/virtual-circuits" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOrganizationListInterconnectionsRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + organizationId string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiOrganizationListInterconnectionsRequest) Include(include []string) ApiOrganizationListInterconnectionsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiOrganizationListInterconnectionsRequest) Exclude(exclude []string) ApiOrganizationListInterconnectionsRequest { + r.exclude = &exclude + return r +} + +func (r ApiOrganizationListInterconnectionsRequest) Execute() (*InterconnectionList, *http.Response, error) { + return r.ApiService.OrganizationListInterconnectionsExecute(r) +} + +/* +OrganizationListInterconnections List organization connections + +List the connections belonging to the organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId UUID of the organization + @return ApiOrganizationListInterconnectionsRequest +*/ +func (a *InterconnectionsApiService) OrganizationListInterconnections(ctx context.Context, organizationId string) ApiOrganizationListInterconnectionsRequest { + return ApiOrganizationListInterconnectionsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return InterconnectionList +func (a *InterconnectionsApiService) OrganizationListInterconnectionsExecute(r ApiOrganizationListInterconnectionsRequest) (*InterconnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterconnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.OrganizationListInterconnections") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{organization_id}/connections" + localVarPath = strings.Replace(localVarPath, "{"+"organization_id"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProjectListInterconnectionsRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + projectId string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiProjectListInterconnectionsRequest) Include(include []string) ApiProjectListInterconnectionsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiProjectListInterconnectionsRequest) Exclude(exclude []string) ApiProjectListInterconnectionsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiProjectListInterconnectionsRequest) Page(page int32) ApiProjectListInterconnectionsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiProjectListInterconnectionsRequest) PerPage(perPage int32) ApiProjectListInterconnectionsRequest { + r.perPage = &perPage + return r +} + +func (r ApiProjectListInterconnectionsRequest) Execute() (*InterconnectionList, *http.Response, error) { + return r.ApiService.ProjectListInterconnectionsExecute(r) +} + +/* +ProjectListInterconnections List project connections + +List the connections belonging to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId UUID of the project + @return ApiProjectListInterconnectionsRequest +*/ +func (a *InterconnectionsApiService) ProjectListInterconnections(ctx context.Context, projectId string) ApiProjectListInterconnectionsRequest { + return ApiProjectListInterconnectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return InterconnectionList +func (a *InterconnectionsApiService) ProjectListInterconnectionsExecute(r ApiProjectListInterconnectionsRequest) (*InterconnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InterconnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.ProjectListInterconnections") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/connections" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return InterconnectionList +func (r ApiProjectListInterconnectionsRequest) ExecuteWithPagination() (*InterconnectionList, error) { + + var items InterconnectionList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Interconnections = append(items.Interconnections, page.Interconnections...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiUpdateInterconnectionRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + connectionId string + interconnectionUpdateInput *InterconnectionUpdateInput + include *[]string + exclude *[]string +} + +// Updated interconnection details +func (r ApiUpdateInterconnectionRequest) InterconnectionUpdateInput(interconnectionUpdateInput InterconnectionUpdateInput) ApiUpdateInterconnectionRequest { + r.interconnectionUpdateInput = &interconnectionUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateInterconnectionRequest) Include(include []string) ApiUpdateInterconnectionRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateInterconnectionRequest) Exclude(exclude []string) ApiUpdateInterconnectionRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateInterconnectionRequest) Execute() (*Interconnection, *http.Response, error) { + return r.ApiService.UpdateInterconnectionExecute(r) +} + +/* +UpdateInterconnection Update interconnection + +Update the details of a interconnection + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionId Interconnection UUID + @return ApiUpdateInterconnectionRequest +*/ +func (a *InterconnectionsApiService) UpdateInterconnection(ctx context.Context, connectionId string) ApiUpdateInterconnectionRequest { + return ApiUpdateInterconnectionRequest{ + ApiService: a, + ctx: ctx, + connectionId: connectionId, + } +} + +// Execute executes the request +// +// @return Interconnection +func (a *InterconnectionsApiService) UpdateInterconnectionExecute(r ApiUpdateInterconnectionRequest) (*Interconnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Interconnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.UpdateInterconnection") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/connections/{connection_id}" + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.interconnectionUpdateInput == nil { + return localVarReturnValue, nil, reportError("interconnectionUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.interconnectionUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateVirtualCircuitRequest struct { + ctx context.Context + ApiService *InterconnectionsApiService + id string + virtualCircuitUpdateInput *VirtualCircuitUpdateInput + include *[]string + exclude *[]string +} + +// Updated Virtual Circuit details +func (r ApiUpdateVirtualCircuitRequest) VirtualCircuitUpdateInput(virtualCircuitUpdateInput VirtualCircuitUpdateInput) ApiUpdateVirtualCircuitRequest { + r.virtualCircuitUpdateInput = &virtualCircuitUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateVirtualCircuitRequest) Include(include []string) ApiUpdateVirtualCircuitRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateVirtualCircuitRequest) Exclude(exclude []string) ApiUpdateVirtualCircuitRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateVirtualCircuitRequest) Execute() (*VirtualCircuit, *http.Response, error) { + return r.ApiService.UpdateVirtualCircuitExecute(r) +} + +/* +UpdateVirtualCircuit Update a virtual circuit + +Update the details of a virtual circuit. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Circuit UUID + @return ApiUpdateVirtualCircuitRequest +*/ +func (a *InterconnectionsApiService) UpdateVirtualCircuit(ctx context.Context, id string) ApiUpdateVirtualCircuitRequest { + return ApiUpdateVirtualCircuitRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualCircuit +func (a *InterconnectionsApiService) UpdateVirtualCircuitExecute(r ApiUpdateVirtualCircuitRequest) (*VirtualCircuit, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualCircuit + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InterconnectionsApiService.UpdateVirtualCircuit") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-circuits/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualCircuitUpdateInput == nil { + return localVarReturnValue, nil, reportError("virtualCircuitUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualCircuitUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_invitations.go b/services/metalv1/api_invitations.go new file mode 100644 index 00000000..a0102cc4 --- /dev/null +++ b/services/metalv1/api_invitations.go @@ -0,0 +1,482 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// InvitationsApiService InvitationsApi service +type InvitationsApiService service + +type ApiAcceptInvitationRequest struct { + ctx context.Context + ApiService *InvitationsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiAcceptInvitationRequest) Include(include []string) ApiAcceptInvitationRequest { + r.include = &include + return r +} + +func (r ApiAcceptInvitationRequest) Execute() (*Membership, *http.Response, error) { + return r.ApiService.AcceptInvitationExecute(r) +} + +/* +AcceptInvitation Accept an invitation + +Accept an invitation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Invitation UUID + @return ApiAcceptInvitationRequest +*/ +func (a *InvitationsApiService) AcceptInvitation(ctx context.Context, id string) ApiAcceptInvitationRequest { + return ApiAcceptInvitationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Membership +func (a *InvitationsApiService) AcceptInvitationExecute(r ApiAcceptInvitationRequest) (*Membership, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Membership + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.AcceptInvitation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/invitations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeclineInvitationRequest struct { + ctx context.Context + ApiService *InvitationsApiService + id string +} + +func (r ApiDeclineInvitationRequest) Execute() (*http.Response, error) { + return r.ApiService.DeclineInvitationExecute(r) +} + +/* +DeclineInvitation Decline an invitation + +Decline an invitation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Invitation UUID + @return ApiDeclineInvitationRequest +*/ +func (a *InvitationsApiService) DeclineInvitation(ctx context.Context, id string) ApiDeclineInvitationRequest { + return ApiDeclineInvitationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *InvitationsApiService) DeclineInvitationExecute(r ApiDeclineInvitationRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.DeclineInvitation") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/invitations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindInvitationByIdRequest struct { + ctx context.Context + ApiService *InvitationsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindInvitationByIdRequest) Include(include []string) ApiFindInvitationByIdRequest { + r.include = &include + return r +} + +func (r ApiFindInvitationByIdRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.FindInvitationByIdExecute(r) +} + +/* +FindInvitationById View an invitation + +Returns a single invitation. (It include the `invitable` to maintain backward compatibility but will be removed soon) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Invitation UUID + @return ApiFindInvitationByIdRequest +*/ +func (a *InvitationsApiService) FindInvitationById(ctx context.Context, id string) ApiFindInvitationByIdRequest { + return ApiFindInvitationByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *InvitationsApiService) FindInvitationByIdExecute(r ApiFindInvitationByIdRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.FindInvitationById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/invitations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_invoices.go b/services/metalv1/api_invoices.go new file mode 100644 index 00000000..d6951a82 --- /dev/null +++ b/services/metalv1/api_invoices.go @@ -0,0 +1,332 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// InvoicesApiService InvoicesApi service +type InvoicesApiService service + +type ApiFindOrganizationInvoicesRequest struct { + ctx context.Context + ApiService *InvoicesApiService + id string + page *int32 + perPage *int32 + status *string +} + +// page number +func (r ApiFindOrganizationInvoicesRequest) Page(page int32) ApiFindOrganizationInvoicesRequest { + r.page = &page + return r +} + +// per page +func (r ApiFindOrganizationInvoicesRequest) PerPage(perPage int32) ApiFindOrganizationInvoicesRequest { + r.perPage = &perPage + return r +} + +// filter by status +func (r ApiFindOrganizationInvoicesRequest) Status(status string) ApiFindOrganizationInvoicesRequest { + r.status = &status + return r +} + +func (r ApiFindOrganizationInvoicesRequest) Execute() (*InvoiceList, *http.Response, error) { + return r.ApiService.FindOrganizationInvoicesExecute(r) +} + +/* +FindOrganizationInvoices Retrieve all invoices for an organization + +Returns all invoices for an organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationInvoicesRequest +*/ +func (a *InvoicesApiService) FindOrganizationInvoices(ctx context.Context, id string) ApiFindOrganizationInvoicesRequest { + return ApiFindOrganizationInvoicesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InvoiceList +func (a *InvoicesApiService) FindOrganizationInvoicesExecute(r ApiFindOrganizationInvoicesRequest) (*InvoiceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvoiceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvoicesApiService.FindOrganizationInvoices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/invoices" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + if r.status != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInvoiceByIdRequest struct { + ctx context.Context + ApiService *InvoicesApiService + id string +} + +func (r ApiGetInvoiceByIdRequest) Execute() (*Invoice, *http.Response, error) { + return r.ApiService.GetInvoiceByIdExecute(r) +} + +/* +GetInvoiceById Retrieve an invoice + +Returns the invoice identified by the provided id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Invoice UUID + @return ApiGetInvoiceByIdRequest +*/ +func (a *InvoicesApiService) GetInvoiceById(ctx context.Context, id string) ApiGetInvoiceByIdRequest { + return ApiGetInvoiceByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Invoice +func (a *InvoicesApiService) GetInvoiceByIdExecute(r ApiGetInvoiceByIdRequest) (*Invoice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invoice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvoicesApiService.GetInvoiceById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/invoices/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_ip_addresses.go b/services/metalv1/api_ip_addresses.go new file mode 100644 index 00000000..21e48f9e --- /dev/null +++ b/services/metalv1/api_ip_addresses.go @@ -0,0 +1,1200 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// IPAddressesApiService IPAddressesApi service +type IPAddressesApiService service + +type ApiDeleteIPAddressRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string +} + +func (r ApiDeleteIPAddressRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteIPAddressExecute(r) +} + +/* +DeleteIPAddress Unassign an ip address + +This call can be used to un-assign an IP assignment or delete +an IP reservation. + +Un-assign an IP address record. +Use the assignment UUID you +get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. + +Delete an IP reservation. +Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id IP Address UUID + @return ApiDeleteIPAddressRequest +*/ +func (a *IPAddressesApiService) DeleteIPAddress(ctx context.Context, id string) ApiDeleteIPAddressRequest { + return ApiDeleteIPAddressRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IPAddressesApiService) DeleteIPAddressExecute(r ApiDeleteIPAddressRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.DeleteIPAddress") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ips/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindIPAddressByIdRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindIPAddressByIdRequest) Include(include []string) ApiFindIPAddressByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindIPAddressByIdRequest) Exclude(exclude []string) ApiFindIPAddressByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindIPAddressByIdRequest) Execute() (*FindIPAddressById200Response, *http.Response, error) { + return r.ApiService.FindIPAddressByIdExecute(r) +} + +/* +FindIPAddressById Retrieve an ip address + +Returns a single ip address if the user has access. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id IP Address UUID + @return ApiFindIPAddressByIdRequest +*/ +func (a *IPAddressesApiService) FindIPAddressById(ctx context.Context, id string) ApiFindIPAddressByIdRequest { + return ApiFindIPAddressByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FindIPAddressById200Response +func (a *IPAddressesApiService) FindIPAddressByIdExecute(r ApiFindIPAddressByIdRequest) (*FindIPAddressById200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindIPAddressById200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.FindIPAddressById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ips/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindIPAddressCustomdataRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string +} + +func (r ApiFindIPAddressCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindIPAddressCustomdataExecute(r) +} + +/* +FindIPAddressCustomdata Retrieve the custom metadata of an IP Reservation or IP Assignment + +Provides the custom metadata stored for this IP Reservation or IP Assignment in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Ip Reservation UUID + @return ApiFindIPAddressCustomdataRequest +*/ +func (a *IPAddressesApiService) FindIPAddressCustomdata(ctx context.Context, id string) ApiFindIPAddressCustomdataRequest { + return ApiFindIPAddressCustomdataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *IPAddressesApiService) FindIPAddressCustomdataExecute(r ApiFindIPAddressCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.FindIPAddressCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ips/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindIPAvailabilitiesRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string + cidr *FindIPAvailabilitiesCidrParameter +} + +// Size of subnets in bits +func (r ApiFindIPAvailabilitiesRequest) Cidr(cidr FindIPAvailabilitiesCidrParameter) ApiFindIPAvailabilitiesRequest { + r.cidr = &cidr + return r +} + +func (r ApiFindIPAvailabilitiesRequest) Execute() (*IPAvailabilitiesList, *http.Response, error) { + return r.ApiService.FindIPAvailabilitiesExecute(r) +} + +/* +FindIPAvailabilities Retrieve all available subnets of a particular reservation + +Provides a list of IP resevations for a single project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id IP Reservation UUID + @return ApiFindIPAvailabilitiesRequest +*/ +func (a *IPAddressesApiService) FindIPAvailabilities(ctx context.Context, id string) ApiFindIPAvailabilitiesRequest { + return ApiFindIPAvailabilitiesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAvailabilitiesList +func (a *IPAddressesApiService) FindIPAvailabilitiesExecute(r ApiFindIPAvailabilitiesRequest) (*IPAvailabilitiesList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAvailabilitiesList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.FindIPAvailabilities") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ips/{id}/available" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.cidr == nil { + return localVarReturnValue, nil, reportError("cidr is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "cidr", r.cidr, "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindIPReservationsRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string + types *[]FindIPReservationsTypesParameterInner + include *[]string + exclude *[]string + perPage *int32 +} + +// Filter project IP reservations by reservation type +func (r ApiFindIPReservationsRequest) Types(types []FindIPReservationsTypesParameterInner) ApiFindIPReservationsRequest { + r.types = &types + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindIPReservationsRequest) Include(include []string) ApiFindIPReservationsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindIPReservationsRequest) Exclude(exclude []string) ApiFindIPReservationsRequest { + r.exclude = &exclude + return r +} + +// Items returned per page +func (r ApiFindIPReservationsRequest) PerPage(perPage int32) ApiFindIPReservationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindIPReservationsRequest) Execute() (*IPReservationList, *http.Response, error) { + return r.ApiService.FindIPReservationsExecute(r) +} + +/* +FindIPReservations Retrieve all ip reservations + +Provides a paginated list of IP reservations for a single project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindIPReservationsRequest +*/ +func (a *IPAddressesApiService) FindIPReservations(ctx context.Context, id string) ApiFindIPReservationsRequest { + return ApiFindIPReservationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPReservationList +func (a *IPAddressesApiService) FindIPReservationsExecute(r ApiFindIPReservationsRequest) (*IPReservationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPReservationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.FindIPReservations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.types != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "types", r.types, "csv") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRequestIPReservationRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string + requestIPReservationRequest *RequestIPReservationRequest + include *[]string + exclude *[]string +} + +// IP Reservation Request to create +func (r ApiRequestIPReservationRequest) RequestIPReservationRequest(requestIPReservationRequest RequestIPReservationRequest) ApiRequestIPReservationRequest { + r.requestIPReservationRequest = &requestIPReservationRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiRequestIPReservationRequest) Include(include []string) ApiRequestIPReservationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiRequestIPReservationRequest) Exclude(exclude []string) ApiRequestIPReservationRequest { + r.exclude = &exclude + return r +} + +func (r ApiRequestIPReservationRequest) Execute() (*RequestIPReservation201Response, *http.Response, error) { + return r.ApiService.RequestIPReservationExecute(r) +} + +/* +RequestIPReservation Requesting IP reservations + +Request more IP space for a project in order to have additional IP addresses to assign to devices. If the request is within the max quota, an IP reservation will be created. If the project will exceed its IP quota, a request will be submitted for review, and will return an IP Reservation with a `state` of `pending`. You can automatically have the request fail with HTTP status 422 instead of triggering the review process by providing the `fail_on_approval_required` parameter set to `true` in the request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiRequestIPReservationRequest +*/ +func (a *IPAddressesApiService) RequestIPReservation(ctx context.Context, id string) ApiRequestIPReservationRequest { + return ApiRequestIPReservationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RequestIPReservation201Response +func (a *IPAddressesApiService) RequestIPReservationExecute(r ApiRequestIPReservationRequest) (*RequestIPReservation201Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RequestIPReservation201Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.RequestIPReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.requestIPReservationRequest == nil { + return localVarReturnValue, nil, reportError("requestIPReservationRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.requestIPReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateIPAddressRequest struct { + ctx context.Context + ApiService *IPAddressesApiService + id string + include *[]string + exclude *[]string + iPAssignmentUpdateInput *IPAssignmentUpdateInput +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateIPAddressRequest) Include(include []string) ApiUpdateIPAddressRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateIPAddressRequest) Exclude(exclude []string) ApiUpdateIPAddressRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateIPAddressRequest) IPAssignmentUpdateInput(iPAssignmentUpdateInput IPAssignmentUpdateInput) ApiUpdateIPAddressRequest { + r.iPAssignmentUpdateInput = &iPAssignmentUpdateInput + return r +} + +func (r ApiUpdateIPAddressRequest) Execute() (*FindIPAddressById200Response, *http.Response, error) { + return r.ApiService.UpdateIPAddressExecute(r) +} + +/* +UpdateIPAddress Update an ip address + +Update details about an ip address + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id IP Address UUID + @return ApiUpdateIPAddressRequest +*/ +func (a *IPAddressesApiService) UpdateIPAddress(ctx context.Context, id string) ApiUpdateIPAddressRequest { + return ApiUpdateIPAddressRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FindIPAddressById200Response +func (a *IPAddressesApiService) UpdateIPAddressExecute(r ApiUpdateIPAddressRequest) (*FindIPAddressById200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindIPAddressById200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "IPAddressesApiService.UpdateIPAddress") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ips/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.iPAssignmentUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_licenses.go b/services/metalv1/api_licenses.go new file mode 100644 index 00000000..53810137 --- /dev/null +++ b/services/metalv1/api_licenses.go @@ -0,0 +1,908 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// LicensesApiService LicensesApi service +type LicensesApiService service + +type ApiCreateLicenseRequest struct { + ctx context.Context + ApiService *LicensesApiService + id string + licenseCreateInput *LicenseCreateInput + include *[]string + exclude *[]string +} + +// License to create +func (r ApiCreateLicenseRequest) LicenseCreateInput(licenseCreateInput LicenseCreateInput) ApiCreateLicenseRequest { + r.licenseCreateInput = &licenseCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateLicenseRequest) Include(include []string) ApiCreateLicenseRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateLicenseRequest) Exclude(exclude []string) ApiCreateLicenseRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateLicenseRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.CreateLicenseExecute(r) +} + +/* +CreateLicense Create a License + +Creates a new license for the given project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateLicenseRequest +*/ +func (a *LicensesApiService) CreateLicense(ctx context.Context, id string) ApiCreateLicenseRequest { + return ApiCreateLicenseRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return License +func (a *LicensesApiService) CreateLicenseExecute(r ApiCreateLicenseRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LicensesApiService.CreateLicense") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/licenses" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.licenseCreateInput == nil { + return localVarReturnValue, nil, reportError("licenseCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.licenseCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteLicenseRequest struct { + ctx context.Context + ApiService *LicensesApiService + id string +} + +func (r ApiDeleteLicenseRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteLicenseExecute(r) +} + +/* +DeleteLicense Delete the license + +Deletes a license. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id License UUID + @return ApiDeleteLicenseRequest +*/ +func (a *LicensesApiService) DeleteLicense(ctx context.Context, id string) ApiDeleteLicenseRequest { + return ApiDeleteLicenseRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *LicensesApiService) DeleteLicenseExecute(r ApiDeleteLicenseRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LicensesApiService.DeleteLicense") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/licenses/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindLicenseByIdRequest struct { + ctx context.Context + ApiService *LicensesApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindLicenseByIdRequest) Include(include []string) ApiFindLicenseByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindLicenseByIdRequest) Exclude(exclude []string) ApiFindLicenseByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindLicenseByIdRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.FindLicenseByIdExecute(r) +} + +/* +FindLicenseById Retrieve a license + +Returns a license + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id License UUID + @return ApiFindLicenseByIdRequest +*/ +func (a *LicensesApiService) FindLicenseById(ctx context.Context, id string) ApiFindLicenseByIdRequest { + return ApiFindLicenseByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return License +func (a *LicensesApiService) FindLicenseByIdExecute(r ApiFindLicenseByIdRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LicensesApiService.FindLicenseById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/licenses/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectLicensesRequest struct { + ctx context.Context + ApiService *LicensesApiService + id string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectLicensesRequest) Include(include []string) ApiFindProjectLicensesRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectLicensesRequest) Exclude(exclude []string) ApiFindProjectLicensesRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindProjectLicensesRequest) Page(page int32) ApiFindProjectLicensesRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectLicensesRequest) PerPage(perPage int32) ApiFindProjectLicensesRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectLicensesRequest) Execute() (*LicenseList, *http.Response, error) { + return r.ApiService.FindProjectLicensesExecute(r) +} + +/* +FindProjectLicenses Retrieve all licenses + +Provides a collection of licenses for a given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectLicensesRequest +*/ +func (a *LicensesApiService) FindProjectLicenses(ctx context.Context, id string) ApiFindProjectLicensesRequest { + return ApiFindProjectLicensesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LicenseList +func (a *LicensesApiService) FindProjectLicensesExecute(r ApiFindProjectLicensesRequest) (*LicenseList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LicenseList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LicensesApiService.FindProjectLicenses") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/licenses" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateLicenseRequest struct { + ctx context.Context + ApiService *LicensesApiService + id string + licenseUpdateInput *LicenseUpdateInput + include *[]string + exclude *[]string +} + +// License to update +func (r ApiUpdateLicenseRequest) LicenseUpdateInput(licenseUpdateInput LicenseUpdateInput) ApiUpdateLicenseRequest { + r.licenseUpdateInput = &licenseUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateLicenseRequest) Include(include []string) ApiUpdateLicenseRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateLicenseRequest) Exclude(exclude []string) ApiUpdateLicenseRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateLicenseRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.UpdateLicenseExecute(r) +} + +/* +UpdateLicense Update the license + +Updates the license. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id License UUID + @return ApiUpdateLicenseRequest +*/ +func (a *LicensesApiService) UpdateLicense(ctx context.Context, id string) ApiUpdateLicenseRequest { + return ApiUpdateLicenseRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return License +func (a *LicensesApiService) UpdateLicenseExecute(r ApiUpdateLicenseRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LicensesApiService.UpdateLicense") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/licenses/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.licenseUpdateInput == nil { + return localVarReturnValue, nil, reportError("licenseUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.licenseUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_memberships.go b/services/metalv1/api_memberships.go new file mode 100644 index 00000000..0da96f4e --- /dev/null +++ b/services/metalv1/api_memberships.go @@ -0,0 +1,505 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// MembershipsApiService MembershipsApi service +type MembershipsApiService service + +type ApiDeleteMembershipRequest struct { + ctx context.Context + ApiService *MembershipsApiService + id string +} + +func (r ApiDeleteMembershipRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteMembershipExecute(r) +} + +/* +DeleteMembership Delete the membership + +Deletes the membership. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Membership UUID + @return ApiDeleteMembershipRequest +*/ +func (a *MembershipsApiService) DeleteMembership(ctx context.Context, id string) ApiDeleteMembershipRequest { + return ApiDeleteMembershipRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *MembershipsApiService) DeleteMembershipExecute(r ApiDeleteMembershipRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MembershipsApiService.DeleteMembership") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/memberships/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindMembershipByIdRequest struct { + ctx context.Context + ApiService *MembershipsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindMembershipByIdRequest) Include(include []string) ApiFindMembershipByIdRequest { + r.include = &include + return r +} + +func (r ApiFindMembershipByIdRequest) Execute() (*Membership, *http.Response, error) { + return r.ApiService.FindMembershipByIdExecute(r) +} + +/* +FindMembershipById Retrieve a membership + +Returns a single membership. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Membership UUID + @return ApiFindMembershipByIdRequest +*/ +func (a *MembershipsApiService) FindMembershipById(ctx context.Context, id string) ApiFindMembershipByIdRequest { + return ApiFindMembershipByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Membership +func (a *MembershipsApiService) FindMembershipByIdExecute(r ApiFindMembershipByIdRequest) (*Membership, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Membership + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MembershipsApiService.FindMembershipById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/memberships/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateMembershipRequest struct { + ctx context.Context + ApiService *MembershipsApiService + id string + membershipInput *MembershipInput + include *[]string +} + +// Membership to update +func (r ApiUpdateMembershipRequest) MembershipInput(membershipInput MembershipInput) ApiUpdateMembershipRequest { + r.membershipInput = &membershipInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateMembershipRequest) Include(include []string) ApiUpdateMembershipRequest { + r.include = &include + return r +} + +func (r ApiUpdateMembershipRequest) Execute() (*Membership, *http.Response, error) { + return r.ApiService.UpdateMembershipExecute(r) +} + +/* +UpdateMembership Update the membership + +Updates the membership. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Membership UUID + @return ApiUpdateMembershipRequest +*/ +func (a *MembershipsApiService) UpdateMembership(ctx context.Context, id string) ApiUpdateMembershipRequest { + return ApiUpdateMembershipRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Membership +func (a *MembershipsApiService) UpdateMembershipExecute(r ApiUpdateMembershipRequest) (*Membership, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Membership + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MembershipsApiService.UpdateMembership") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/memberships/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.membershipInput == nil { + return localVarReturnValue, nil, reportError("membershipInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.membershipInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_metal_gateways.go b/services/metalv1/api_metal_gateways.go new file mode 100644 index 00000000..dec1375c --- /dev/null +++ b/services/metalv1/api_metal_gateways.go @@ -0,0 +1,1103 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// MetalGatewaysApiService MetalGatewaysApi service +type MetalGatewaysApiService service + +type ApiCreateMetalGatewayRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + projectId string + createMetalGatewayRequest *CreateMetalGatewayRequest + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Metal Gateway to create +func (r ApiCreateMetalGatewayRequest) CreateMetalGatewayRequest(createMetalGatewayRequest CreateMetalGatewayRequest) ApiCreateMetalGatewayRequest { + r.createMetalGatewayRequest = &createMetalGatewayRequest + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateMetalGatewayRequest) Include(include []string) ApiCreateMetalGatewayRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateMetalGatewayRequest) Exclude(exclude []string) ApiCreateMetalGatewayRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiCreateMetalGatewayRequest) Page(page int32) ApiCreateMetalGatewayRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiCreateMetalGatewayRequest) PerPage(perPage int32) ApiCreateMetalGatewayRequest { + r.perPage = &perPage + return r +} + +func (r ApiCreateMetalGatewayRequest) Execute() (*FindMetalGatewayById200Response, *http.Response, error) { + return r.ApiService.CreateMetalGatewayExecute(r) +} + +/* +CreateMetalGateway Create a metal gateway + +Create a metal gateway in a project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiCreateMetalGatewayRequest +*/ +func (a *MetalGatewaysApiService) CreateMetalGateway(ctx context.Context, projectId string) ApiCreateMetalGatewayRequest { + return ApiCreateMetalGatewayRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return FindMetalGatewayById200Response +func (a *MetalGatewaysApiService) CreateMetalGatewayExecute(r ApiCreateMetalGatewayRequest) (*FindMetalGatewayById200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindMetalGatewayById200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.CreateMetalGateway") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/metal-gateways" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createMetalGatewayRequest == nil { + return localVarReturnValue, nil, reportError("createMetalGatewayRequest is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createMetalGatewayRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateMetalGatewayElasticIpRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + id string + metalGatewayElasticIpCreateInput *MetalGatewayElasticIpCreateInput + include *[]string + exclude *[]string +} + +func (r ApiCreateMetalGatewayElasticIpRequest) MetalGatewayElasticIpCreateInput(metalGatewayElasticIpCreateInput MetalGatewayElasticIpCreateInput) ApiCreateMetalGatewayElasticIpRequest { + r.metalGatewayElasticIpCreateInput = &metalGatewayElasticIpCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateMetalGatewayElasticIpRequest) Include(include []string) ApiCreateMetalGatewayElasticIpRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateMetalGatewayElasticIpRequest) Exclude(exclude []string) ApiCreateMetalGatewayElasticIpRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateMetalGatewayElasticIpRequest) Execute() (*IPAssignment, *http.Response, error) { + return r.ApiService.CreateMetalGatewayElasticIpExecute(r) +} + +/* +CreateMetalGatewayElasticIp Create a Metal Gateway Elastic IP + +Create a new Elastic IP on this Metal Gateway. + +Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. + +Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiCreateMetalGatewayElasticIpRequest +*/ +func (a *MetalGatewaysApiService) CreateMetalGatewayElasticIp(ctx context.Context, id string) ApiCreateMetalGatewayElasticIpRequest { + return ApiCreateMetalGatewayElasticIpRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAssignment +func (a *MetalGatewaysApiService) CreateMetalGatewayElasticIpExecute(r ApiCreateMetalGatewayElasticIpRequest) (*IPAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.CreateMetalGatewayElasticIp") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.metalGatewayElasticIpCreateInput == nil { + return localVarReturnValue, nil, reportError("metalGatewayElasticIpCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.metalGatewayElasticIpCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteMetalGatewayRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteMetalGatewayRequest) Include(include []string) ApiDeleteMetalGatewayRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteMetalGatewayRequest) Exclude(exclude []string) ApiDeleteMetalGatewayRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteMetalGatewayRequest) Execute() (*FindMetalGatewayById200Response, *http.Response, error) { + return r.ApiService.DeleteMetalGatewayExecute(r) +} + +/* +DeleteMetalGateway Deletes the metal gateway + +Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiDeleteMetalGatewayRequest +*/ +func (a *MetalGatewaysApiService) DeleteMetalGateway(ctx context.Context, id string) ApiDeleteMetalGatewayRequest { + return ApiDeleteMetalGatewayRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FindMetalGatewayById200Response +func (a *MetalGatewaysApiService) DeleteMetalGatewayExecute(r ApiDeleteMetalGatewayRequest) (*FindMetalGatewayById200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindMetalGatewayById200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.DeleteMetalGateway") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindMetalGatewayByIdRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindMetalGatewayByIdRequest) Include(include []string) ApiFindMetalGatewayByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindMetalGatewayByIdRequest) Exclude(exclude []string) ApiFindMetalGatewayByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindMetalGatewayByIdRequest) Execute() (*FindMetalGatewayById200Response, *http.Response, error) { + return r.ApiService.FindMetalGatewayByIdExecute(r) +} + +/* +FindMetalGatewayById Returns the metal gateway + +Returns a specific metal gateway + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiFindMetalGatewayByIdRequest +*/ +func (a *MetalGatewaysApiService) FindMetalGatewayById(ctx context.Context, id string) ApiFindMetalGatewayByIdRequest { + return ApiFindMetalGatewayByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return FindMetalGatewayById200Response +func (a *MetalGatewaysApiService) FindMetalGatewayByIdExecute(r ApiFindMetalGatewayByIdRequest) (*FindMetalGatewayById200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindMetalGatewayById200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.FindMetalGatewayById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindMetalGatewaysByProjectRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + projectId string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindMetalGatewaysByProjectRequest) Include(include []string) ApiFindMetalGatewaysByProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindMetalGatewaysByProjectRequest) Exclude(exclude []string) ApiFindMetalGatewaysByProjectRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindMetalGatewaysByProjectRequest) Page(page int32) ApiFindMetalGatewaysByProjectRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindMetalGatewaysByProjectRequest) PerPage(perPage int32) ApiFindMetalGatewaysByProjectRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindMetalGatewaysByProjectRequest) Execute() (*MetalGatewayList, *http.Response, error) { + return r.ApiService.FindMetalGatewaysByProjectExecute(r) +} + +/* +FindMetalGatewaysByProject Returns all metal gateways for a project + +Return all metal gateways for a project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiFindMetalGatewaysByProjectRequest +*/ +func (a *MetalGatewaysApiService) FindMetalGatewaysByProject(ctx context.Context, projectId string) ApiFindMetalGatewaysByProjectRequest { + return ApiFindMetalGatewaysByProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return MetalGatewayList +func (a *MetalGatewaysApiService) FindMetalGatewaysByProjectExecute(r ApiFindMetalGatewaysByProjectRequest) (*MetalGatewayList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MetalGatewayList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.FindMetalGatewaysByProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/metal-gateways" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return MetalGatewayList +func (r ApiFindMetalGatewaysByProjectRequest) ExecuteWithPagination() (*MetalGatewayList, error) { + + var items MetalGatewayList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.MetalGateways = append(items.MetalGateways, page.MetalGateways...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiGetMetalGatewayElasticIpsRequest struct { + ctx context.Context + ApiService *MetalGatewaysApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetMetalGatewayElasticIpsRequest) Include(include []string) ApiGetMetalGatewayElasticIpsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetMetalGatewayElasticIpsRequest) Exclude(exclude []string) ApiGetMetalGatewayElasticIpsRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetMetalGatewayElasticIpsRequest) Execute() (*IPAssignmentList, *http.Response, error) { + return r.ApiService.GetMetalGatewayElasticIpsExecute(r) +} + +/* +GetMetalGatewayElasticIps List Metal Gateway Elastic IPs + +Returns the list of Elastic IPs assigned to this Metal Gateway + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiGetMetalGatewayElasticIpsRequest +*/ +func (a *MetalGatewaysApiService) GetMetalGatewayElasticIps(ctx context.Context, id string) ApiGetMetalGatewayElasticIpsRequest { + return ApiGetMetalGatewayElasticIpsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return IPAssignmentList +func (a *MetalGatewaysApiService) GetMetalGatewayElasticIpsExecute(r ApiGetMetalGatewayElasticIpsRequest) (*IPAssignmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IPAssignmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetalGatewaysApiService.GetMetalGatewayElasticIps") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_metros.go b/services/metalv1/api_metros.go new file mode 100644 index 00000000..585b1867 --- /dev/null +++ b/services/metalv1/api_metros.go @@ -0,0 +1,276 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// MetrosApiService MetrosApi service +type MetrosApiService service + +type ApiFindMetrosRequest struct { + ctx context.Context + ApiService *MetrosApiService +} + +func (r ApiFindMetrosRequest) Execute() (*MetroList, *http.Response, error) { + return r.ApiService.FindMetrosExecute(r) +} + +/* +FindMetros Retrieve all metros + +Provides a listing of available metros + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindMetrosRequest +*/ +func (a *MetrosApiService) FindMetros(ctx context.Context) ApiFindMetrosRequest { + return ApiFindMetrosRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MetroList +func (a *MetrosApiService) FindMetrosExecute(r ApiFindMetrosRequest) (*MetroList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MetroList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetrosApiService.FindMetros") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/locations/metros" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetMetroRequest struct { + ctx context.Context + ApiService *MetrosApiService + id string +} + +func (r ApiGetMetroRequest) Execute() (*Metro, *http.Response, error) { + return r.ApiService.GetMetroExecute(r) +} + +/* +GetMetro Retrieve a specific Metro's details + +Show the details for a metro, including name, code, and country. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metro UUID + @return ApiGetMetroRequest +*/ +func (a *MetrosApiService) GetMetro(ctx context.Context, id string) ApiGetMetroRequest { + return ApiGetMetroRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Metro +func (a *MetrosApiService) GetMetroExecute(r ApiGetMetroRequest) (*Metro, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Metro + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetrosApiService.GetMetro") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/locations/metros/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_operating_systems.go b/services/metalv1/api_operating_systems.go new file mode 100644 index 00000000..93416f59 --- /dev/null +++ b/services/metalv1/api_operating_systems.go @@ -0,0 +1,271 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// OperatingSystemsApiService OperatingSystemsApi service +type OperatingSystemsApiService service + +type ApiFindOperatingSystemVersionRequest struct { + ctx context.Context + ApiService *OperatingSystemsApiService +} + +func (r ApiFindOperatingSystemVersionRequest) Execute() (*OperatingSystemList, *http.Response, error) { + return r.ApiService.FindOperatingSystemVersionExecute(r) +} + +/* +FindOperatingSystemVersion Retrieve all operating system versions + +Provides a listing of available operating system versions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindOperatingSystemVersionRequest +*/ +func (a *OperatingSystemsApiService) FindOperatingSystemVersion(ctx context.Context) ApiFindOperatingSystemVersionRequest { + return ApiFindOperatingSystemVersionRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OperatingSystemList +func (a *OperatingSystemsApiService) FindOperatingSystemVersionExecute(r ApiFindOperatingSystemVersionRequest) (*OperatingSystemList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperatingSystemList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatingSystemsApiService.FindOperatingSystemVersion") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/operating-system-versions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOperatingSystemsRequest struct { + ctx context.Context + ApiService *OperatingSystemsApiService +} + +func (r ApiFindOperatingSystemsRequest) Execute() (*OperatingSystemList, *http.Response, error) { + return r.ApiService.FindOperatingSystemsExecute(r) +} + +/* +FindOperatingSystems Retrieve all operating systems + +Provides a listing of available operating systems to provision your new device with. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindOperatingSystemsRequest +*/ +func (a *OperatingSystemsApiService) FindOperatingSystems(ctx context.Context) ApiFindOperatingSystemsRequest { + return ApiFindOperatingSystemsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OperatingSystemList +func (a *OperatingSystemsApiService) FindOperatingSystemsExecute(r ApiFindOperatingSystemsRequest) (*OperatingSystemList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperatingSystemList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OperatingSystemsApiService.FindOperatingSystems") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/operating-systems" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_organizations.go b/services/metalv1/api_organizations.go new file mode 100644 index 00000000..fd6a706a --- /dev/null +++ b/services/metalv1/api_organizations.go @@ -0,0 +1,2597 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// OrganizationsApiService OrganizationsApi service +type OrganizationsApiService service + +type ApiCreateOrganizationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + organizationInput *OrganizationInput + include *[]string + exclude *[]string +} + +// Organization to create +func (r ApiCreateOrganizationRequest) OrganizationInput(organizationInput OrganizationInput) ApiCreateOrganizationRequest { + r.organizationInput = &organizationInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateOrganizationRequest) Include(include []string) ApiCreateOrganizationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateOrganizationRequest) Exclude(exclude []string) ApiCreateOrganizationRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateOrganizationRequest) Execute() (*Organization, *http.Response, error) { + return r.ApiService.CreateOrganizationExecute(r) +} + +/* +CreateOrganization Create an organization + +Creates an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateOrganizationRequest +*/ +func (a *OrganizationsApiService) CreateOrganization(ctx context.Context) ApiCreateOrganizationRequest { + return ApiCreateOrganizationRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Organization +func (a *OrganizationsApiService) CreateOrganizationExecute(r ApiCreateOrganizationRequest) (*Organization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Organization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.CreateOrganization") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.organizationInput == nil { + return localVarReturnValue, nil, reportError("organizationInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.organizationInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateOrganizationInvitationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + invitationInput *InvitationInput + include *[]string +} + +// Invitation to create +func (r ApiCreateOrganizationInvitationRequest) InvitationInput(invitationInput InvitationInput) ApiCreateOrganizationInvitationRequest { + r.invitationInput = &invitationInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateOrganizationInvitationRequest) Include(include []string) ApiCreateOrganizationInvitationRequest { + r.include = &include + return r +} + +func (r ApiCreateOrganizationInvitationRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.CreateOrganizationInvitationExecute(r) +} + +/* +CreateOrganizationInvitation Create an invitation for an organization + +In order to add a user to an organization, they must first be invited. +To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiCreateOrganizationInvitationRequest +*/ +func (a *OrganizationsApiService) CreateOrganizationInvitation(ctx context.Context, id string) ApiCreateOrganizationInvitationRequest { + return ApiCreateOrganizationInvitationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *OrganizationsApiService) CreateOrganizationInvitationExecute(r ApiCreateOrganizationInvitationRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.CreateOrganizationInvitation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/invitations" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationInput == nil { + return localVarReturnValue, nil, reportError("invitationInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateOrganizationProjectRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + projectCreateInput *ProjectCreateInput + include *[]string + exclude *[]string +} + +// Project to create +func (r ApiCreateOrganizationProjectRequest) ProjectCreateInput(projectCreateInput ProjectCreateInput) ApiCreateOrganizationProjectRequest { + r.projectCreateInput = &projectCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateOrganizationProjectRequest) Include(include []string) ApiCreateOrganizationProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateOrganizationProjectRequest) Exclude(exclude []string) ApiCreateOrganizationProjectRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateOrganizationProjectRequest) Execute() (*Project, *http.Response, error) { + return r.ApiService.CreateOrganizationProjectExecute(r) +} + +/* +CreateOrganizationProject Create a project for the organization + +Creates a new project for the organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiCreateOrganizationProjectRequest +*/ +func (a *OrganizationsApiService) CreateOrganizationProject(ctx context.Context, id string) ApiCreateOrganizationProjectRequest { + return ApiCreateOrganizationProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Project +func (a *OrganizationsApiService) CreateOrganizationProjectExecute(r ApiCreateOrganizationProjectRequest) (*Project, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.CreateOrganizationProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.projectCreateInput == nil { + return localVarReturnValue, nil, reportError("projectCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.projectCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreatePaymentMethodRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + paymentMethodCreateInput *PaymentMethodCreateInput + include *[]string +} + +// Payment Method to create +func (r ApiCreatePaymentMethodRequest) PaymentMethodCreateInput(paymentMethodCreateInput PaymentMethodCreateInput) ApiCreatePaymentMethodRequest { + r.paymentMethodCreateInput = &paymentMethodCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreatePaymentMethodRequest) Include(include []string) ApiCreatePaymentMethodRequest { + r.include = &include + return r +} + +func (r ApiCreatePaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, error) { + return r.ApiService.CreatePaymentMethodExecute(r) +} + +/* +CreatePaymentMethod Create a payment method for the given organization + +Creates a payment method. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiCreatePaymentMethodRequest +*/ +func (a *OrganizationsApiService) CreatePaymentMethod(ctx context.Context, id string) ApiCreatePaymentMethodRequest { + return ApiCreatePaymentMethodRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PaymentMethod +func (a *OrganizationsApiService) CreatePaymentMethodExecute(r ApiCreatePaymentMethodRequest) (*PaymentMethod, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.CreatePaymentMethod") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/payment-methods" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.paymentMethodCreateInput == nil { + return localVarReturnValue, nil, reportError("paymentMethodCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteOrganizationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string +} + +func (r ApiDeleteOrganizationRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteOrganizationExecute(r) +} + +/* +DeleteOrganization Delete the organization + +Deletes the organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiDeleteOrganizationRequest +*/ +func (a *OrganizationsApiService) DeleteOrganization(ctx context.Context, id string) ApiDeleteOrganizationRequest { + return ApiDeleteOrganizationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *OrganizationsApiService) DeleteOrganizationExecute(r ApiDeleteOrganizationRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.DeleteOrganization") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindOperatingSystemsByOrganizationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOperatingSystemsByOrganizationRequest) Include(include []string) ApiFindOperatingSystemsByOrganizationRequest { + r.include = &include + return r +} + +func (r ApiFindOperatingSystemsByOrganizationRequest) Execute() (*OperatingSystemList, *http.Response, error) { + return r.ApiService.FindOperatingSystemsByOrganizationExecute(r) +} + +/* +FindOperatingSystemsByOrganization Retrieve all operating systems visible by the organization + +Returns a listing of available operating systems for the given organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOperatingSystemsByOrganizationRequest +*/ +func (a *OrganizationsApiService) FindOperatingSystemsByOrganization(ctx context.Context, id string) ApiFindOperatingSystemsByOrganizationRequest { + return ApiFindOperatingSystemsByOrganizationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return OperatingSystemList +func (a *OrganizationsApiService) FindOperatingSystemsByOrganizationExecute(r ApiFindOperatingSystemsByOrganizationRequest) (*OperatingSystemList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OperatingSystemList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOperatingSystemsByOrganization") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/operating-systems" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationByIdRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationByIdRequest) Include(include []string) ApiFindOrganizationByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindOrganizationByIdRequest) Exclude(exclude []string) ApiFindOrganizationByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindOrganizationByIdRequest) Execute() (*Organization, *http.Response, error) { + return r.ApiService.FindOrganizationByIdExecute(r) +} + +/* +FindOrganizationById Retrieve an organization's details + +Returns a single organization's details, if the user is authorized to view it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationByIdRequest +*/ +func (a *OrganizationsApiService) FindOrganizationById(ctx context.Context, id string) ApiFindOrganizationByIdRequest { + return ApiFindOrganizationByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Organization +func (a *OrganizationsApiService) FindOrganizationByIdExecute(r ApiFindOrganizationByIdRequest) (*Organization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Organization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationCustomdataRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string +} + +func (r ApiFindOrganizationCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindOrganizationCustomdataExecute(r) +} + +/* +FindOrganizationCustomdata Retrieve the custom metadata of an organization + +Provides the custom metadata stored for this organization in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationCustomdataRequest +*/ +func (a *OrganizationsApiService) FindOrganizationCustomdata(ctx context.Context, id string) ApiFindOrganizationCustomdataRequest { + return ApiFindOrganizationCustomdataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *OrganizationsApiService) FindOrganizationCustomdataExecute(r ApiFindOrganizationCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindOrganizationInvitationsRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationInvitationsRequest) Include(include []string) ApiFindOrganizationInvitationsRequest { + r.include = &include + return r +} + +// Page to return +func (r ApiFindOrganizationInvitationsRequest) Page(page int32) ApiFindOrganizationInvitationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationInvitationsRequest) PerPage(perPage int32) ApiFindOrganizationInvitationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationInvitationsRequest) Execute() (*InvitationList, *http.Response, error) { + return r.ApiService.FindOrganizationInvitationsExecute(r) +} + +/* +FindOrganizationInvitations Retrieve organization invitations + +Returns all invitations in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationInvitationsRequest +*/ +func (a *OrganizationsApiService) FindOrganizationInvitations(ctx context.Context, id string) ApiFindOrganizationInvitationsRequest { + return ApiFindOrganizationInvitationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InvitationList +func (a *OrganizationsApiService) FindOrganizationInvitationsExecute(r ApiFindOrganizationInvitationsRequest) (*InvitationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationInvitations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/invitations" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationPaymentMethodsRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationPaymentMethodsRequest) Include(include []string) ApiFindOrganizationPaymentMethodsRequest { + r.include = &include + return r +} + +// Page to return +func (r ApiFindOrganizationPaymentMethodsRequest) Page(page int32) ApiFindOrganizationPaymentMethodsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationPaymentMethodsRequest) PerPage(perPage int32) ApiFindOrganizationPaymentMethodsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationPaymentMethodsRequest) Execute() (*PaymentMethodList, *http.Response, error) { + return r.ApiService.FindOrganizationPaymentMethodsExecute(r) +} + +/* +FindOrganizationPaymentMethods Retrieve all payment methods of an organization + +Returns all payment methods of an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationPaymentMethodsRequest +*/ +func (a *OrganizationsApiService) FindOrganizationPaymentMethods(ctx context.Context, id string) ApiFindOrganizationPaymentMethodsRequest { + return ApiFindOrganizationPaymentMethodsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PaymentMethodList +func (a *OrganizationsApiService) FindOrganizationPaymentMethodsExecute(r ApiFindOrganizationPaymentMethodsRequest) (*PaymentMethodList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaymentMethodList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationPaymentMethods") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/payment-methods" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationProjectsRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + name *string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Filter results by name. +func (r ApiFindOrganizationProjectsRequest) Name(name string) ApiFindOrganizationProjectsRequest { + r.name = &name + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationProjectsRequest) Include(include []string) ApiFindOrganizationProjectsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindOrganizationProjectsRequest) Exclude(exclude []string) ApiFindOrganizationProjectsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindOrganizationProjectsRequest) Page(page int32) ApiFindOrganizationProjectsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationProjectsRequest) PerPage(perPage int32) ApiFindOrganizationProjectsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationProjectsRequest) Execute() (*ProjectList, *http.Response, error) { + return r.ApiService.FindOrganizationProjectsExecute(r) +} + +/* +FindOrganizationProjects Retrieve all projects of an organization + +Returns a collection of projects that belong to the organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationProjectsRequest +*/ +func (a *OrganizationsApiService) FindOrganizationProjects(ctx context.Context, id string) ApiFindOrganizationProjectsRequest { + return ApiFindOrganizationProjectsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProjectList +func (a *OrganizationsApiService) FindOrganizationProjectsExecute(r ApiFindOrganizationProjectsRequest) (*ProjectList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationProjects") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return ProjectList +func (r ApiFindOrganizationProjectsRequest) ExecuteWithPagination() (*ProjectList, error) { + + var items ProjectList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Projects = append(items.Projects, page.Projects...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindOrganizationTransfersRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationTransfersRequest) Include(include []string) ApiFindOrganizationTransfersRequest { + r.include = &include + return r +} + +func (r ApiFindOrganizationTransfersRequest) Execute() (*TransferRequestList, *http.Response, error) { + return r.ApiService.FindOrganizationTransfersExecute(r) +} + +/* +FindOrganizationTransfers Retrieve all project transfer requests from or to an organization + +Provides a collection of project transfer requests from or to the organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindOrganizationTransfersRequest +*/ +func (a *OrganizationsApiService) FindOrganizationTransfers(ctx context.Context, id string) ApiFindOrganizationTransfersRequest { + return ApiFindOrganizationTransfersRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TransferRequestList +func (a *OrganizationsApiService) FindOrganizationTransfersExecute(r ApiFindOrganizationTransfersRequest) (*TransferRequestList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransferRequestList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizationTransfers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/transfers" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindOrganizationsRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + personal *FindOrganizationsPersonalParameter + withoutProjects *FindOrganizationsPersonalParameter + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Include, exclude or show only personal organizations. +func (r ApiFindOrganizationsRequest) Personal(personal FindOrganizationsPersonalParameter) ApiFindOrganizationsRequest { + r.personal = &personal + return r +} + +// Include, exclude or show only organizations that have no projects. +func (r ApiFindOrganizationsRequest) WithoutProjects(withoutProjects FindOrganizationsPersonalParameter) ApiFindOrganizationsRequest { + r.withoutProjects = &withoutProjects + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindOrganizationsRequest) Include(include []string) ApiFindOrganizationsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindOrganizationsRequest) Exclude(exclude []string) ApiFindOrganizationsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindOrganizationsRequest) Page(page int32) ApiFindOrganizationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindOrganizationsRequest) PerPage(perPage int32) ApiFindOrganizationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindOrganizationsRequest) Execute() (*OrganizationList, *http.Response, error) { + return r.ApiService.FindOrganizationsExecute(r) +} + +/* +FindOrganizations Retrieve all organizations + +Returns a list of organizations that are accessible to the current user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindOrganizationsRequest +*/ +func (a *OrganizationsApiService) FindOrganizations(ctx context.Context) ApiFindOrganizationsRequest { + return ApiFindOrganizationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OrganizationList +func (a *OrganizationsApiService) FindOrganizationsExecute(r ApiFindOrganizationsRequest) (*OrganizationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OrganizationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindOrganizations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.personal != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "personal", r.personal, "") + } + if r.withoutProjects != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "without_projects", r.withoutProjects, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return OrganizationList +func (r ApiFindOrganizationsRequest) ExecuteWithPagination() (*OrganizationList, error) { + + var items OrganizationList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Organizations = append(items.Organizations, page.Organizations...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiFindPlansByOrganizationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPlansByOrganizationRequest) Include(include []string) ApiFindPlansByOrganizationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindPlansByOrganizationRequest) Exclude(exclude []string) ApiFindPlansByOrganizationRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindPlansByOrganizationRequest) Execute() (*PlanList, *http.Response, error) { + return r.ApiService.FindPlansByOrganizationExecute(r) +} + +/* +FindPlansByOrganization Retrieve all plans visible by the organization + +Returns a listing of available plans for the given organization + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiFindPlansByOrganizationRequest +*/ +func (a *OrganizationsApiService) FindPlansByOrganization(ctx context.Context, id string) ApiFindPlansByOrganizationRequest { + return ApiFindPlansByOrganizationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PlanList +func (a *OrganizationsApiService) FindPlansByOrganizationExecute(r ApiFindPlansByOrganizationRequest) (*PlanList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlanList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.FindPlansByOrganization") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}/plans" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateOrganizationRequest struct { + ctx context.Context + ApiService *OrganizationsApiService + id string + organizationInput *OrganizationInput + include *[]string + exclude *[]string +} + +// Organization to update +func (r ApiUpdateOrganizationRequest) OrganizationInput(organizationInput OrganizationInput) ApiUpdateOrganizationRequest { + r.organizationInput = &organizationInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateOrganizationRequest) Include(include []string) ApiUpdateOrganizationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateOrganizationRequest) Exclude(exclude []string) ApiUpdateOrganizationRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateOrganizationRequest) Execute() (*Organization, *http.Response, error) { + return r.ApiService.UpdateOrganizationExecute(r) +} + +/* +UpdateOrganization Update the organization + +Updates the organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Organization UUID + @return ApiUpdateOrganizationRequest +*/ +func (a *OrganizationsApiService) UpdateOrganization(ctx context.Context, id string) ApiUpdateOrganizationRequest { + return ApiUpdateOrganizationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Organization +func (a *OrganizationsApiService) UpdateOrganizationExecute(r ApiUpdateOrganizationRequest) (*Organization, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Organization + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OrganizationsApiService.UpdateOrganization") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.organizationInput == nil { + return localVarReturnValue, nil, reportError("organizationInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.organizationInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_otps.go b/services/metalv1/api_otps.go new file mode 100644 index 00000000..d0456492 --- /dev/null +++ b/services/metalv1/api_otps.go @@ -0,0 +1,588 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// OTPsApiService OTPsApi service +type OTPsApiService service + +type ApiFindEnsureOtpRequest struct { + ctx context.Context + ApiService *OTPsApiService + otp string +} + +func (r ApiFindEnsureOtpRequest) Execute() (*http.Response, error) { + return r.ApiService.FindEnsureOtpExecute(r) +} + +/* +FindEnsureOtp Verify user by providing an OTP + +It verifies the user once a valid OTP is provided. It gives back a session token, essentially logging in the user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param otp OTP + @return ApiFindEnsureOtpRequest +*/ +func (a *OTPsApiService) FindEnsureOtp(ctx context.Context, otp string) ApiFindEnsureOtpRequest { + return ApiFindEnsureOtpRequest{ + ApiService: a, + ctx: ctx, + otp: otp, + } +} + +// Execute executes the request +func (a *OTPsApiService) FindEnsureOtpExecute(r ApiFindEnsureOtpRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OTPsApiService.FindEnsureOtp") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/verify/{otp}" + localVarPath = strings.Replace(localVarPath, "{"+"otp"+"}", url.PathEscape(parameterValueToString(r.otp, "otp")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindRecoveryCodesRequest struct { + ctx context.Context + ApiService *OTPsApiService +} + +func (r ApiFindRecoveryCodesRequest) Execute() (*RecoveryCodeList, *http.Response, error) { + return r.ApiService.FindRecoveryCodesExecute(r) +} + +/* +FindRecoveryCodes Retrieve my recovery codes + +Returns my recovery codes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindRecoveryCodesRequest +*/ +func (a *OTPsApiService) FindRecoveryCodes(ctx context.Context) ApiFindRecoveryCodesRequest { + return ApiFindRecoveryCodesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RecoveryCodeList +func (a *OTPsApiService) FindRecoveryCodesExecute(r ApiFindRecoveryCodesRequest) (*RecoveryCodeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RecoveryCodeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OTPsApiService.FindRecoveryCodes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/recovery-codes" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiReceiveCodesRequest struct { + ctx context.Context + ApiService *OTPsApiService +} + +func (r ApiReceiveCodesRequest) Execute() (*http.Response, error) { + return r.ApiService.ReceiveCodesExecute(r) +} + +/* +ReceiveCodes Receive an OTP per sms + +Sends an OTP to the user's mobile phone. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiReceiveCodesRequest +*/ +func (a *OTPsApiService) ReceiveCodes(ctx context.Context) ApiReceiveCodesRequest { + return ApiReceiveCodesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *OTPsApiService) ReceiveCodesExecute(r ApiReceiveCodesRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OTPsApiService.ReceiveCodes") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/sms/receive" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRegenerateCodesRequest struct { + ctx context.Context + ApiService *OTPsApiService +} + +func (r ApiRegenerateCodesRequest) Execute() (*RecoveryCodeList, *http.Response, error) { + return r.ApiService.RegenerateCodesExecute(r) +} + +/* +RegenerateCodes Generate new recovery codes + +Generate a new set of recovery codes. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRegenerateCodesRequest +*/ +func (a *OTPsApiService) RegenerateCodes(ctx context.Context) ApiRegenerateCodesRequest { + return ApiRegenerateCodesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RecoveryCodeList +func (a *OTPsApiService) RegenerateCodesExecute(r ApiRegenerateCodesRequest) (*RecoveryCodeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RecoveryCodeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OTPsApiService.RegenerateCodes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/recovery-codes" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_password_reset_tokens.go b/services/metalv1/api_password_reset_tokens.go new file mode 100644 index 00000000..07cec9b3 --- /dev/null +++ b/services/metalv1/api_password_reset_tokens.go @@ -0,0 +1,292 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// PasswordResetTokensApiService PasswordResetTokensApi service +type PasswordResetTokensApiService service + +type ApiCreatePasswordResetTokenRequest struct { + ctx context.Context + ApiService *PasswordResetTokensApiService + email *string +} + +// Email of user to create password reset token +func (r ApiCreatePasswordResetTokenRequest) Email(email string) ApiCreatePasswordResetTokenRequest { + r.email = &email + return r +} + +func (r ApiCreatePasswordResetTokenRequest) Execute() (*http.Response, error) { + return r.ApiService.CreatePasswordResetTokenExecute(r) +} + +/* +CreatePasswordResetToken Create a password reset token + +Creates a password reset token + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePasswordResetTokenRequest +*/ +func (a *PasswordResetTokensApiService) CreatePasswordResetToken(ctx context.Context) ApiCreatePasswordResetTokenRequest { + return ApiCreatePasswordResetTokenRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *PasswordResetTokensApiService) CreatePasswordResetTokenExecute(r ApiCreatePasswordResetTokenRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PasswordResetTokensApiService.CreatePasswordResetToken") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/reset-password" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.email == nil { + return nil, reportError("email is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "email", r.email, "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiResetPasswordRequest struct { + ctx context.Context + ApiService *PasswordResetTokensApiService +} + +func (r ApiResetPasswordRequest) Execute() (*NewPassword, *http.Response, error) { + return r.ApiService.ResetPasswordExecute(r) +} + +/* +ResetPassword Reset current user password + +Resets current user password. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiResetPasswordRequest +*/ +func (a *PasswordResetTokensApiService) ResetPassword(ctx context.Context) ApiResetPasswordRequest { + return ApiResetPasswordRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return NewPassword +func (a *PasswordResetTokensApiService) ResetPasswordExecute(r ApiResetPasswordRequest) (*NewPassword, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NewPassword + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PasswordResetTokensApiService.ResetPassword") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/reset-password" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_payment_methods.go b/services/metalv1/api_payment_methods.go new file mode 100644 index 00000000..33bffa36 --- /dev/null +++ b/services/metalv1/api_payment_methods.go @@ -0,0 +1,472 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// PaymentMethodsApiService PaymentMethodsApi service +type PaymentMethodsApiService service + +type ApiDeletePaymentMethodRequest struct { + ctx context.Context + ApiService *PaymentMethodsApiService + id string +} + +func (r ApiDeletePaymentMethodRequest) Execute() (*http.Response, error) { + return r.ApiService.DeletePaymentMethodExecute(r) +} + +/* +DeletePaymentMethod Delete the payment method + +Deletes the payment method. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payment Method UUID + @return ApiDeletePaymentMethodRequest +*/ +func (a *PaymentMethodsApiService) DeletePaymentMethod(ctx context.Context, id string) ApiDeletePaymentMethodRequest { + return ApiDeletePaymentMethodRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *PaymentMethodsApiService) DeletePaymentMethodExecute(r ApiDeletePaymentMethodRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PaymentMethodsApiService.DeletePaymentMethod") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/payment-methods/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindPaymentMethodByIdRequest struct { + ctx context.Context + ApiService *PaymentMethodsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPaymentMethodByIdRequest) Include(include []string) ApiFindPaymentMethodByIdRequest { + r.include = &include + return r +} + +func (r ApiFindPaymentMethodByIdRequest) Execute() (*PaymentMethod, *http.Response, error) { + return r.ApiService.FindPaymentMethodByIdExecute(r) +} + +/* +FindPaymentMethodById Retrieve a payment method + +Returns a payment method + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payment Method UUID + @return ApiFindPaymentMethodByIdRequest +*/ +func (a *PaymentMethodsApiService) FindPaymentMethodById(ctx context.Context, id string) ApiFindPaymentMethodByIdRequest { + return ApiFindPaymentMethodByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PaymentMethod +func (a *PaymentMethodsApiService) FindPaymentMethodByIdExecute(r ApiFindPaymentMethodByIdRequest) (*PaymentMethod, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PaymentMethodsApiService.FindPaymentMethodById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/payment-methods/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdatePaymentMethodRequest struct { + ctx context.Context + ApiService *PaymentMethodsApiService + id string + paymentMethodUpdateInput *PaymentMethodUpdateInput + include *[]string +} + +// Payment Method to update +func (r ApiUpdatePaymentMethodRequest) PaymentMethodUpdateInput(paymentMethodUpdateInput PaymentMethodUpdateInput) ApiUpdatePaymentMethodRequest { + r.paymentMethodUpdateInput = &paymentMethodUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdatePaymentMethodRequest) Include(include []string) ApiUpdatePaymentMethodRequest { + r.include = &include + return r +} + +func (r ApiUpdatePaymentMethodRequest) Execute() (*PaymentMethod, *http.Response, error) { + return r.ApiService.UpdatePaymentMethodExecute(r) +} + +/* +UpdatePaymentMethod Update the payment method + +Updates the payment method. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Payment Method UUID + @return ApiUpdatePaymentMethodRequest +*/ +func (a *PaymentMethodsApiService) UpdatePaymentMethod(ctx context.Context, id string) ApiUpdatePaymentMethodRequest { + return ApiUpdatePaymentMethodRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PaymentMethod +func (a *PaymentMethodsApiService) UpdatePaymentMethodExecute(r ApiUpdatePaymentMethodRequest) (*PaymentMethod, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaymentMethod + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PaymentMethodsApiService.UpdatePaymentMethod") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/payment-methods/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.paymentMethodUpdateInput == nil { + return localVarReturnValue, nil, reportError("paymentMethodUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.paymentMethodUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_plans.go b/services/metalv1/api_plans.go new file mode 100644 index 00000000..3f8081e9 --- /dev/null +++ b/services/metalv1/api_plans.go @@ -0,0 +1,368 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// PlansApiService PlansApi service +type PlansApiService service + +type ApiFindPlansRequest struct { + ctx context.Context + ApiService *PlansApiService + categories *[]FindOrganizationDevicesCategoriesParameterInner + type_ *FindPlansTypeParameter + slug *string + include *[]string + exclude *[]string +} + +// Filter plans by its category +func (r ApiFindPlansRequest) Categories(categories []FindOrganizationDevicesCategoriesParameterInner) ApiFindPlansRequest { + r.categories = &categories + return r +} + +// Filter plans by its plan type +func (r ApiFindPlansRequest) Type_(type_ FindPlansTypeParameter) ApiFindPlansRequest { + r.type_ = &type_ + return r +} + +// Filter plans by slug +func (r ApiFindPlansRequest) Slug(slug string) ApiFindPlansRequest { + r.slug = &slug + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPlansRequest) Include(include []string) ApiFindPlansRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindPlansRequest) Exclude(exclude []string) ApiFindPlansRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindPlansRequest) Execute() (*PlanList, *http.Response, error) { + return r.ApiService.FindPlansExecute(r) +} + +/* +FindPlans Retrieve all plans + +Provides a listing of available plans to provision your device on. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindPlansRequest +*/ +func (a *PlansApiService) FindPlans(ctx context.Context) ApiFindPlansRequest { + return ApiFindPlansRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PlanList +func (a *PlansApiService) FindPlansExecute(r ApiFindPlansRequest) (*PlanList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlanList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PlansApiService.FindPlans") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/plans" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.categories != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "categories", r.categories, "csv") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPlansByProjectRequest struct { + ctx context.Context + ApiService *PlansApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPlansByProjectRequest) Include(include []string) ApiFindPlansByProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindPlansByProjectRequest) Exclude(exclude []string) ApiFindPlansByProjectRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindPlansByProjectRequest) Execute() (*PlanList, *http.Response, error) { + return r.ApiService.FindPlansByProjectExecute(r) +} + +/* +FindPlansByProject Retrieve all plans visible by the project + +Returns a listing of available plans for the given project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindPlansByProjectRequest +*/ +func (a *PlansApiService) FindPlansByProject(ctx context.Context, id string) ApiFindPlansByProjectRequest { + return ApiFindPlansByProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PlanList +func (a *PlansApiService) FindPlansByProjectExecute(r ApiFindPlansByProjectRequest) (*PlanList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlanList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PlansApiService.FindPlansByProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/plans" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_ports.go b/services/metalv1/api_ports.go new file mode 100644 index 00000000..236e3df4 --- /dev/null +++ b/services/metalv1/api_ports.go @@ -0,0 +1,2416 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// PortsApiService PortsApi service +type PortsApiService service + +type ApiAssignNativeVlanRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + vnid *string + include *[]string +} + +// Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). +func (r ApiAssignNativeVlanRequest) Vnid(vnid string) ApiAssignNativeVlanRequest { + r.vnid = &vnid + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiAssignNativeVlanRequest) Include(include []string) ApiAssignNativeVlanRequest { + r.include = &include + return r +} + +func (r ApiAssignNativeVlanRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.AssignNativeVlanExecute(r) +} + +/* +AssignNativeVlan Assign a native VLAN + +Sets a virtual network on this port as a "native VLAN". The VLAN must have already been assigned using the using the "Assign a port to a virtual network" operation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiAssignNativeVlanRequest +*/ +func (a *PortsApiService) AssignNativeVlan(ctx context.Context, id string) ApiAssignNativeVlanRequest { + return ApiAssignNativeVlanRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) AssignNativeVlanExecute(r ApiAssignNativeVlanRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.AssignNativeVlan") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/native-vlan" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vnid == nil { + return localVarReturnValue, nil, reportError("vnid is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "vnid", r.vnid, "") + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAssignPortRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + portAssignInput *PortAssignInput + include *[]string +} + +// Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). +func (r ApiAssignPortRequest) PortAssignInput(portAssignInput PortAssignInput) ApiAssignPortRequest { + r.portAssignInput = &portAssignInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiAssignPortRequest) Include(include []string) ApiAssignPortRequest { + r.include = &include + return r +} + +func (r ApiAssignPortRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.AssignPortExecute(r) +} + +/* +AssignPort Assign a port to virtual network + +Assign a hardware port to a virtual network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiAssignPortRequest +*/ +func (a *PortsApiService) AssignPort(ctx context.Context, id string) ApiAssignPortRequest { + return ApiAssignPortRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) AssignPortExecute(r ApiAssignPortRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.AssignPort") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/assign" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.portAssignInput == nil { + return localVarReturnValue, nil, reportError("portAssignInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.portAssignInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiBondPortRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + bulkEnable *bool + include *[]string +} + +// enable both ports +func (r ApiBondPortRequest) BulkEnable(bulkEnable bool) ApiBondPortRequest { + r.bulkEnable = &bulkEnable + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiBondPortRequest) Include(include []string) ApiBondPortRequest { + r.include = &include + return r +} + +func (r ApiBondPortRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.BondPortExecute(r) +} + +/* +BondPort Enabling bonding + +Enabling bonding for one or all ports + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiBondPortRequest +*/ +func (a *PortsApiService) BondPort(ctx context.Context, id string) ApiBondPortRequest { + return ApiBondPortRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) BondPortExecute(r ApiBondPortRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.BondPort") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/bond" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bulkEnable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bulk_enable", r.bulkEnable, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiConvertLayer2Request struct { + ctx context.Context + ApiService *PortsApiService + id string + portAssignInput *PortAssignInput + include *[]string +} + +// Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). +func (r ApiConvertLayer2Request) PortAssignInput(portAssignInput PortAssignInput) ApiConvertLayer2Request { + r.portAssignInput = &portAssignInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiConvertLayer2Request) Include(include []string) ApiConvertLayer2Request { + r.include = &include + return r +} + +func (r ApiConvertLayer2Request) Execute() (*Port, *http.Response, error) { + return r.ApiService.ConvertLayer2Execute(r) +} + +/* +ConvertLayer2 Convert to Layer 2 + +Converts a bond port to Layer 2. IP assignments of the port will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiConvertLayer2Request +*/ +func (a *PortsApiService) ConvertLayer2(ctx context.Context, id string) ApiConvertLayer2Request { + return ApiConvertLayer2Request{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) ConvertLayer2Execute(r ApiConvertLayer2Request) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.ConvertLayer2") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/convert/layer-2" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.portAssignInput == nil { + return localVarReturnValue, nil, reportError("portAssignInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.portAssignInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiConvertLayer3Request struct { + ctx context.Context + ApiService *PortsApiService + id string + include *[]string + portConvertLayer3Input *PortConvertLayer3Input +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiConvertLayer3Request) Include(include []string) ApiConvertLayer3Request { + r.include = &include + return r +} + +// IPs to request +func (r ApiConvertLayer3Request) PortConvertLayer3Input(portConvertLayer3Input PortConvertLayer3Input) ApiConvertLayer3Request { + r.portConvertLayer3Input = &portConvertLayer3Input + return r +} + +func (r ApiConvertLayer3Request) Execute() (*Port, *http.Response, error) { + return r.ApiService.ConvertLayer3Execute(r) +} + +/* +ConvertLayer3 Convert to Layer 3 + +Converts a bond port to Layer 3. VLANs must first be unassigned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiConvertLayer3Request +*/ +func (a *PortsApiService) ConvertLayer3(ctx context.Context, id string) ApiConvertLayer3Request { + return ApiConvertLayer3Request{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) ConvertLayer3Execute(r ApiConvertLayer3Request) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.ConvertLayer3") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/convert/layer-3" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.portConvertLayer3Input + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreatePortVlanAssignmentBatchRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + portVlanAssignmentBatchCreateInput *PortVlanAssignmentBatchCreateInput + include *[]string +} + +// VLAN Assignment batch details +func (r ApiCreatePortVlanAssignmentBatchRequest) PortVlanAssignmentBatchCreateInput(portVlanAssignmentBatchCreateInput PortVlanAssignmentBatchCreateInput) ApiCreatePortVlanAssignmentBatchRequest { + r.portVlanAssignmentBatchCreateInput = &portVlanAssignmentBatchCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreatePortVlanAssignmentBatchRequest) Include(include []string) ApiCreatePortVlanAssignmentBatchRequest { + r.include = &include + return r +} + +func (r ApiCreatePortVlanAssignmentBatchRequest) Execute() (*PortVlanAssignmentBatch, *http.Response, error) { + return r.ApiService.CreatePortVlanAssignmentBatchExecute(r) +} + +/* +CreatePortVlanAssignmentBatch Create a new Port-VLAN Assignment management batch + +Create a new asynchronous batch request which handles adding and/or removing the VLANs to which the port is assigned. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiCreatePortVlanAssignmentBatchRequest +*/ +func (a *PortsApiService) CreatePortVlanAssignmentBatch(ctx context.Context, id string) ApiCreatePortVlanAssignmentBatchRequest { + return ApiCreatePortVlanAssignmentBatchRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PortVlanAssignmentBatch +func (a *PortsApiService) CreatePortVlanAssignmentBatchExecute(r ApiCreatePortVlanAssignmentBatchRequest) (*PortVlanAssignmentBatch, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PortVlanAssignmentBatch + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.CreatePortVlanAssignmentBatch") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/vlan-assignments/batches" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.portVlanAssignmentBatchCreateInput == nil { + return localVarReturnValue, nil, reportError("portVlanAssignmentBatchCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.portVlanAssignmentBatchCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteNativeVlanRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteNativeVlanRequest) Include(include []string) ApiDeleteNativeVlanRequest { + r.include = &include + return r +} + +func (r ApiDeleteNativeVlanRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.DeleteNativeVlanExecute(r) +} + +/* +DeleteNativeVlan Remove native VLAN + +Removes the native VLAN from this port + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiDeleteNativeVlanRequest +*/ +func (a *PortsApiService) DeleteNativeVlan(ctx context.Context, id string) ApiDeleteNativeVlanRequest { + return ApiDeleteNativeVlanRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) DeleteNativeVlanExecute(r ApiDeleteNativeVlanRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.DeleteNativeVlan") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/native-vlan" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDisbondPortRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + bulkDisable *bool + include *[]string +} + +// disable both ports +func (r ApiDisbondPortRequest) BulkDisable(bulkDisable bool) ApiDisbondPortRequest { + r.bulkDisable = &bulkDisable + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDisbondPortRequest) Include(include []string) ApiDisbondPortRequest { + r.include = &include + return r +} + +func (r ApiDisbondPortRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.DisbondPortExecute(r) +} + +/* +DisbondPort Disabling bonding + +Disabling bonding for one or all ports + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiDisbondPortRequest +*/ +func (a *PortsApiService) DisbondPort(ctx context.Context, id string) ApiDisbondPortRequest { + return ApiDisbondPortRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) DisbondPortExecute(r ApiDisbondPortRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.DisbondPort") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/disbond" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bulkDisable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bulk_disable", r.bulkDisable, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPortByIdRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPortByIdRequest) Include(include []string) ApiFindPortByIdRequest { + r.include = &include + return r +} + +func (r ApiFindPortByIdRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.FindPortByIdExecute(r) +} + +/* +FindPortById Retrieve a port + +Returns a port + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiFindPortByIdRequest +*/ +func (a *PortsApiService) FindPortById(ctx context.Context, id string) ApiFindPortByIdRequest { + return ApiFindPortByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) FindPortByIdExecute(r ApiFindPortByIdRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.FindPortById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + batchId string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest) Include(include []string) ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest { + r.include = &include + return r +} + +func (r ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest) Execute() (*PortVlanAssignmentBatch, *http.Response, error) { + return r.ApiService.FindPortVlanAssignmentBatchByPortIdAndBatchIdExecute(r) +} + +/* +FindPortVlanAssignmentBatchByPortIdAndBatchId Retrieve a VLAN Assignment Batch's details + +Returns the details of an existing Port-VLAN Assignment batch, including the list of VLANs to assign or unassign, and the current state of the batch. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @param batchId Batch ID + @return ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest +*/ +func (a *PortsApiService) FindPortVlanAssignmentBatchByPortIdAndBatchId(ctx context.Context, id string, batchId string) ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest { + return ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + batchId: batchId, + } +} + +// Execute executes the request +// +// @return PortVlanAssignmentBatch +func (a *PortsApiService) FindPortVlanAssignmentBatchByPortIdAndBatchIdExecute(r ApiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest) (*PortVlanAssignmentBatch, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PortVlanAssignmentBatch + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.FindPortVlanAssignmentBatchByPortIdAndBatchId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/vlan-assignments/batches/{batch_id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"batch_id"+"}", url.PathEscape(parameterValueToString(r.batchId, "batchId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPortVlanAssignmentBatchesRequest struct { + ctx context.Context + ApiService *PortsApiService + id string +} + +func (r ApiFindPortVlanAssignmentBatchesRequest) Execute() (*PortVlanAssignmentBatchList, *http.Response, error) { + return r.ApiService.FindPortVlanAssignmentBatchesExecute(r) +} + +/* +FindPortVlanAssignmentBatches List the VLAN Assignment Batches for a port + +Show all the VLAN assignment batches that have been created for managing this port's VLAN assignments + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiFindPortVlanAssignmentBatchesRequest +*/ +func (a *PortsApiService) FindPortVlanAssignmentBatches(ctx context.Context, id string) ApiFindPortVlanAssignmentBatchesRequest { + return ApiFindPortVlanAssignmentBatchesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PortVlanAssignmentBatchList +func (a *PortsApiService) FindPortVlanAssignmentBatchesExecute(r ApiFindPortVlanAssignmentBatchesRequest) (*PortVlanAssignmentBatchList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PortVlanAssignmentBatchList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.FindPortVlanAssignmentBatches") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/vlan-assignments/batches" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + assignmentId string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest) Include(include []string) ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest { + r.include = &include + return r +} + +func (r ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest) Execute() (*PortVlanAssignment, *http.Response, error) { + return r.ApiService.FindPortVlanAssignmentByPortIdAndAssignmentIdExecute(r) +} + +/* +FindPortVlanAssignmentByPortIdAndAssignmentId Show a particular Port VLAN assignment's details + +Show the details of a specific Port-VLAN assignment, including the current state and if the VLAN is set as native. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @param assignmentId Assignment ID + @return ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest +*/ +func (a *PortsApiService) FindPortVlanAssignmentByPortIdAndAssignmentId(ctx context.Context, id string, assignmentId string) ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest { + return ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + assignmentId: assignmentId, + } +} + +// Execute executes the request +// +// @return PortVlanAssignment +func (a *PortsApiService) FindPortVlanAssignmentByPortIdAndAssignmentIdExecute(r ApiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest) (*PortVlanAssignment, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PortVlanAssignment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.FindPortVlanAssignmentByPortIdAndAssignmentId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/vlan-assignments/{assignment_id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"assignment_id"+"}", url.PathEscape(parameterValueToString(r.assignmentId, "assignmentId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindPortVlanAssignmentsRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindPortVlanAssignmentsRequest) Include(include []string) ApiFindPortVlanAssignmentsRequest { + r.include = &include + return r +} + +func (r ApiFindPortVlanAssignmentsRequest) Execute() (*PortVlanAssignmentList, *http.Response, error) { + return r.ApiService.FindPortVlanAssignmentsExecute(r) +} + +/* +FindPortVlanAssignments List Current VLAN assignments for a port + +Show the port's current VLAN assignments, including if this VLAN is set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiFindPortVlanAssignmentsRequest +*/ +func (a *PortsApiService) FindPortVlanAssignments(ctx context.Context, id string) ApiFindPortVlanAssignmentsRequest { + return ApiFindPortVlanAssignmentsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PortVlanAssignmentList +func (a *PortsApiService) FindPortVlanAssignmentsExecute(r ApiFindPortVlanAssignmentsRequest) (*PortVlanAssignmentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PortVlanAssignmentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.FindPortVlanAssignments") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/vlan-assignments" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUnassignPortRequest struct { + ctx context.Context + ApiService *PortsApiService + id string + portAssignInput *PortAssignInput + include *[]string +} + +// Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). +func (r ApiUnassignPortRequest) PortAssignInput(portAssignInput PortAssignInput) ApiUnassignPortRequest { + r.portAssignInput = &portAssignInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUnassignPortRequest) Include(include []string) ApiUnassignPortRequest { + r.include = &include + return r +} + +func (r ApiUnassignPortRequest) Execute() (*Port, *http.Response, error) { + return r.ApiService.UnassignPortExecute(r) +} + +/* +UnassignPort Unassign a port + +Unassign a port for a hardware. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Port UUID + @return ApiUnassignPortRequest +*/ +func (a *PortsApiService) UnassignPort(ctx context.Context, id string) ApiUnassignPortRequest { + return ApiUnassignPortRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Port +func (a *PortsApiService) UnassignPortExecute(r ApiUnassignPortRequest) (*Port, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Port + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PortsApiService.UnassignPort") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ports/{id}/unassign" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.portAssignInput == nil { + return localVarReturnValue, nil, reportError("portAssignInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.portAssignInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_projects.go b/services/metalv1/api_projects.go new file mode 100644 index 00000000..2e2daece --- /dev/null +++ b/services/metalv1/api_projects.go @@ -0,0 +1,1911 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// ProjectsApiService ProjectsApi service +type ProjectsApiService service + +type ApiCreateProjectRequest struct { + ctx context.Context + ApiService *ProjectsApiService + projectCreateFromRootInput *ProjectCreateFromRootInput + include *[]string + exclude *[]string +} + +// Project to create +func (r ApiCreateProjectRequest) ProjectCreateFromRootInput(projectCreateFromRootInput ProjectCreateFromRootInput) ApiCreateProjectRequest { + r.projectCreateFromRootInput = &projectCreateFromRootInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateProjectRequest) Include(include []string) ApiCreateProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateProjectRequest) Exclude(exclude []string) ApiCreateProjectRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateProjectRequest) Execute() (*Project, *http.Response, error) { + return r.ApiService.CreateProjectExecute(r) +} + +/* +CreateProject Create a project + +Creates a new project for the user default organization. If the user don't have an organization, a new one will be created. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateProjectRequest +*/ +func (a *ProjectsApiService) CreateProject(ctx context.Context) ApiCreateProjectRequest { + return ApiCreateProjectRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Project +func (a *ProjectsApiService) CreateProjectExecute(r ApiCreateProjectRequest) (*Project, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.CreateProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.projectCreateFromRootInput == nil { + return localVarReturnValue, nil, reportError("projectCreateFromRootInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.projectCreateFromRootInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateProjectInvitationRequest struct { + ctx context.Context + ApiService *ProjectsApiService + projectId string + invitationInput *InvitationInput + include *[]string +} + +// Invitation to create +func (r ApiCreateProjectInvitationRequest) InvitationInput(invitationInput InvitationInput) ApiCreateProjectInvitationRequest { + r.invitationInput = &invitationInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateProjectInvitationRequest) Include(include []string) ApiCreateProjectInvitationRequest { + r.include = &include + return r +} + +func (r ApiCreateProjectInvitationRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.CreateProjectInvitationExecute(r) +} + +/* +CreateProjectInvitation Create an invitation for a project + +In order to add a user to a project, they must first be invited. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiCreateProjectInvitationRequest +*/ +func (a *ProjectsApiService) CreateProjectInvitation(ctx context.Context, projectId string) ApiCreateProjectInvitationRequest { + return ApiCreateProjectInvitationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *ProjectsApiService) CreateProjectInvitationExecute(r ApiCreateProjectInvitationRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.CreateProjectInvitation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/invitations" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationInput == nil { + return localVarReturnValue, nil, reportError("invitationInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateTransferRequestRequest struct { + ctx context.Context + ApiService *ProjectsApiService + id string + transferRequestInput *TransferRequestInput + include *[]string +} + +// Transfer Request to create +func (r ApiCreateTransferRequestRequest) TransferRequestInput(transferRequestInput TransferRequestInput) ApiCreateTransferRequestRequest { + r.transferRequestInput = &transferRequestInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateTransferRequestRequest) Include(include []string) ApiCreateTransferRequestRequest { + r.include = &include + return r +} + +func (r ApiCreateTransferRequestRequest) Execute() (*TransferRequest, *http.Response, error) { + return r.ApiService.CreateTransferRequestExecute(r) +} + +/* +CreateTransferRequest Create a transfer request + +Organization owners can transfer their projects to other organizations. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id UUID of the project to be transferred + @return ApiCreateTransferRequestRequest + +Deprecated +*/ +func (a *ProjectsApiService) CreateTransferRequest(ctx context.Context, id string) ApiCreateTransferRequestRequest { + return ApiCreateTransferRequestRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TransferRequest +// +// Deprecated +func (a *ProjectsApiService) CreateTransferRequestExecute(r ApiCreateTransferRequestRequest) (*TransferRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransferRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.CreateTransferRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/transfers" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.transferRequestInput == nil { + return localVarReturnValue, nil, reportError("transferRequestInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transferRequestInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteProjectRequest struct { + ctx context.Context + ApiService *ProjectsApiService + id string +} + +func (r ApiDeleteProjectRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteProjectExecute(r) +} + +/* +DeleteProject Delete the project + +Deletes the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiDeleteProjectRequest +*/ +func (a *ProjectsApiService) DeleteProject(ctx context.Context, id string) ApiDeleteProjectRequest { + return ApiDeleteProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProjectsApiService) DeleteProjectExecute(r ApiDeleteProjectRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.DeleteProject") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindIPReservationCustomdataRequest struct { + ctx context.Context + ApiService *ProjectsApiService + projectId string + id string +} + +func (r ApiFindIPReservationCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindIPReservationCustomdataExecute(r) +} + +/* +FindIPReservationCustomdata Retrieve the custom metadata of an IP Reservation + +Provides the custom metadata stored for this IP Reservation in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @param id Ip Reservation UUID + @return ApiFindIPReservationCustomdataRequest +*/ +func (a *ProjectsApiService) FindIPReservationCustomdata(ctx context.Context, projectId string, id string) ApiFindIPReservationCustomdataRequest { + return ApiFindIPReservationCustomdataRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// Execute executes the request +func (a *ProjectsApiService) FindIPReservationCustomdataExecute(r ApiFindIPReservationCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindIPReservationCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/ips/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindProjectByIdRequest struct { + ctx context.Context + ApiService *ProjectsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectByIdRequest) Include(include []string) ApiFindProjectByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectByIdRequest) Exclude(exclude []string) ApiFindProjectByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindProjectByIdRequest) Execute() (*Project, *http.Response, error) { + return r.ApiService.FindProjectByIdExecute(r) +} + +/* +FindProjectById Retrieve a project + +Returns a single project if the user has access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectByIdRequest +*/ +func (a *ProjectsApiService) FindProjectById(ctx context.Context, id string) ApiFindProjectByIdRequest { + return ApiFindProjectByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Project +func (a *ProjectsApiService) FindProjectByIdExecute(r ApiFindProjectByIdRequest) (*Project, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindProjectById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectCustomdataRequest struct { + ctx context.Context + ApiService *ProjectsApiService + id string +} + +func (r ApiFindProjectCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindProjectCustomdataExecute(r) +} + +/* +FindProjectCustomdata Retrieve the custom metadata of a project + +Provides the custom metadata stored for this project in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectCustomdataRequest +*/ +func (a *ProjectsApiService) FindProjectCustomdata(ctx context.Context, id string) ApiFindProjectCustomdataRequest { + return ApiFindProjectCustomdataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProjectsApiService) FindProjectCustomdataExecute(r ApiFindProjectCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindProjectCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindProjectInvitationsRequest struct { + ctx context.Context + ApiService *ProjectsApiService + projectId string + include *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectInvitationsRequest) Include(include []string) ApiFindProjectInvitationsRequest { + r.include = &include + return r +} + +// Page to return +func (r ApiFindProjectInvitationsRequest) Page(page int32) ApiFindProjectInvitationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectInvitationsRequest) PerPage(perPage int32) ApiFindProjectInvitationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectInvitationsRequest) Execute() (*InvitationList, *http.Response, error) { + return r.ApiService.FindProjectInvitationsExecute(r) +} + +/* +FindProjectInvitations Retrieve project invitations + +Returns all invitations in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiFindProjectInvitationsRequest +*/ +func (a *ProjectsApiService) FindProjectInvitations(ctx context.Context, projectId string) ApiFindProjectInvitationsRequest { + return ApiFindProjectInvitationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return InvitationList +func (a *ProjectsApiService) FindProjectInvitationsExecute(r ApiFindProjectInvitationsRequest) (*InvitationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindProjectInvitations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/invitations" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectMembershipsRequest struct { + ctx context.Context + ApiService *ProjectsApiService + projectId string + search *string + include *[]string + page *int32 + perPage *int32 +} + +// Search by member full name, id and email. +func (r ApiFindProjectMembershipsRequest) Search(search string) ApiFindProjectMembershipsRequest { + r.search = &search + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectMembershipsRequest) Include(include []string) ApiFindProjectMembershipsRequest { + r.include = &include + return r +} + +// Page to return +func (r ApiFindProjectMembershipsRequest) Page(page int32) ApiFindProjectMembershipsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectMembershipsRequest) PerPage(perPage int32) ApiFindProjectMembershipsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectMembershipsRequest) Execute() (*MembershipList, *http.Response, error) { + return r.ApiService.FindProjectMembershipsExecute(r) +} + +/* +FindProjectMemberships Retrieve project memberships + +Returns all memberships in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiFindProjectMembershipsRequest +*/ +func (a *ProjectsApiService) FindProjectMemberships(ctx context.Context, projectId string) ApiFindProjectMembershipsRequest { + return ApiFindProjectMembershipsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return MembershipList +func (a *ProjectsApiService) FindProjectMembershipsExecute(r ApiFindProjectMembershipsRequest) (*MembershipList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MembershipList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindProjectMemberships") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/memberships" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectsRequest struct { + ctx context.Context + ApiService *ProjectsApiService + name *string + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Filter results by name. +func (r ApiFindProjectsRequest) Name(name string) ApiFindProjectsRequest { + r.name = &name + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectsRequest) Include(include []string) ApiFindProjectsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindProjectsRequest) Exclude(exclude []string) ApiFindProjectsRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindProjectsRequest) Page(page int32) ApiFindProjectsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindProjectsRequest) PerPage(perPage int32) ApiFindProjectsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindProjectsRequest) Execute() (*ProjectList, *http.Response, error) { + return r.ApiService.FindProjectsExecute(r) +} + +/* +FindProjects Retrieve all projects + +Returns a collection of projects that the current user is a member of. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindProjectsRequest +*/ +func (a *ProjectsApiService) FindProjects(ctx context.Context) ApiFindProjectsRequest { + return ApiFindProjectsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ProjectList +func (a *ProjectsApiService) FindProjectsExecute(r ApiFindProjectsRequest) (*ProjectList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.FindProjects") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return ProjectList +func (r ApiFindProjectsRequest) ExecuteWithPagination() (*ProjectList, error) { + + var items ProjectList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Projects = append(items.Projects, page.Projects...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiUpdateProjectRequest struct { + ctx context.Context + ApiService *ProjectsApiService + id string + projectUpdateInput *ProjectUpdateInput + include *[]string + exclude *[]string +} + +// Project to update +func (r ApiUpdateProjectRequest) ProjectUpdateInput(projectUpdateInput ProjectUpdateInput) ApiUpdateProjectRequest { + r.projectUpdateInput = &projectUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateProjectRequest) Include(include []string) ApiUpdateProjectRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateProjectRequest) Exclude(exclude []string) ApiUpdateProjectRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateProjectRequest) Execute() (*Project, *http.Response, error) { + return r.ApiService.UpdateProjectExecute(r) +} + +/* +UpdateProject Update the project + +Updates the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiUpdateProjectRequest +*/ +func (a *ProjectsApiService) UpdateProject(ctx context.Context, id string) ApiUpdateProjectRequest { + return ApiUpdateProjectRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Project +func (a *ProjectsApiService) UpdateProjectExecute(r ApiUpdateProjectRequest) (*Project, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProjectsApiService.UpdateProject") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.projectUpdateInput == nil { + return localVarReturnValue, nil, reportError("projectUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.projectUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_self_service_reservations.go b/services/metalv1/api_self_service_reservations.go new file mode 100644 index 00000000..8d556883 --- /dev/null +++ b/services/metalv1/api_self_service_reservations.go @@ -0,0 +1,476 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// SelfServiceReservationsApiService SelfServiceReservationsApi service +type SelfServiceReservationsApiService service + +type ApiCreateSelfServiceReservationRequest struct { + ctx context.Context + ApiService *SelfServiceReservationsApiService + projectId string + createSelfServiceReservationRequest *CreateSelfServiceReservationRequest +} + +// reservation to create +func (r ApiCreateSelfServiceReservationRequest) CreateSelfServiceReservationRequest(createSelfServiceReservationRequest CreateSelfServiceReservationRequest) ApiCreateSelfServiceReservationRequest { + r.createSelfServiceReservationRequest = &createSelfServiceReservationRequest + return r +} + +func (r ApiCreateSelfServiceReservationRequest) Execute() (*SelfServiceReservationResponse, *http.Response, error) { + return r.ApiService.CreateSelfServiceReservationExecute(r) +} + +/* +CreateSelfServiceReservation Create a reservation + +Creates a reservation. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiCreateSelfServiceReservationRequest +*/ +func (a *SelfServiceReservationsApiService) CreateSelfServiceReservation(ctx context.Context, projectId string) ApiCreateSelfServiceReservationRequest { + return ApiCreateSelfServiceReservationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SelfServiceReservationResponse +func (a *SelfServiceReservationsApiService) CreateSelfServiceReservationExecute(r ApiCreateSelfServiceReservationRequest) (*SelfServiceReservationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SelfServiceReservationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SelfServiceReservationsApiService.CreateSelfServiceReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/self-service/reservations" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createSelfServiceReservationRequest == nil { + return localVarReturnValue, nil, reportError("createSelfServiceReservationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSelfServiceReservationRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSelfServiceReservationRequest struct { + ctx context.Context + ApiService *SelfServiceReservationsApiService + id string + projectId string +} + +func (r ApiFindSelfServiceReservationRequest) Execute() (*SelfServiceReservationResponse, *http.Response, error) { + return r.ApiService.FindSelfServiceReservationExecute(r) +} + +/* +FindSelfServiceReservation Retrieve a reservation + +Returns a reservation + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Reservation short_id + @param projectId Project UUID + @return ApiFindSelfServiceReservationRequest +*/ +func (a *SelfServiceReservationsApiService) FindSelfServiceReservation(ctx context.Context, id string, projectId string) ApiFindSelfServiceReservationRequest { + return ApiFindSelfServiceReservationRequest{ + ApiService: a, + ctx: ctx, + id: id, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SelfServiceReservationResponse +func (a *SelfServiceReservationsApiService) FindSelfServiceReservationExecute(r ApiFindSelfServiceReservationRequest) (*SelfServiceReservationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SelfServiceReservationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SelfServiceReservationsApiService.FindSelfServiceReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/self-service/reservations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSelfServiceReservationsRequest struct { + ctx context.Context + ApiService *SelfServiceReservationsApiService + projectId string + page *int32 + perPage *int32 + categories *[]FindOrganizationDevicesCategoriesParameterInner +} + +// Page to return +func (r ApiFindSelfServiceReservationsRequest) Page(page int32) ApiFindSelfServiceReservationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindSelfServiceReservationsRequest) PerPage(perPage int32) ApiFindSelfServiceReservationsRequest { + r.perPage = &perPage + return r +} + +// Filter reservations by items category +func (r ApiFindSelfServiceReservationsRequest) Categories(categories []FindOrganizationDevicesCategoriesParameterInner) ApiFindSelfServiceReservationsRequest { + r.categories = &categories + return r +} + +func (r ApiFindSelfServiceReservationsRequest) Execute() (*SelfServiceReservationList, *http.Response, error) { + return r.ApiService.FindSelfServiceReservationsExecute(r) +} + +/* +FindSelfServiceReservations Retrieve all reservations + +Returns all reservations. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project UUID + @return ApiFindSelfServiceReservationsRequest +*/ +func (a *SelfServiceReservationsApiService) FindSelfServiceReservations(ctx context.Context, projectId string) ApiFindSelfServiceReservationsRequest { + return ApiFindSelfServiceReservationsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SelfServiceReservationList +func (a *SelfServiceReservationsApiService) FindSelfServiceReservationsExecute(r ApiFindSelfServiceReservationsRequest) (*SelfServiceReservationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SelfServiceReservationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SelfServiceReservationsApiService.FindSelfServiceReservations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{project_id}/self-service/reservations" + localVarPath = strings.Replace(localVarPath, "{"+"project_id"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + if r.categories != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "categories", r.categories, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_spot_market.go b/services/metalv1/api_spot_market.go new file mode 100644 index 00000000..85e54c4f --- /dev/null +++ b/services/metalv1/api_spot_market.go @@ -0,0 +1,1142 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// SpotMarketApiService SpotMarketApi service +type SpotMarketApiService service + +type ApiCreateSpotMarketRequestRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + id string + spotMarketRequestCreateInput *SpotMarketRequestCreateInput +} + +// Spot Market Request to create +func (r ApiCreateSpotMarketRequestRequest) SpotMarketRequestCreateInput(spotMarketRequestCreateInput SpotMarketRequestCreateInput) ApiCreateSpotMarketRequestRequest { + r.spotMarketRequestCreateInput = &spotMarketRequestCreateInput + return r +} + +func (r ApiCreateSpotMarketRequestRequest) Execute() (*SpotMarketRequest, *http.Response, error) { + return r.ApiService.CreateSpotMarketRequestExecute(r) +} + +/* +CreateSpotMarketRequest Create a spot market request + +Creates a new spot market request. + +Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + +The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + +The request will fail if there are no available servers matching your criteria. Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a preferred value (see the example request below). + +The request will not fail if we have no servers with that feature in our inventory. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateSpotMarketRequestRequest +*/ +func (a *SpotMarketApiService) CreateSpotMarketRequest(ctx context.Context, id string) ApiCreateSpotMarketRequestRequest { + return ApiCreateSpotMarketRequestRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SpotMarketRequest +func (a *SpotMarketApiService) CreateSpotMarketRequestExecute(r ApiCreateSpotMarketRequestRequest) (*SpotMarketRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotMarketRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.CreateSpotMarketRequest") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/spot-market-requests" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.spotMarketRequestCreateInput == nil { + return localVarReturnValue, nil, reportError("spotMarketRequestCreateInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.spotMarketRequestCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteSpotMarketRequestRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + id string + forceTermination *bool +} + +// Terminate associated spot instances +func (r ApiDeleteSpotMarketRequestRequest) ForceTermination(forceTermination bool) ApiDeleteSpotMarketRequestRequest { + r.forceTermination = &forceTermination + return r +} + +func (r ApiDeleteSpotMarketRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSpotMarketRequestExecute(r) +} + +/* +DeleteSpotMarketRequest Delete the spot market request + +Deletes the spot market request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id SpotMarketRequest UUID + @return ApiDeleteSpotMarketRequestRequest +*/ +func (a *SpotMarketApiService) DeleteSpotMarketRequest(ctx context.Context, id string) ApiDeleteSpotMarketRequestRequest { + return ApiDeleteSpotMarketRequestRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SpotMarketApiService) DeleteSpotMarketRequestExecute(r ApiDeleteSpotMarketRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.DeleteSpotMarketRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/spot-market-requests/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forceTermination != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force_termination", r.forceTermination, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindMetroSpotMarketPricesRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + metro *string + plan *string +} + +// Metro to filter spot market prices +func (r ApiFindMetroSpotMarketPricesRequest) Metro(metro string) ApiFindMetroSpotMarketPricesRequest { + r.metro = &metro + return r +} + +// Plan to filter spot market prices +func (r ApiFindMetroSpotMarketPricesRequest) Plan(plan string) ApiFindMetroSpotMarketPricesRequest { + r.plan = &plan + return r +} + +func (r ApiFindMetroSpotMarketPricesRequest) Execute() (*SpotMarketPricesPerMetroList, *http.Response, error) { + return r.ApiService.FindMetroSpotMarketPricesExecute(r) +} + +/* +FindMetroSpotMarketPrices Get current spot market prices for metros + +Get Equinix Metal current spot market prices for all metros. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindMetroSpotMarketPricesRequest +*/ +func (a *SpotMarketApiService) FindMetroSpotMarketPrices(ctx context.Context) ApiFindMetroSpotMarketPricesRequest { + return ApiFindMetroSpotMarketPricesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SpotMarketPricesPerMetroList +func (a *SpotMarketApiService) FindMetroSpotMarketPricesExecute(r ApiFindMetroSpotMarketPricesRequest) (*SpotMarketPricesPerMetroList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotMarketPricesPerMetroList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.FindMetroSpotMarketPrices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/market/spot/prices/metros" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } + if r.plan != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "plan", r.plan, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSpotMarketPricesRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + facility *string + plan *string +} + +// Facility to check spot market prices +func (r ApiFindSpotMarketPricesRequest) Facility(facility string) ApiFindSpotMarketPricesRequest { + r.facility = &facility + return r +} + +// Plan to check spot market prices +func (r ApiFindSpotMarketPricesRequest) Plan(plan string) ApiFindSpotMarketPricesRequest { + r.plan = &plan + return r +} + +func (r ApiFindSpotMarketPricesRequest) Execute() (*SpotMarketPricesList, *http.Response, error) { + return r.ApiService.FindSpotMarketPricesExecute(r) +} + +/* +FindSpotMarketPrices Get current spot market prices + +Get Equinix Metal current spot market prices. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindSpotMarketPricesRequest +*/ +func (a *SpotMarketApiService) FindSpotMarketPrices(ctx context.Context) ApiFindSpotMarketPricesRequest { + return ApiFindSpotMarketPricesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SpotMarketPricesList +func (a *SpotMarketApiService) FindSpotMarketPricesExecute(r ApiFindSpotMarketPricesRequest) (*SpotMarketPricesList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotMarketPricesList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.FindSpotMarketPrices") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/market/spot/prices" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.facility != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") + } + if r.plan != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "plan", r.plan, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSpotMarketPricesHistoryRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + facility *string + plan *string + from *string + until *string + metro *string +} + +// Facility to check spot market prices +func (r ApiFindSpotMarketPricesHistoryRequest) Facility(facility string) ApiFindSpotMarketPricesHistoryRequest { + r.facility = &facility + return r +} + +// Plan to check spot market prices +func (r ApiFindSpotMarketPricesHistoryRequest) Plan(plan string) ApiFindSpotMarketPricesHistoryRequest { + r.plan = &plan + return r +} + +// Timestamp from range +func (r ApiFindSpotMarketPricesHistoryRequest) From(from string) ApiFindSpotMarketPricesHistoryRequest { + r.from = &from + return r +} + +// Timestamp to range +func (r ApiFindSpotMarketPricesHistoryRequest) Until(until string) ApiFindSpotMarketPricesHistoryRequest { + r.until = &until + return r +} + +// Metro to check spot market price history +func (r ApiFindSpotMarketPricesHistoryRequest) Metro(metro string) ApiFindSpotMarketPricesHistoryRequest { + r.metro = &metro + return r +} + +func (r ApiFindSpotMarketPricesHistoryRequest) Execute() (*SpotPricesHistoryReport, *http.Response, error) { + return r.ApiService.FindSpotMarketPricesHistoryExecute(r) +} + +/* +FindSpotMarketPricesHistory Get spot market prices for a given period of time + +# Get spot market prices for a given plan and facility in a fixed period of time + +*Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindSpotMarketPricesHistoryRequest +*/ +func (a *SpotMarketApiService) FindSpotMarketPricesHistory(ctx context.Context) ApiFindSpotMarketPricesHistoryRequest { + return ApiFindSpotMarketPricesHistoryRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SpotPricesHistoryReport +func (a *SpotMarketApiService) FindSpotMarketPricesHistoryExecute(r ApiFindSpotMarketPricesHistoryRequest) (*SpotPricesHistoryReport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotPricesHistoryReport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.FindSpotMarketPricesHistory") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/market/spot/prices/history" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.facility == nil { + return localVarReturnValue, nil, reportError("facility is required and must be specified") + } + if r.plan == nil { + return localVarReturnValue, nil, reportError("plan is required and must be specified") + } + if r.from == nil { + return localVarReturnValue, nil, reportError("from is required and must be specified") + } + if r.until == nil { + return localVarReturnValue, nil, reportError("until is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "plan", r.plan, "") + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "") + parameterAddToHeaderOrQuery(localVarQueryParams, "until", r.until, "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSpotMarketRequestByIdRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindSpotMarketRequestByIdRequest) Include(include []string) ApiFindSpotMarketRequestByIdRequest { + r.include = &include + return r +} + +func (r ApiFindSpotMarketRequestByIdRequest) Execute() (*SpotMarketRequest, *http.Response, error) { + return r.ApiService.FindSpotMarketRequestByIdExecute(r) +} + +/* +FindSpotMarketRequestById Retrieve a spot market request + +Returns a single spot market request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id SpotMarketRequest UUID + @return ApiFindSpotMarketRequestByIdRequest +*/ +func (a *SpotMarketApiService) FindSpotMarketRequestById(ctx context.Context, id string) ApiFindSpotMarketRequestByIdRequest { + return ApiFindSpotMarketRequestByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SpotMarketRequest +func (a *SpotMarketApiService) FindSpotMarketRequestByIdExecute(r ApiFindSpotMarketRequestByIdRequest) (*SpotMarketRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotMarketRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.FindSpotMarketRequestById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/spot-market-requests/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListSpotMarketRequestsRequest struct { + ctx context.Context + ApiService *SpotMarketApiService + id string +} + +func (r ApiListSpotMarketRequestsRequest) Execute() (*SpotMarketRequestList, *http.Response, error) { + return r.ApiService.ListSpotMarketRequestsExecute(r) +} + +/* +ListSpotMarketRequests List spot market requests + +View all spot market requests for a given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiListSpotMarketRequestsRequest +*/ +func (a *SpotMarketApiService) ListSpotMarketRequests(ctx context.Context, id string) ApiListSpotMarketRequestsRequest { + return ApiListSpotMarketRequestsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SpotMarketRequestList +func (a *SpotMarketApiService) ListSpotMarketRequestsExecute(r ApiListSpotMarketRequestsRequest) (*SpotMarketRequestList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SpotMarketRequestList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SpotMarketApiService.ListSpotMarketRequests") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/spot-market-requests" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_ssh_keys.go b/services/metalv1/api_ssh_keys.go new file mode 100644 index 00000000..8be652d6 --- /dev/null +++ b/services/metalv1/api_ssh_keys.go @@ -0,0 +1,1263 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// SSHKeysApiService SSHKeysApi service +type SSHKeysApiService service + +type ApiCreateProjectSSHKeyRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string + sSHKeyCreateInput *SSHKeyCreateInput + include *[]string +} + +// ssh key to create +func (r ApiCreateProjectSSHKeyRequest) SSHKeyCreateInput(sSHKeyCreateInput SSHKeyCreateInput) ApiCreateProjectSSHKeyRequest { + r.sSHKeyCreateInput = &sSHKeyCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateProjectSSHKeyRequest) Include(include []string) ApiCreateProjectSSHKeyRequest { + r.include = &include + return r +} + +func (r ApiCreateProjectSSHKeyRequest) Execute() (*SSHKey, *http.Response, error) { + return r.ApiService.CreateProjectSSHKeyExecute(r) +} + +/* +CreateProjectSSHKey Create a ssh key for the given project + +Creates a ssh key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateProjectSSHKeyRequest +*/ +func (a *SSHKeysApiService) CreateProjectSSHKey(ctx context.Context, id string) ApiCreateProjectSSHKeyRequest { + return ApiCreateProjectSSHKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSHKey +func (a *SSHKeysApiService) CreateProjectSSHKeyExecute(r ApiCreateProjectSSHKeyRequest) (*SSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.CreateProjectSSHKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/ssh-keys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sSHKeyCreateInput == nil { + return localVarReturnValue, nil, reportError("sSHKeyCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sSHKeyCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateSSHKeyRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + sSHKeyCreateInput *SSHKeyCreateInput + include *[]string +} + +// ssh key to create +func (r ApiCreateSSHKeyRequest) SSHKeyCreateInput(sSHKeyCreateInput SSHKeyCreateInput) ApiCreateSSHKeyRequest { + r.sSHKeyCreateInput = &sSHKeyCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateSSHKeyRequest) Include(include []string) ApiCreateSSHKeyRequest { + r.include = &include + return r +} + +func (r ApiCreateSSHKeyRequest) Execute() (*SSHKey, *http.Response, error) { + return r.ApiService.CreateSSHKeyExecute(r) +} + +/* +CreateSSHKey Create a ssh key for the current user + +Creates a ssh key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateSSHKeyRequest +*/ +func (a *SSHKeysApiService) CreateSSHKey(ctx context.Context) ApiCreateSSHKeyRequest { + return ApiCreateSSHKeyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SSHKey +func (a *SSHKeysApiService) CreateSSHKeyExecute(r ApiCreateSSHKeyRequest) (*SSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.CreateSSHKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sSHKeyCreateInput == nil { + return localVarReturnValue, nil, reportError("sSHKeyCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sSHKeyCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteSSHKeyRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string +} + +func (r ApiDeleteSSHKeyRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSSHKeyExecute(r) +} + +/* +DeleteSSHKey Delete the ssh key + +Deletes the ssh key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id ssh key UUID + @return ApiDeleteSSHKeyRequest +*/ +func (a *SSHKeysApiService) DeleteSSHKey(ctx context.Context, id string) ApiDeleteSSHKeyRequest { + return ApiDeleteSSHKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SSHKeysApiService) DeleteSSHKeyExecute(r ApiDeleteSSHKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.DeleteSSHKey") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindDeviceSSHKeysRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string + searchString *string + include *[]string +} + +// Search by key, label, or fingerprint +func (r ApiFindDeviceSSHKeysRequest) SearchString(searchString string) ApiFindDeviceSSHKeysRequest { + r.searchString = &searchString + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindDeviceSSHKeysRequest) Include(include []string) ApiFindDeviceSSHKeysRequest { + r.include = &include + return r +} + +func (r ApiFindDeviceSSHKeysRequest) Execute() (*SSHKeyList, *http.Response, error) { + return r.ApiService.FindDeviceSSHKeysExecute(r) +} + +/* +FindDeviceSSHKeys Retrieve a device's ssh keys + +Returns a collection of the device's ssh keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindDeviceSSHKeysRequest +*/ +func (a *SSHKeysApiService) FindDeviceSSHKeys(ctx context.Context, id string) ApiFindDeviceSSHKeysRequest { + return ApiFindDeviceSSHKeysRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSHKeyList +func (a *SSHKeysApiService) FindDeviceSSHKeysExecute(r ApiFindDeviceSSHKeysRequest) (*SSHKeyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKeyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.FindDeviceSSHKeys") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/ssh-keys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.searchString != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "Search string", r.searchString, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectSSHKeysRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string + query *string + include *[]string +} + +// Search by key, label, or fingerprint +func (r ApiFindProjectSSHKeysRequest) Query(query string) ApiFindProjectSSHKeysRequest { + r.query = &query + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindProjectSSHKeysRequest) Include(include []string) ApiFindProjectSSHKeysRequest { + r.include = &include + return r +} + +func (r ApiFindProjectSSHKeysRequest) Execute() (*SSHKeyList, *http.Response, error) { + return r.ApiService.FindProjectSSHKeysExecute(r) +} + +/* +FindProjectSSHKeys Retrieve a project's ssh keys + +Returns a collection of the project's ssh keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectSSHKeysRequest +*/ +func (a *SSHKeysApiService) FindProjectSSHKeys(ctx context.Context, id string) ApiFindProjectSSHKeysRequest { + return ApiFindProjectSSHKeysRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSHKeyList +func (a *SSHKeysApiService) FindProjectSSHKeysExecute(r ApiFindProjectSSHKeysRequest) (*SSHKeyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKeyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.FindProjectSSHKeys") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/ssh-keys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.query != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "query", r.query, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSSHKeyByIdRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindSSHKeyByIdRequest) Include(include []string) ApiFindSSHKeyByIdRequest { + r.include = &include + return r +} + +func (r ApiFindSSHKeyByIdRequest) Execute() (*SSHKey, *http.Response, error) { + return r.ApiService.FindSSHKeyByIdExecute(r) +} + +/* +FindSSHKeyById Retrieve a ssh key + +Returns a single ssh key if the user has access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id SSH Key UUID + @return ApiFindSSHKeyByIdRequest +*/ +func (a *SSHKeysApiService) FindSSHKeyById(ctx context.Context, id string) ApiFindSSHKeyByIdRequest { + return ApiFindSSHKeyByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSHKey +func (a *SSHKeysApiService) FindSSHKeyByIdExecute(r ApiFindSSHKeyByIdRequest) (*SSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.FindSSHKeyById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindSSHKeysRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + search *string + include *[]string +} + +// Search by key, label, or fingerprint +func (r ApiFindSSHKeysRequest) Search(search string) ApiFindSSHKeysRequest { + r.search = &search + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindSSHKeysRequest) Include(include []string) ApiFindSSHKeysRequest { + r.include = &include + return r +} + +func (r ApiFindSSHKeysRequest) Execute() (*SSHKeyList, *http.Response, error) { + return r.ApiService.FindSSHKeysExecute(r) +} + +/* +FindSSHKeys Retrieve all ssh keys + +Returns a collection of the user’s ssh keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindSSHKeysRequest +*/ +func (a *SSHKeysApiService) FindSSHKeys(ctx context.Context) ApiFindSSHKeysRequest { + return ApiFindSSHKeysRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SSHKeyList +func (a *SSHKeysApiService) FindSSHKeysExecute(r ApiFindSSHKeysRequest) (*SSHKeyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKeyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.FindSSHKeys") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateSSHKeyRequest struct { + ctx context.Context + ApiService *SSHKeysApiService + id string + sSHKeyInput *SSHKeyInput + include *[]string +} + +// ssh key to update +func (r ApiUpdateSSHKeyRequest) SSHKeyInput(sSHKeyInput SSHKeyInput) ApiUpdateSSHKeyRequest { + r.sSHKeyInput = &sSHKeyInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateSSHKeyRequest) Include(include []string) ApiUpdateSSHKeyRequest { + r.include = &include + return r +} + +func (r ApiUpdateSSHKeyRequest) Execute() (*SSHKey, *http.Response, error) { + return r.ApiService.UpdateSSHKeyExecute(r) +} + +/* +UpdateSSHKey Update the ssh key + +Updates the ssh key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id SSH Key UUID + @return ApiUpdateSSHKeyRequest +*/ +func (a *SSHKeysApiService) UpdateSSHKey(ctx context.Context, id string) ApiUpdateSSHKeyRequest { + return ApiUpdateSSHKeyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSHKey +func (a *SSHKeysApiService) UpdateSSHKeyExecute(r ApiUpdateSSHKeyRequest) (*SSHKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSHKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SSHKeysApiService.UpdateSSHKey") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssh-keys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sSHKeyInput == nil { + return localVarReturnValue, nil, reportError("sSHKeyInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sSHKeyInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_support_request.go b/services/metalv1/api_support_request.go new file mode 100644 index 00000000..4e5f4a34 --- /dev/null +++ b/services/metalv1/api_support_request.go @@ -0,0 +1,180 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// SupportRequestApiService SupportRequestApi service +type SupportRequestApiService service + +type ApiRequestSuppertRequest struct { + ctx context.Context + ApiService *SupportRequestApiService + supportRequestInput *SupportRequestInput +} + +// Support Request to create +func (r ApiRequestSuppertRequest) SupportRequestInput(supportRequestInput SupportRequestInput) ApiRequestSuppertRequest { + r.supportRequestInput = &supportRequestInput + return r +} + +func (r ApiRequestSuppertRequest) Execute() (*http.Response, error) { + return r.ApiService.RequestSuppertExecute(r) +} + +/* +RequestSuppert Create a support ticket + +Support Ticket. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRequestSuppertRequest +*/ +func (a *SupportRequestApiService) RequestSuppert(ctx context.Context) ApiRequestSuppertRequest { + return ApiRequestSuppertRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *SupportRequestApiService) RequestSuppertExecute(r ApiRequestSuppertRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SupportRequestApiService.RequestSuppert") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/support-requests" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.supportRequestInput == nil { + return nil, reportError("supportRequestInput is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.supportRequestInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_transfer_requests.go b/services/metalv1/api_transfer_requests.go new file mode 100644 index 00000000..f933bb4f --- /dev/null +++ b/services/metalv1/api_transfer_requests.go @@ -0,0 +1,460 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// TransferRequestsApiService TransferRequestsApi service +type TransferRequestsApiService service + +type ApiAcceptTransferRequestRequest struct { + ctx context.Context + ApiService *TransferRequestsApiService + id string +} + +func (r ApiAcceptTransferRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.AcceptTransferRequestExecute(r) +} + +/* +AcceptTransferRequest Accept a transfer request + +Accept a transfer request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Transfer request UUID + @return ApiAcceptTransferRequestRequest +*/ +func (a *TransferRequestsApiService) AcceptTransferRequest(ctx context.Context, id string) ApiAcceptTransferRequestRequest { + return ApiAcceptTransferRequestRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TransferRequestsApiService) AcceptTransferRequestExecute(r ApiAcceptTransferRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransferRequestsApiService.AcceptTransferRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/transfers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeclineTransferRequestRequest struct { + ctx context.Context + ApiService *TransferRequestsApiService + id string +} + +func (r ApiDeclineTransferRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.DeclineTransferRequestExecute(r) +} + +/* +DeclineTransferRequest Decline a transfer request + +Decline a transfer request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Transfer request UUID + @return ApiDeclineTransferRequestRequest +*/ +func (a *TransferRequestsApiService) DeclineTransferRequest(ctx context.Context, id string) ApiDeclineTransferRequestRequest { + return ApiDeclineTransferRequestRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TransferRequestsApiService) DeclineTransferRequestExecute(r ApiDeclineTransferRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransferRequestsApiService.DeclineTransferRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/transfers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindTransferRequestByIdRequest struct { + ctx context.Context + ApiService *TransferRequestsApiService + id string + include *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindTransferRequestByIdRequest) Include(include []string) ApiFindTransferRequestByIdRequest { + r.include = &include + return r +} + +func (r ApiFindTransferRequestByIdRequest) Execute() (*TransferRequest, *http.Response, error) { + return r.ApiService.FindTransferRequestByIdExecute(r) +} + +/* +FindTransferRequestById View a transfer request + +Returns a single transfer request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Transfer request UUID + @return ApiFindTransferRequestByIdRequest +*/ +func (a *TransferRequestsApiService) FindTransferRequestById(ctx context.Context, id string) ApiFindTransferRequestByIdRequest { + return ApiFindTransferRequestByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TransferRequest +func (a *TransferRequestsApiService) FindTransferRequestByIdExecute(r ApiFindTransferRequestByIdRequest) (*TransferRequest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransferRequest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TransferRequestsApiService.FindTransferRequestById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/transfers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_two_factor_auth.go b/services/metalv1/api_two_factor_auth.go new file mode 100644 index 00000000..bbe38581 --- /dev/null +++ b/services/metalv1/api_two_factor_auth.go @@ -0,0 +1,493 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// TwoFactorAuthApiService TwoFactorAuthApi service +type TwoFactorAuthApiService service + +type ApiDisableTfaAppRequest struct { + ctx context.Context + ApiService *TwoFactorAuthApiService +} + +func (r ApiDisableTfaAppRequest) Execute() (*http.Response, error) { + return r.ApiService.DisableTfaAppExecute(r) +} + +/* +DisableTfaApp Disable two factor authentication + +Disables two factor authentication. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDisableTfaAppRequest +*/ +func (a *TwoFactorAuthApiService) DisableTfaApp(ctx context.Context) ApiDisableTfaAppRequest { + return ApiDisableTfaAppRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TwoFactorAuthApiService) DisableTfaAppExecute(r ApiDisableTfaAppRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TwoFactorAuthApiService.DisableTfaApp") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/app" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDisableTfaSmsRequest struct { + ctx context.Context + ApiService *TwoFactorAuthApiService +} + +func (r ApiDisableTfaSmsRequest) Execute() (*http.Response, error) { + return r.ApiService.DisableTfaSmsExecute(r) +} + +/* +DisableTfaSms Disable two factor authentication + +Disables two factor authentication. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiDisableTfaSmsRequest +*/ +func (a *TwoFactorAuthApiService) DisableTfaSms(ctx context.Context) ApiDisableTfaSmsRequest { + return ApiDisableTfaSmsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TwoFactorAuthApiService) DisableTfaSmsExecute(r ApiDisableTfaSmsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TwoFactorAuthApiService.DisableTfaSms") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/sms" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEnableTfaAppRequest struct { + ctx context.Context + ApiService *TwoFactorAuthApiService +} + +func (r ApiEnableTfaAppRequest) Execute() (*http.Response, error) { + return r.ApiService.EnableTfaAppExecute(r) +} + +/* +EnableTfaApp Enable two factor auth using app + +Enables two factor authentication using authenticator app. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnableTfaAppRequest +*/ +func (a *TwoFactorAuthApiService) EnableTfaApp(ctx context.Context) ApiEnableTfaAppRequest { + return ApiEnableTfaAppRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TwoFactorAuthApiService) EnableTfaAppExecute(r ApiEnableTfaAppRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TwoFactorAuthApiService.EnableTfaApp") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/app" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEnableTfaSmsRequest struct { + ctx context.Context + ApiService *TwoFactorAuthApiService +} + +func (r ApiEnableTfaSmsRequest) Execute() (*http.Response, error) { + return r.ApiService.EnableTfaSmsExecute(r) +} + +/* +EnableTfaSms Enable two factor auth using sms + +Enables two factor authentication with sms. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnableTfaSmsRequest +*/ +func (a *TwoFactorAuthApiService) EnableTfaSms(ctx context.Context) ApiEnableTfaSmsRequest { + return ApiEnableTfaSmsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *TwoFactorAuthApiService) EnableTfaSmsExecute(r ApiEnableTfaSmsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TwoFactorAuthApiService.EnableTfaSms") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user/otp/sms" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_usages.go b/services/metalv1/api_usages.go new file mode 100644 index 00000000..ff4aae8b --- /dev/null +++ b/services/metalv1/api_usages.go @@ -0,0 +1,342 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// UsagesApiService UsagesApi service +type UsagesApiService service + +type ApiFindDeviceUsagesRequest struct { + ctx context.Context + ApiService *UsagesApiService + id string + createdAfter *string + createdBefore *string +} + +// Filter usages created after this date +func (r ApiFindDeviceUsagesRequest) CreatedAfter(createdAfter string) ApiFindDeviceUsagesRequest { + r.createdAfter = &createdAfter + return r +} + +// Filter usages created before this date +func (r ApiFindDeviceUsagesRequest) CreatedBefore(createdBefore string) ApiFindDeviceUsagesRequest { + r.createdBefore = &createdBefore + return r +} + +func (r ApiFindDeviceUsagesRequest) Execute() (*DeviceUsageList, *http.Response, error) { + return r.ApiService.FindDeviceUsagesExecute(r) +} + +/* +FindDeviceUsages Retrieve all usages for device + +Returns all usages for a device. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Device UUID + @return ApiFindDeviceUsagesRequest +*/ +func (a *UsagesApiService) FindDeviceUsages(ctx context.Context, id string) ApiFindDeviceUsagesRequest { + return ApiFindDeviceUsagesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DeviceUsageList +func (a *UsagesApiService) FindDeviceUsagesExecute(r ApiFindDeviceUsagesRequest) (*DeviceUsageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceUsageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsagesApiService.FindDeviceUsages") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/devices/{id}/usages" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.createdAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created[after]", r.createdAfter, "") + } + if r.createdBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created[before]", r.createdBefore, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindProjectUsageRequest struct { + ctx context.Context + ApiService *UsagesApiService + id string + createdAfter *string + createdBefore *string +} + +// Filter usages created after this date +func (r ApiFindProjectUsageRequest) CreatedAfter(createdAfter string) ApiFindProjectUsageRequest { + r.createdAfter = &createdAfter + return r +} + +// Filter usages created before this date +func (r ApiFindProjectUsageRequest) CreatedBefore(createdBefore string) ApiFindProjectUsageRequest { + r.createdBefore = &createdBefore + return r +} + +func (r ApiFindProjectUsageRequest) Execute() (*ProjectUsageList, *http.Response, error) { + return r.ApiService.FindProjectUsageExecute(r) +} + +/* +FindProjectUsage Retrieve all usages for project + +Returns all usages for a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindProjectUsageRequest +*/ +func (a *UsagesApiService) FindProjectUsage(ctx context.Context, id string) ApiFindProjectUsageRequest { + return ApiFindProjectUsageRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProjectUsageList +func (a *UsagesApiService) FindProjectUsageExecute(r ApiFindProjectUsageRequest) (*ProjectUsageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectUsageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsagesApiService.FindProjectUsage") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/usages" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.createdAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created[after]", r.createdAfter, "") + } + if r.createdBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created[before]", r.createdBefore, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_user_verification_tokens.go b/services/metalv1/api_user_verification_tokens.go new file mode 100644 index 00000000..75c4f3bd --- /dev/null +++ b/services/metalv1/api_user_verification_tokens.go @@ -0,0 +1,312 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// UserVerificationTokensApiService UserVerificationTokensApi service +type UserVerificationTokensApiService service + +type ApiConsumeVerificationRequestRequest struct { + ctx context.Context + ApiService *UserVerificationTokensApiService + verifyEmail *VerifyEmail + include *[]string +} + +// Email to create +func (r ApiConsumeVerificationRequestRequest) VerifyEmail(verifyEmail VerifyEmail) ApiConsumeVerificationRequestRequest { + r.verifyEmail = &verifyEmail + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiConsumeVerificationRequestRequest) Include(include []string) ApiConsumeVerificationRequestRequest { + r.include = &include + return r +} + +func (r ApiConsumeVerificationRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.ConsumeVerificationRequestExecute(r) +} + +/* +ConsumeVerificationRequest Verify a user using an email verification token + +Consumes an email verification token and verifies the user associated with it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiConsumeVerificationRequestRequest +*/ +func (a *UserVerificationTokensApiService) ConsumeVerificationRequest(ctx context.Context) ApiConsumeVerificationRequestRequest { + return ApiConsumeVerificationRequestRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UserVerificationTokensApiService) ConsumeVerificationRequestExecute(r ApiConsumeVerificationRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserVerificationTokensApiService.ConsumeVerificationRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify-email" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.verifyEmail == nil { + return nil, reportError("verifyEmail is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.verifyEmail + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCreateValidationRequestRequest struct { + ctx context.Context + ApiService *UserVerificationTokensApiService + login *string + include *[]string +} + +// Email for verification request +func (r ApiCreateValidationRequestRequest) Login(login string) ApiCreateValidationRequestRequest { + r.login = &login + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateValidationRequestRequest) Include(include []string) ApiCreateValidationRequestRequest { + r.include = &include + return r +} + +func (r ApiCreateValidationRequestRequest) Execute() (*http.Response, error) { + return r.ApiService.CreateValidationRequestExecute(r) +} + +/* +CreateValidationRequest Create an email verification request + +Creates an email verification request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateValidationRequestRequest +*/ +func (a *UserVerificationTokensApiService) CreateValidationRequest(ctx context.Context) ApiCreateValidationRequestRequest { + return ApiCreateValidationRequestRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UserVerificationTokensApiService) CreateValidationRequestExecute(r ApiCreateValidationRequestRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserVerificationTokensApiService.CreateValidationRequest") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/verify-email" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.login == nil { + return nil, reportError("login is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "login", r.login, "") + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_userdata.go b/services/metalv1/api_userdata.go new file mode 100644 index 00000000..8ca1ef9b --- /dev/null +++ b/services/metalv1/api_userdata.go @@ -0,0 +1,156 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// UserdataApiService UserdataApi service +type UserdataApiService service + +type ApiValidateUserdataRequest struct { + ctx context.Context + ApiService *UserdataApiService + userdata *string +} + +// Userdata to validate +func (r ApiValidateUserdataRequest) Userdata(userdata string) ApiValidateUserdataRequest { + r.userdata = &userdata + return r +} + +func (r ApiValidateUserdataRequest) Execute() (*http.Response, error) { + return r.ApiService.ValidateUserdataExecute(r) +} + +/* +ValidateUserdata Validate user data + +Validates user data (Userdata) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiValidateUserdataRequest +*/ +func (a *UserdataApiService) ValidateUserdata(ctx context.Context) ApiValidateUserdataRequest { + return ApiValidateUserdataRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UserdataApiService) ValidateUserdataExecute(r ApiValidateUserdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserdataApiService.ValidateUserdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/userdata/validate" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.userdata != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "userdata", r.userdata, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_users.go b/services/metalv1/api_users.go new file mode 100644 index 00000000..11727401 --- /dev/null +++ b/services/metalv1/api_users.go @@ -0,0 +1,1175 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// UsersApiService UsersApi service +type UsersApiService service + +type ApiCreateUserRequest struct { + ctx context.Context + ApiService *UsersApiService + userCreateInput *UserCreateInput + include *[]string + exclude *[]string +} + +// User to create +func (r ApiCreateUserRequest) UserCreateInput(userCreateInput UserCreateInput) ApiCreateUserRequest { + r.userCreateInput = &userCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateUserRequest) Include(include []string) ApiCreateUserRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateUserRequest) Exclude(exclude []string) ApiCreateUserRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CreateUserExecute(r) +} + +/* +CreateUser Create a user + +Creates a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateUserRequest +*/ +func (a *UsersApiService) CreateUser(ctx context.Context) ApiCreateUserRequest { + return ApiCreateUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.CreateUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userCreateInput == nil { + return localVarReturnValue, nil, reportError("userCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindCurrentUserRequest struct { + ctx context.Context + ApiService *UsersApiService + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindCurrentUserRequest) Include(include []string) ApiFindCurrentUserRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindCurrentUserRequest) Exclude(exclude []string) ApiFindCurrentUserRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindCurrentUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.FindCurrentUserExecute(r) +} + +/* +FindCurrentUser Retrieve the current user + +Returns the user object for the currently logged-in user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindCurrentUserRequest +*/ +func (a *UsersApiService) FindCurrentUser(ctx context.Context) ApiFindCurrentUserRequest { + return ApiFindCurrentUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersApiService) FindCurrentUserExecute(r ApiFindCurrentUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.FindCurrentUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindInvitationsRequest struct { + ctx context.Context + ApiService *UsersApiService + include *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindInvitationsRequest) Include(include []string) ApiFindInvitationsRequest { + r.include = &include + return r +} + +// Page to return +func (r ApiFindInvitationsRequest) Page(page int32) ApiFindInvitationsRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindInvitationsRequest) PerPage(perPage int32) ApiFindInvitationsRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindInvitationsRequest) Execute() (*InvitationList, *http.Response, error) { + return r.ApiService.FindInvitationsExecute(r) +} + +/* +FindInvitations Retrieve current user invitations + +Returns all invitations in current user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindInvitationsRequest +*/ +func (a *UsersApiService) FindInvitations(ctx context.Context) ApiFindInvitationsRequest { + return ApiFindInvitationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InvitationList +func (a *UsersApiService) FindInvitationsExecute(r ApiFindInvitationsRequest) (*InvitationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.FindInvitations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/invitations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindUserByIdRequest struct { + ctx context.Context + ApiService *UsersApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindUserByIdRequest) Include(include []string) ApiFindUserByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindUserByIdRequest) Exclude(exclude []string) ApiFindUserByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindUserByIdRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.FindUserByIdExecute(r) +} + +/* +FindUserById Retrieve a user + +Returns a single user if the user has access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id User UUID + @return ApiFindUserByIdRequest +*/ +func (a *UsersApiService) FindUserById(ctx context.Context, id string) ApiFindUserByIdRequest { + return ApiFindUserByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersApiService) FindUserByIdExecute(r ApiFindUserByIdRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.FindUserById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindUserCustomdataRequest struct { + ctx context.Context + ApiService *UsersApiService + id string +} + +func (r ApiFindUserCustomdataRequest) Execute() (*http.Response, error) { + return r.ApiService.FindUserCustomdataExecute(r) +} + +/* +FindUserCustomdata Retrieve the custom metadata of a user + +Provides the custom metadata stored for this user in json format + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id User UUID + @return ApiFindUserCustomdataRequest +*/ +func (a *UsersApiService) FindUserCustomdata(ctx context.Context, id string) ApiFindUserCustomdataRequest { + return ApiFindUserCustomdataRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *UsersApiService) FindUserCustomdataExecute(r ApiFindUserCustomdataRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.FindUserCustomdata") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{id}/customdata" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFindUsersRequest struct { + ctx context.Context + ApiService *UsersApiService + include *[]string + exclude *[]string + page *int32 + perPage *int32 +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindUsersRequest) Include(include []string) ApiFindUsersRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindUsersRequest) Exclude(exclude []string) ApiFindUsersRequest { + r.exclude = &exclude + return r +} + +// Page to return +func (r ApiFindUsersRequest) Page(page int32) ApiFindUsersRequest { + r.page = &page + return r +} + +// Items returned per page +func (r ApiFindUsersRequest) PerPage(perPage int32) ApiFindUsersRequest { + r.perPage = &perPage + return r +} + +func (r ApiFindUsersRequest) Execute() (*UserList, *http.Response, error) { + return r.ApiService.FindUsersExecute(r) +} + +/* +FindUsers Retrieve all users + +Returns a list of users that the are accessible to the current user (all users in the current user’s projects, essentially). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFindUsersRequest +*/ +func (a *UsersApiService) FindUsers(ctx context.Context) ApiFindUsersRequest { + return ApiFindUsersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserList +func (a *UsersApiService) FindUsersExecute(r ApiFindUsersRequest) (*UserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.FindUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "per_page", r.perPage, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice +// +// @return UserList +func (r ApiFindUsersRequest) ExecuteWithPagination() (*UserList, error) { + + var items UserList + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.Users = append(items.Users, page.Users...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} + +type ApiUpdateCurrentUserRequest struct { + ctx context.Context + ApiService *UsersApiService + userUpdateInput *UserUpdateInput + include *[]string + exclude *[]string +} + +// User to update +func (r ApiUpdateCurrentUserRequest) UserUpdateInput(userUpdateInput UserUpdateInput) ApiUpdateCurrentUserRequest { + r.userUpdateInput = &userUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateCurrentUserRequest) Include(include []string) ApiUpdateCurrentUserRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateCurrentUserRequest) Exclude(exclude []string) ApiUpdateCurrentUserRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateCurrentUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.UpdateCurrentUserExecute(r) +} + +/* +UpdateCurrentUser Update the current user + +Updates the currently logged-in user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdateCurrentUserRequest +*/ +func (a *UsersApiService) UpdateCurrentUser(ctx context.Context) ApiUpdateCurrentUserRequest { + return ApiUpdateCurrentUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return User +func (a *UsersApiService) UpdateCurrentUserExecute(r ApiUpdateCurrentUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.UpdateCurrentUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userUpdateInput == nil { + return localVarReturnValue, nil, reportError("userUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_vlans.go b/services/metalv1/api_vlans.go new file mode 100644 index 00000000..bd3bab16 --- /dev/null +++ b/services/metalv1/api_vlans.go @@ -0,0 +1,770 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// VLANsApiService VLANsApi service +type VLANsApiService service + +type ApiCreateVirtualNetworkRequest struct { + ctx context.Context + ApiService *VLANsApiService + id string + virtualNetworkCreateInput *VirtualNetworkCreateInput + include *[]string + exclude *[]string +} + +// Virtual Network to create +func (r ApiCreateVirtualNetworkRequest) VirtualNetworkCreateInput(virtualNetworkCreateInput VirtualNetworkCreateInput) ApiCreateVirtualNetworkRequest { + r.virtualNetworkCreateInput = &virtualNetworkCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateVirtualNetworkRequest) Include(include []string) ApiCreateVirtualNetworkRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateVirtualNetworkRequest) Exclude(exclude []string) ApiCreateVirtualNetworkRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateVirtualNetworkRequest) Execute() (*VirtualNetwork, *http.Response, error) { + return r.ApiService.CreateVirtualNetworkExecute(r) +} + +/* +CreateVirtualNetwork Create a virtual network + +Creates an virtual network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateVirtualNetworkRequest +*/ +func (a *VLANsApiService) CreateVirtualNetwork(ctx context.Context, id string) ApiCreateVirtualNetworkRequest { + return ApiCreateVirtualNetworkRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualNetwork +func (a *VLANsApiService) CreateVirtualNetworkExecute(r ApiCreateVirtualNetworkRequest) (*VirtualNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VLANsApiService.CreateVirtualNetwork") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/virtual-networks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.virtualNetworkCreateInput == nil { + return localVarReturnValue, nil, reportError("virtualNetworkCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.virtualNetworkCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteVirtualNetworkRequest struct { + ctx context.Context + ApiService *VLANsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteVirtualNetworkRequest) Include(include []string) ApiDeleteVirtualNetworkRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteVirtualNetworkRequest) Exclude(exclude []string) ApiDeleteVirtualNetworkRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteVirtualNetworkRequest) Execute() (*VirtualNetwork, *http.Response, error) { + return r.ApiService.DeleteVirtualNetworkExecute(r) +} + +/* +DeleteVirtualNetwork Delete a virtual network + +Deletes a virtual network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Network UUID + @return ApiDeleteVirtualNetworkRequest +*/ +func (a *VLANsApiService) DeleteVirtualNetwork(ctx context.Context, id string) ApiDeleteVirtualNetworkRequest { + return ApiDeleteVirtualNetworkRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualNetwork +func (a *VLANsApiService) DeleteVirtualNetworkExecute(r ApiDeleteVirtualNetworkRequest) (*VirtualNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VLANsApiService.DeleteVirtualNetwork") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-networks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVirtualNetworksRequest struct { + ctx context.Context + ApiService *VLANsApiService + id string + include *[]string + exclude *[]string + facility *string + metro *string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVirtualNetworksRequest) Include(include []string) ApiFindVirtualNetworksRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVirtualNetworksRequest) Exclude(exclude []string) ApiFindVirtualNetworksRequest { + r.exclude = &exclude + return r +} + +// Filter by Facility ID (uuid) or Facility Code +// Deprecated +func (r ApiFindVirtualNetworksRequest) Facility(facility string) ApiFindVirtualNetworksRequest { + r.facility = &facility + return r +} + +// Filter by Metro ID (uuid) or Metro Code +func (r ApiFindVirtualNetworksRequest) Metro(metro string) ApiFindVirtualNetworksRequest { + r.metro = &metro + return r +} + +func (r ApiFindVirtualNetworksRequest) Execute() (*VirtualNetworkList, *http.Response, error) { + return r.ApiService.FindVirtualNetworksExecute(r) +} + +/* +FindVirtualNetworks Retrieve all virtual networks + +Provides a list of virtual networks for a single project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindVirtualNetworksRequest +*/ +func (a *VLANsApiService) FindVirtualNetworks(ctx context.Context, id string) ApiFindVirtualNetworksRequest { + return ApiFindVirtualNetworksRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualNetworkList +func (a *VLANsApiService) FindVirtualNetworksExecute(r ApiFindVirtualNetworksRequest) (*VirtualNetworkList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualNetworkList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VLANsApiService.FindVirtualNetworks") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/virtual-networks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.facility != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "facility", r.facility, "") + } + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVirtualNetworkRequest struct { + ctx context.Context + ApiService *VLANsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetVirtualNetworkRequest) Include(include []string) ApiGetVirtualNetworkRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetVirtualNetworkRequest) Exclude(exclude []string) ApiGetVirtualNetworkRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetVirtualNetworkRequest) Execute() (*VirtualNetwork, *http.Response, error) { + return r.ApiService.GetVirtualNetworkExecute(r) +} + +/* +GetVirtualNetwork Get a virtual network + +Get a virtual network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Virtual Network UUID + @return ApiGetVirtualNetworkRequest +*/ +func (a *VLANsApiService) GetVirtualNetwork(ctx context.Context, id string) ApiGetVirtualNetworkRequest { + return ApiGetVirtualNetworkRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VirtualNetwork +func (a *VLANsApiService) GetVirtualNetworkExecute(r ApiGetVirtualNetworkRequest) (*VirtualNetwork, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VirtualNetwork + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VLANsApiService.GetVirtualNetwork") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/virtual-networks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/api_vrfs.go b/services/metalv1/api_vrfs.go new file mode 100644 index 00000000..7a9d128c --- /dev/null +++ b/services/metalv1/api_vrfs.go @@ -0,0 +1,2767 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// VRFsApiService VRFsApi service +type VRFsApiService service + +type ApiBgpDynamicNeighborsIdGetRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiBgpDynamicNeighborsIdGetRequest) Include(include []string) ApiBgpDynamicNeighborsIdGetRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiBgpDynamicNeighborsIdGetRequest) Exclude(exclude []string) ApiBgpDynamicNeighborsIdGetRequest { + r.exclude = &exclude + return r +} + +func (r ApiBgpDynamicNeighborsIdGetRequest) Execute() (*BgpDynamicNeighbor, *http.Response, error) { + return r.ApiService.BgpDynamicNeighborsIdGetExecute(r) +} + +/* +BgpDynamicNeighborsIdGet Retrieve a BGP Dynamic Neighbor + +Return a single BGP Dynamic Neighbor resource + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id BGP Dynamic Neighbor UUID + @return ApiBgpDynamicNeighborsIdGetRequest +*/ +func (a *VRFsApiService) BgpDynamicNeighborsIdGet(ctx context.Context, id string) ApiBgpDynamicNeighborsIdGetRequest { + return ApiBgpDynamicNeighborsIdGetRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpDynamicNeighbor +func (a *VRFsApiService) BgpDynamicNeighborsIdGetExecute(r ApiBgpDynamicNeighborsIdGetRequest) (*BgpDynamicNeighbor, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpDynamicNeighbor + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.BgpDynamicNeighborsIdGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/bgp-dynamic-neighbors/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateBgpDynamicNeighborRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + bgpDynamicNeighborCreateInput *BgpDynamicNeighborCreateInput + include *[]string + exclude *[]string +} + +func (r ApiCreateBgpDynamicNeighborRequest) BgpDynamicNeighborCreateInput(bgpDynamicNeighborCreateInput BgpDynamicNeighborCreateInput) ApiCreateBgpDynamicNeighborRequest { + r.bgpDynamicNeighborCreateInput = &bgpDynamicNeighborCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateBgpDynamicNeighborRequest) Include(include []string) ApiCreateBgpDynamicNeighborRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateBgpDynamicNeighborRequest) Exclude(exclude []string) ApiCreateBgpDynamicNeighborRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateBgpDynamicNeighborRequest) Execute() (*BgpDynamicNeighbor, *http.Response, error) { + return r.ApiService.CreateBgpDynamicNeighborExecute(r) +} + +/* +CreateBgpDynamicNeighbor Create a VRF BGP Dynamic Neighbor range + +Create a VRF BGP Dynamic Neighbor range. + +BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + +Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiCreateBgpDynamicNeighborRequest +*/ +func (a *VRFsApiService) CreateBgpDynamicNeighbor(ctx context.Context, id string) ApiCreateBgpDynamicNeighborRequest { + return ApiCreateBgpDynamicNeighborRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpDynamicNeighbor +func (a *VRFsApiService) CreateBgpDynamicNeighborExecute(r ApiCreateBgpDynamicNeighborRequest) (*BgpDynamicNeighbor, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpDynamicNeighbor + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.CreateBgpDynamicNeighbor") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}/bgp-dynamic-neighbors" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.bgpDynamicNeighborCreateInput == nil { + return localVarReturnValue, nil, reportError("bgpDynamicNeighborCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.bgpDynamicNeighborCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateVrfRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + vrfCreateInput *VrfCreateInput + include *[]string + exclude *[]string +} + +// VRF to create +func (r ApiCreateVrfRequest) VrfCreateInput(vrfCreateInput VrfCreateInput) ApiCreateVrfRequest { + r.vrfCreateInput = &vrfCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateVrfRequest) Include(include []string) ApiCreateVrfRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateVrfRequest) Exclude(exclude []string) ApiCreateVrfRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateVrfRequest) Execute() (*Vrf, *http.Response, error) { + return r.ApiService.CreateVrfExecute(r) +} + +/* +CreateVrf Create a new VRF in the specified project + +Creates a new VRF in the specified project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiCreateVrfRequest +*/ +func (a *VRFsApiService) CreateVrf(ctx context.Context, id string) ApiCreateVrfRequest { + return ApiCreateVrfRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Vrf +func (a *VRFsApiService) CreateVrfExecute(r ApiCreateVrfRequest) (*Vrf, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Vrf + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.CreateVrf") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/vrfs" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vrfCreateInput == nil { + return localVarReturnValue, nil, reportError("vrfCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vrfCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateVrfRouteRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + vrfRouteCreateInput *VrfRouteCreateInput + include *[]string + exclude *[]string +} + +func (r ApiCreateVrfRouteRequest) VrfRouteCreateInput(vrfRouteCreateInput VrfRouteCreateInput) ApiCreateVrfRouteRequest { + r.vrfRouteCreateInput = &vrfRouteCreateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiCreateVrfRouteRequest) Include(include []string) ApiCreateVrfRouteRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiCreateVrfRouteRequest) Exclude(exclude []string) ApiCreateVrfRouteRequest { + r.exclude = &exclude + return r +} + +func (r ApiCreateVrfRouteRequest) Execute() (*VrfRoute, *http.Response, error) { + return r.ApiService.CreateVrfRouteExecute(r) +} + +/* +CreateVrfRoute Create a VRF route + +Create a route in a VRF. Currently only static default routes are supported. + +Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiCreateVrfRouteRequest +*/ +func (a *VRFsApiService) CreateVrfRoute(ctx context.Context, id string) ApiCreateVrfRouteRequest { + return ApiCreateVrfRouteRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfRoute +func (a *VRFsApiService) CreateVrfRouteExecute(r ApiCreateVrfRouteRequest) (*VrfRoute, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfRoute + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.CreateVrfRoute") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vrfRouteCreateInput == nil { + return localVarReturnValue, nil, reportError("vrfRouteCreateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vrfRouteCreateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteBgpDynamicNeighborByIdRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteBgpDynamicNeighborByIdRequest) Include(include []string) ApiDeleteBgpDynamicNeighborByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteBgpDynamicNeighborByIdRequest) Exclude(exclude []string) ApiDeleteBgpDynamicNeighborByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteBgpDynamicNeighborByIdRequest) Execute() (*BgpDynamicNeighbor, *http.Response, error) { + return r.ApiService.DeleteBgpDynamicNeighborByIdExecute(r) +} + +/* +DeleteBgpDynamicNeighborById Delete a VRF BGP Dynamic Neighbor + +Trigger the removal of a BGP Neighbor range from a VRF + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id BGP Dynamic Neighbor UUID + @return ApiDeleteBgpDynamicNeighborByIdRequest +*/ +func (a *VRFsApiService) DeleteBgpDynamicNeighborById(ctx context.Context, id string) ApiDeleteBgpDynamicNeighborByIdRequest { + return ApiDeleteBgpDynamicNeighborByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpDynamicNeighbor +func (a *VRFsApiService) DeleteBgpDynamicNeighborByIdExecute(r ApiDeleteBgpDynamicNeighborByIdRequest) (*BgpDynamicNeighbor, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpDynamicNeighbor + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.DeleteBgpDynamicNeighborById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/bgp-dynamic-neighbors/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteVrfRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string +} + +func (r ApiDeleteVrfRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteVrfExecute(r) +} + +/* +DeleteVrf Delete the VRF + +Deletes the VRF + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiDeleteVrfRequest +*/ +func (a *VRFsApiService) DeleteVrf(ctx context.Context, id string) ApiDeleteVrfRequest { + return ApiDeleteVrfRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *VRFsApiService) DeleteVrfExecute(r ApiDeleteVrfRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.DeleteVrf") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteVrfRouteByIdRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiDeleteVrfRouteByIdRequest) Include(include []string) ApiDeleteVrfRouteByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiDeleteVrfRouteByIdRequest) Exclude(exclude []string) ApiDeleteVrfRouteByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiDeleteVrfRouteByIdRequest) Execute() (*VrfRoute, *http.Response, error) { + return r.ApiService.DeleteVrfRouteByIdExecute(r) +} + +/* +DeleteVrfRouteById Delete a VRF Route + +Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF Route UUID + @return ApiDeleteVrfRouteByIdRequest +*/ +func (a *VRFsApiService) DeleteVrfRouteById(ctx context.Context, id string) ApiDeleteVrfRouteByIdRequest { + return ApiDeleteVrfRouteByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfRoute +func (a *VRFsApiService) DeleteVrfRouteByIdExecute(r ApiDeleteVrfRouteByIdRequest) (*VrfRoute, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfRoute + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.DeleteVrfRouteById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/routes/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfByIdRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfByIdRequest) Include(include []string) ApiFindVrfByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfByIdRequest) Exclude(exclude []string) ApiFindVrfByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindVrfByIdRequest) Execute() (*Vrf, *http.Response, error) { + return r.ApiService.FindVrfByIdExecute(r) +} + +/* +FindVrfById Retrieve a VRF + +Returns a single VRF resource + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiFindVrfByIdRequest +*/ +func (a *VRFsApiService) FindVrfById(ctx context.Context, id string) ApiFindVrfByIdRequest { + return ApiFindVrfByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Vrf +func (a *VRFsApiService) FindVrfByIdExecute(r ApiFindVrfByIdRequest) (*Vrf, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Vrf + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.FindVrfById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfIpReservationRequest struct { + ctx context.Context + ApiService *VRFsApiService + vrfId string + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfIpReservationRequest) Include(include []string) ApiFindVrfIpReservationRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfIpReservationRequest) Exclude(exclude []string) ApiFindVrfIpReservationRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindVrfIpReservationRequest) Execute() (*VrfIpReservation, *http.Response, error) { + return r.ApiService.FindVrfIpReservationExecute(r) +} + +/* +FindVrfIpReservation Retrieve all VRF IP Reservations in the VRF + +Returns the IP Reservation for the VRF. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vrfId VRF UUID + @param id IP UUID + @return ApiFindVrfIpReservationRequest +*/ +func (a *VRFsApiService) FindVrfIpReservation(ctx context.Context, vrfId string, id string) ApiFindVrfIpReservationRequest { + return ApiFindVrfIpReservationRequest{ + ApiService: a, + ctx: ctx, + vrfId: vrfId, + id: id, + } +} + +// Execute executes the request +// +// @return VrfIpReservation +func (a *VRFsApiService) FindVrfIpReservationExecute(r ApiFindVrfIpReservationRequest) (*VrfIpReservation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfIpReservation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.FindVrfIpReservation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{vrf_id}/ips/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"vrf_id"+"}", url.PathEscape(parameterValueToString(r.vrfId, "vrfId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfIpReservationsRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfIpReservationsRequest) Include(include []string) ApiFindVrfIpReservationsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfIpReservationsRequest) Exclude(exclude []string) ApiFindVrfIpReservationsRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindVrfIpReservationsRequest) Execute() (*VrfIpReservationList, *http.Response, error) { + return r.ApiService.FindVrfIpReservationsExecute(r) +} + +/* +FindVrfIpReservations Retrieve all VRF IP Reservations in the VRF + +Returns the list of VRF IP Reservations for the VRF. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiFindVrfIpReservationsRequest +*/ +func (a *VRFsApiService) FindVrfIpReservations(ctx context.Context, id string) ApiFindVrfIpReservationsRequest { + return ApiFindVrfIpReservationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfIpReservationList +func (a *VRFsApiService) FindVrfIpReservationsExecute(r ApiFindVrfIpReservationsRequest) (*VrfIpReservationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfIpReservationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.FindVrfIpReservations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}/ips" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfRouteByIdRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfRouteByIdRequest) Include(include []string) ApiFindVrfRouteByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfRouteByIdRequest) Exclude(exclude []string) ApiFindVrfRouteByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiFindVrfRouteByIdRequest) Execute() (*VrfRoute, *http.Response, error) { + return r.ApiService.FindVrfRouteByIdExecute(r) +} + +/* +FindVrfRouteById Retrieve a VRF Route + +Returns a single VRF Route resource + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF Route UUID + @return ApiFindVrfRouteByIdRequest +*/ +func (a *VRFsApiService) FindVrfRouteById(ctx context.Context, id string) ApiFindVrfRouteByIdRequest { + return ApiFindVrfRouteByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfRoute +func (a *VRFsApiService) FindVrfRouteByIdExecute(r ApiFindVrfRouteByIdRequest) (*VrfRoute, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfRoute + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.FindVrfRouteById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/routes/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFindVrfsRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string + metro *string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiFindVrfsRequest) Include(include []string) ApiFindVrfsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiFindVrfsRequest) Exclude(exclude []string) ApiFindVrfsRequest { + r.exclude = &exclude + return r +} + +// Filter by Metro ID (uuid) or Metro Code +func (r ApiFindVrfsRequest) Metro(metro string) ApiFindVrfsRequest { + r.metro = &metro + return r +} + +func (r ApiFindVrfsRequest) Execute() (*VrfList, *http.Response, error) { + return r.ApiService.FindVrfsExecute(r) +} + +/* +FindVrfs Retrieve all VRFs in the project + +Returns the list of VRFs for a single project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Project UUID + @return ApiFindVrfsRequest +*/ +func (a *VRFsApiService) FindVrfs(ctx context.Context, id string) ApiFindVrfsRequest { + return ApiFindVrfsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfList +func (a *VRFsApiService) FindVrfsExecute(r ApiFindVrfsRequest) (*VrfList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.FindVrfs") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/projects/{id}/vrfs" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + if r.metro != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "metro", r.metro, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetBgpDynamicNeighborsRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetBgpDynamicNeighborsRequest) Include(include []string) ApiGetBgpDynamicNeighborsRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetBgpDynamicNeighborsRequest) Exclude(exclude []string) ApiGetBgpDynamicNeighborsRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetBgpDynamicNeighborsRequest) Execute() (*BgpDynamicNeighborList, *http.Response, error) { + return r.ApiService.GetBgpDynamicNeighborsExecute(r) +} + +/* +GetBgpDynamicNeighbors List BGP Dynamic Neighbors + +Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Metal Gateway UUID + @return ApiGetBgpDynamicNeighborsRequest +*/ +func (a *VRFsApiService) GetBgpDynamicNeighbors(ctx context.Context, id string) ApiGetBgpDynamicNeighborsRequest { + return ApiGetBgpDynamicNeighborsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return BgpDynamicNeighborList +func (a *VRFsApiService) GetBgpDynamicNeighborsExecute(r ApiGetBgpDynamicNeighborsRequest) (*BgpDynamicNeighborList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BgpDynamicNeighborList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.GetBgpDynamicNeighbors") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/metal-gateways/{id}/bgp-dynamic-neighbors" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetVrfRoutesRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + include *[]string + exclude *[]string +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiGetVrfRoutesRequest) Include(include []string) ApiGetVrfRoutesRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiGetVrfRoutesRequest) Exclude(exclude []string) ApiGetVrfRoutesRequest { + r.exclude = &exclude + return r +} + +func (r ApiGetVrfRoutesRequest) Execute() (*VrfRouteList, *http.Response, error) { + return r.ApiService.GetVrfRoutesExecute(r) +} + +/* +GetVrfRoutes Retrieve all routes in the VRF + +Returns the list of routes for the VRF + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiGetVrfRoutesRequest +*/ +func (a *VRFsApiService) GetVrfRoutes(ctx context.Context, id string) ApiGetVrfRoutesRequest { + return ApiGetVrfRoutesRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfRouteList +func (a *VRFsApiService) GetVrfRoutesExecute(r ApiGetVrfRoutesRequest) (*VrfRouteList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfRouteList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.GetVrfRoutes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateVrfRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + vrfUpdateInput *VrfUpdateInput + include *[]string + exclude *[]string +} + +// VRF to update +func (r ApiUpdateVrfRequest) VrfUpdateInput(vrfUpdateInput VrfUpdateInput) ApiUpdateVrfRequest { + r.vrfUpdateInput = &vrfUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateVrfRequest) Include(include []string) ApiUpdateVrfRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateVrfRequest) Exclude(exclude []string) ApiUpdateVrfRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateVrfRequest) Execute() (*Vrf, *http.Response, error) { + return r.ApiService.UpdateVrfExecute(r) +} + +/* +UpdateVrf Update the VRF + +Updates the VRF. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF UUID + @return ApiUpdateVrfRequest +*/ +func (a *VRFsApiService) UpdateVrf(ctx context.Context, id string) ApiUpdateVrfRequest { + return ApiUpdateVrfRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Vrf +func (a *VRFsApiService) UpdateVrfExecute(r ApiUpdateVrfRequest) (*Vrf, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Vrf + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.UpdateVrf") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vrfs/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vrfUpdateInput == nil { + return localVarReturnValue, nil, reportError("vrfUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vrfUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateVrfRouteByIdRequest struct { + ctx context.Context + ApiService *VRFsApiService + id string + vrfRouteUpdateInput *VrfRouteUpdateInput + include *[]string + exclude *[]string +} + +func (r ApiUpdateVrfRouteByIdRequest) VrfRouteUpdateInput(vrfRouteUpdateInput VrfRouteUpdateInput) ApiUpdateVrfRouteByIdRequest { + r.vrfRouteUpdateInput = &vrfRouteUpdateInput + return r +} + +// Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. +func (r ApiUpdateVrfRouteByIdRequest) Include(include []string) ApiUpdateVrfRouteByIdRequest { + r.include = &include + return r +} + +// Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. +func (r ApiUpdateVrfRouteByIdRequest) Exclude(exclude []string) ApiUpdateVrfRouteByIdRequest { + r.exclude = &exclude + return r +} + +func (r ApiUpdateVrfRouteByIdRequest) Execute() (*VrfRoute, *http.Response, error) { + return r.ApiService.UpdateVrfRouteByIdExecute(r) +} + +/* +UpdateVrfRouteById Update a VRF Route + +Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id VRF Route UUID + @return ApiUpdateVrfRouteByIdRequest +*/ +func (a *VRFsApiService) UpdateVrfRouteById(ctx context.Context, id string) ApiUpdateVrfRouteByIdRequest { + return ApiUpdateVrfRouteByIdRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VrfRoute +func (a *VRFsApiService) UpdateVrfRouteByIdExecute(r ApiUpdateVrfRouteByIdRequest) (*VrfRoute, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VrfRoute + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VRFsApiService.UpdateVrfRouteById") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/routes/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.vrfRouteUpdateInput == nil { + return localVarReturnValue, nil, reportError("vrfRouteUpdateInput is required and must be specified") + } + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "csv") + } + if r.exclude != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude", r.exclude, "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.vrfRouteUpdateInput + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["x_auth_token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-Auth-Token"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/services/metalv1/client.go b/services/metalv1/client.go new file mode 100644 index 00000000..ccdfadb9 --- /dev/null +++ b/services/metalv1/client.go @@ -0,0 +1,842 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the Metal API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AuthenticationApi *AuthenticationApiService + + BGPApi *BGPApiService + + BatchesApi *BatchesApiService + + CapacityApi *CapacityApiService + + ConsoleLogDetailsApi *ConsoleLogDetailsApiService + + DevicesApi *DevicesApiService + + EmailsApi *EmailsApiService + + EventsApi *EventsApiService + + FacilitiesApi *FacilitiesApiService + + FirmwareSetsApi *FirmwareSetsApiService + + HardwareReservationsApi *HardwareReservationsApiService + + IPAddressesApi *IPAddressesApiService + + IncidentsApi *IncidentsApiService + + InterconnectionsApi *InterconnectionsApiService + + InvitationsApi *InvitationsApiService + + InvoicesApi *InvoicesApiService + + LicensesApi *LicensesApiService + + MembershipsApi *MembershipsApiService + + MetalGatewaysApi *MetalGatewaysApiService + + MetrosApi *MetrosApiService + + OTPsApi *OTPsApiService + + OperatingSystemsApi *OperatingSystemsApiService + + OrganizationsApi *OrganizationsApiService + + PasswordResetTokensApi *PasswordResetTokensApiService + + PaymentMethodsApi *PaymentMethodsApiService + + PlansApi *PlansApiService + + PortsApi *PortsApiService + + ProjectsApi *ProjectsApiService + + SSHKeysApi *SSHKeysApiService + + SelfServiceReservationsApi *SelfServiceReservationsApiService + + SpotMarketApi *SpotMarketApiService + + SupportRequestApi *SupportRequestApiService + + TransferRequestsApi *TransferRequestsApiService + + TwoFactorAuthApi *TwoFactorAuthApiService + + UsagesApi *UsagesApiService + + UserVerificationTokensApi *UserVerificationTokensApiService + + UserdataApi *UserdataApiService + + UsersApi *UsersApiService + + VLANsApi *VLANsApiService + + VRFsApi *VRFsApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AuthenticationApi = (*AuthenticationApiService)(&c.common) + c.BGPApi = (*BGPApiService)(&c.common) + c.BatchesApi = (*BatchesApiService)(&c.common) + c.CapacityApi = (*CapacityApiService)(&c.common) + c.ConsoleLogDetailsApi = (*ConsoleLogDetailsApiService)(&c.common) + c.DevicesApi = (*DevicesApiService)(&c.common) + c.EmailsApi = (*EmailsApiService)(&c.common) + c.EventsApi = (*EventsApiService)(&c.common) + c.FacilitiesApi = (*FacilitiesApiService)(&c.common) + c.FirmwareSetsApi = (*FirmwareSetsApiService)(&c.common) + c.HardwareReservationsApi = (*HardwareReservationsApiService)(&c.common) + c.IPAddressesApi = (*IPAddressesApiService)(&c.common) + c.IncidentsApi = (*IncidentsApiService)(&c.common) + c.InterconnectionsApi = (*InterconnectionsApiService)(&c.common) + c.InvitationsApi = (*InvitationsApiService)(&c.common) + c.InvoicesApi = (*InvoicesApiService)(&c.common) + c.LicensesApi = (*LicensesApiService)(&c.common) + c.MembershipsApi = (*MembershipsApiService)(&c.common) + c.MetalGatewaysApi = (*MetalGatewaysApiService)(&c.common) + c.MetrosApi = (*MetrosApiService)(&c.common) + c.OTPsApi = (*OTPsApiService)(&c.common) + c.OperatingSystemsApi = (*OperatingSystemsApiService)(&c.common) + c.OrganizationsApi = (*OrganizationsApiService)(&c.common) + c.PasswordResetTokensApi = (*PasswordResetTokensApiService)(&c.common) + c.PaymentMethodsApi = (*PaymentMethodsApiService)(&c.common) + c.PlansApi = (*PlansApiService)(&c.common) + c.PortsApi = (*PortsApiService)(&c.common) + c.ProjectsApi = (*ProjectsApiService)(&c.common) + c.SSHKeysApi = (*SSHKeysApiService)(&c.common) + c.SelfServiceReservationsApi = (*SelfServiceReservationsApiService)(&c.common) + c.SpotMarketApi = (*SpotMarketApiService)(&c.common) + c.SupportRequestApi = (*SupportRequestApiService)(&c.common) + c.TransferRequestsApi = (*TransferRequestsApiService)(&c.common) + c.TwoFactorAuthApi = (*TwoFactorAuthApiService)(&c.common) + c.UsagesApi = (*UsagesApiService)(&c.common) + c.UserVerificationTokensApi = (*UserVerificationTokensApiService)(&c.common) + c.UserdataApi = (*UserdataApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + c.VLANsApi = (*VLANsApiService)(&c.common) + c.VRFsApi = (*VRFsApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + authToken, hasAuth := request.Header["X-Auth-Token"] + if hasAuth { + request.Header.Set("X-Auth-Token", "**REDACTED**") + } + + dump, err := httputil.DumpRequestOut(request, true) + + if hasAuth { + request.Header["X-Auth-Token"] = authToken + } + + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + dumpDeprecation(resp) + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model is an instance of +// the Error component schema or when it implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + errorModel, ok := v.(*Error) + + if ok { + errs := []string{} + errs = append(errs, errorModel.GetErrors()...) + if errorModel.GetError() != "" { + errs = append(errs, errorModel.GetError()) + } + str = strings.Join(errs, ", ") + } else { + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} + +// dumpDeprecation logs headers defined by +// https://tools.ietf.org/html/rfc8594 +// copied from https://github.com/packngo +// for backwards compatibility +func dumpDeprecation(resp *http.Response) { + uri := "" + if resp.Request != nil { + uri = resp.Request.Method + " " + resp.Request.URL.Path + } + + deprecation := resp.Header.Get("Deprecation") + if deprecation != "" { + if deprecation == "true" { + deprecation = "" + } else { + deprecation = " on " + deprecation + } + log.Printf("WARNING: %q reported deprecation%s", uri, deprecation) + } + + sunset := resp.Header.Get("Sunset") + if sunset != "" { + log.Printf("WARNING: %q reported sunsetting on %s", uri, sunset) + } + + links := resp.Header.Values("Link") + + for _, s := range links { + for _, ss := range strings.Split(s, ",") { + if strings.Contains(ss, "rel=\"sunset\"") { + link := strings.Split(ss, ";")[0] + log.Printf("WARNING: See %s for sunset details", link) + } else if strings.Contains(ss, "rel=\"deprecation\"") { + link := strings.Split(ss, ";")[0] + log.Printf("WARNING: See %s for deprecation details", link) + } + } + } +} diff --git a/services/metalv1/configuration.go b/services/metalv1/configuration.go new file mode 100644 index 00000000..8370460e --- /dev/null +++ b/services/metalv1/configuration.go @@ -0,0 +1,218 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "equinix-sdk-go/", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://api.equinix.com/metal/v1", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/services/metalv1/docs/ActivateHardwareReservationRequest.md b/services/metalv1/docs/ActivateHardwareReservationRequest.md new file mode 100644 index 00000000..9fe748b4 --- /dev/null +++ b/services/metalv1/docs/ActivateHardwareReservationRequest.md @@ -0,0 +1,56 @@ +# ActivateHardwareReservationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] + +## Methods + +### NewActivateHardwareReservationRequest + +`func NewActivateHardwareReservationRequest() *ActivateHardwareReservationRequest` + +NewActivateHardwareReservationRequest instantiates a new ActivateHardwareReservationRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActivateHardwareReservationRequestWithDefaults + +`func NewActivateHardwareReservationRequestWithDefaults() *ActivateHardwareReservationRequest` + +NewActivateHardwareReservationRequestWithDefaults instantiates a new ActivateHardwareReservationRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *ActivateHardwareReservationRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *ActivateHardwareReservationRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *ActivateHardwareReservationRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *ActivateHardwareReservationRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Address.md b/services/metalv1/docs/Address.md new file mode 100644 index 00000000..e4848283 --- /dev/null +++ b/services/metalv1/docs/Address.md @@ -0,0 +1,197 @@ +# Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Address2** | Pointer to **string** | | [optional] +**City** | Pointer to **string** | | [optional] +**Coordinates** | Pointer to [**Coordinates**](Coordinates.md) | | [optional] +**Country** | **string** | | +**State** | Pointer to **string** | | [optional] +**ZipCode** | **string** | | + +## Methods + +### NewAddress + +`func NewAddress(address string, country string, zipCode string, ) *Address` + +NewAddress instantiates a new Address object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddressWithDefaults + +`func NewAddressWithDefaults() *Address` + +NewAddressWithDefaults instantiates a new Address object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *Address) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Address) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Address) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetAddress2 + +`func (o *Address) GetAddress2() string` + +GetAddress2 returns the Address2 field if non-nil, zero value otherwise. + +### GetAddress2Ok + +`func (o *Address) GetAddress2Ok() (*string, bool)` + +GetAddress2Ok returns a tuple with the Address2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress2 + +`func (o *Address) SetAddress2(v string)` + +SetAddress2 sets Address2 field to given value. + +### HasAddress2 + +`func (o *Address) HasAddress2() bool` + +HasAddress2 returns a boolean if a field has been set. + +### GetCity + +`func (o *Address) GetCity() string` + +GetCity returns the City field if non-nil, zero value otherwise. + +### GetCityOk + +`func (o *Address) GetCityOk() (*string, bool)` + +GetCityOk returns a tuple with the City field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCity + +`func (o *Address) SetCity(v string)` + +SetCity sets City field to given value. + +### HasCity + +`func (o *Address) HasCity() bool` + +HasCity returns a boolean if a field has been set. + +### GetCoordinates + +`func (o *Address) GetCoordinates() Coordinates` + +GetCoordinates returns the Coordinates field if non-nil, zero value otherwise. + +### GetCoordinatesOk + +`func (o *Address) GetCoordinatesOk() (*Coordinates, bool)` + +GetCoordinatesOk returns a tuple with the Coordinates field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoordinates + +`func (o *Address) SetCoordinates(v Coordinates)` + +SetCoordinates sets Coordinates field to given value. + +### HasCoordinates + +`func (o *Address) HasCoordinates() bool` + +HasCoordinates returns a boolean if a field has been set. + +### GetCountry + +`func (o *Address) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *Address) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *Address) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetState + +`func (o *Address) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Address) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Address) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *Address) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetZipCode + +`func (o *Address) GetZipCode() string` + +GetZipCode returns the ZipCode field if non-nil, zero value otherwise. + +### GetZipCodeOk + +`func (o *Address) GetZipCodeOk() (*string, bool)` + +GetZipCodeOk returns a tuple with the ZipCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetZipCode + +`func (o *Address) SetZipCode(v string)` + +SetZipCode sets ZipCode field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Attribute.md b/services/metalv1/docs/Attribute.md new file mode 100644 index 00000000..4358a7d7 --- /dev/null +++ b/services/metalv1/docs/Attribute.md @@ -0,0 +1,134 @@ +# Attribute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Namespace** | Pointer to **string** | Attribute namespace | [optional] [readonly] +**CreatedAt** | Pointer to **time.Time** | Datetime when the block was created. | [optional] [readonly] +**UpdatedAt** | Pointer to **time.Time** | Datetime when the block was updated. | [optional] [readonly] +**Data** | Pointer to [**AttributeData**](AttributeData.md) | | [optional] + +## Methods + +### NewAttribute + +`func NewAttribute() *Attribute` + +NewAttribute instantiates a new Attribute object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAttributeWithDefaults + +`func NewAttributeWithDefaults() *Attribute` + +NewAttributeWithDefaults instantiates a new Attribute object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNamespace + +`func (o *Attribute) GetNamespace() string` + +GetNamespace returns the Namespace field if non-nil, zero value otherwise. + +### GetNamespaceOk + +`func (o *Attribute) GetNamespaceOk() (*string, bool)` + +GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespace + +`func (o *Attribute) SetNamespace(v string)` + +SetNamespace sets Namespace field to given value. + +### HasNamespace + +`func (o *Attribute) HasNamespace() bool` + +HasNamespace returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Attribute) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Attribute) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Attribute) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Attribute) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Attribute) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Attribute) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Attribute) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Attribute) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetData + +`func (o *Attribute) GetData() AttributeData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *Attribute) GetDataOk() (*AttributeData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *Attribute) SetData(v AttributeData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *Attribute) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AttributeData.md b/services/metalv1/docs/AttributeData.md new file mode 100644 index 00000000..12309cab --- /dev/null +++ b/services/metalv1/docs/AttributeData.md @@ -0,0 +1,134 @@ +# AttributeData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Latest** | Pointer to **bool** | Boolean flag to know if the firmware set is the latest for the model and vendor | [optional] [readonly] +**Model** | Pointer to **string** | Model on which this firmware set can be applied | [optional] [readonly] +**Vendor** | Pointer to **string** | Vendor on which this firmware set can be applied | [optional] [readonly] +**Plan** | Pointer to **string** | Plan where the firmware set can be applied | [optional] [readonly] + +## Methods + +### NewAttributeData + +`func NewAttributeData() *AttributeData` + +NewAttributeData instantiates a new AttributeData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAttributeDataWithDefaults + +`func NewAttributeDataWithDefaults() *AttributeData` + +NewAttributeDataWithDefaults instantiates a new AttributeData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLatest + +`func (o *AttributeData) GetLatest() bool` + +GetLatest returns the Latest field if non-nil, zero value otherwise. + +### GetLatestOk + +`func (o *AttributeData) GetLatestOk() (*bool, bool)` + +GetLatestOk returns a tuple with the Latest field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLatest + +`func (o *AttributeData) SetLatest(v bool)` + +SetLatest sets Latest field to given value. + +### HasLatest + +`func (o *AttributeData) HasLatest() bool` + +HasLatest returns a boolean if a field has been set. + +### GetModel + +`func (o *AttributeData) GetModel() string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *AttributeData) GetModelOk() (*string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *AttributeData) SetModel(v string)` + +SetModel sets Model field to given value. + +### HasModel + +`func (o *AttributeData) HasModel() bool` + +HasModel returns a boolean if a field has been set. + +### GetVendor + +`func (o *AttributeData) GetVendor() string` + +GetVendor returns the Vendor field if non-nil, zero value otherwise. + +### GetVendorOk + +`func (o *AttributeData) GetVendorOk() (*string, bool)` + +GetVendorOk returns a tuple with the Vendor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVendor + +`func (o *AttributeData) SetVendor(v string)` + +SetVendor sets Vendor field to given value. + +### HasVendor + +`func (o *AttributeData) HasVendor() bool` + +HasVendor returns a boolean if a field has been set. + +### GetPlan + +`func (o *AttributeData) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *AttributeData) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *AttributeData) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *AttributeData) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthToken.md b/services/metalv1/docs/AuthToken.md new file mode 100644 index 00000000..5661d65a --- /dev/null +++ b/services/metalv1/docs/AuthToken.md @@ -0,0 +1,238 @@ +# AuthToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Description** | Pointer to **string** | Available only for API keys | [optional] +**Id** | Pointer to **string** | | [optional] +**Project** | Pointer to [**AuthTokenProject**](AuthTokenProject.md) | | [optional] +**ReadOnly** | Pointer to **bool** | | [optional] +**Token** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**User** | Pointer to [**AuthTokenUser**](AuthTokenUser.md) | | [optional] + +## Methods + +### NewAuthToken + +`func NewAuthToken() *AuthToken` + +NewAuthToken instantiates a new AuthToken object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthTokenWithDefaults + +`func NewAuthTokenWithDefaults() *AuthToken` + +NewAuthTokenWithDefaults instantiates a new AuthToken object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *AuthToken) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AuthToken) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AuthToken) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AuthToken) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDescription + +`func (o *AuthToken) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *AuthToken) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *AuthToken) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *AuthToken) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetId + +`func (o *AuthToken) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *AuthToken) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *AuthToken) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *AuthToken) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProject + +`func (o *AuthToken) GetProject() AuthTokenProject` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *AuthToken) GetProjectOk() (*AuthTokenProject, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *AuthToken) SetProject(v AuthTokenProject)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *AuthToken) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetReadOnly + +`func (o *AuthToken) GetReadOnly() bool` + +GetReadOnly returns the ReadOnly field if non-nil, zero value otherwise. + +### GetReadOnlyOk + +`func (o *AuthToken) GetReadOnlyOk() (*bool, bool)` + +GetReadOnlyOk returns a tuple with the ReadOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadOnly + +`func (o *AuthToken) SetReadOnly(v bool)` + +SetReadOnly sets ReadOnly field to given value. + +### HasReadOnly + +`func (o *AuthToken) HasReadOnly() bool` + +HasReadOnly returns a boolean if a field has been set. + +### GetToken + +`func (o *AuthToken) GetToken() string` + +GetToken returns the Token field if non-nil, zero value otherwise. + +### GetTokenOk + +`func (o *AuthToken) GetTokenOk() (*string, bool)` + +GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToken + +`func (o *AuthToken) SetToken(v string)` + +SetToken sets Token field to given value. + +### HasToken + +`func (o *AuthToken) HasToken() bool` + +HasToken returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *AuthToken) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *AuthToken) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *AuthToken) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *AuthToken) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetUser + +`func (o *AuthToken) GetUser() AuthTokenUser` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *AuthToken) GetUserOk() (*AuthTokenUser, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *AuthToken) SetUser(v AuthTokenUser)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *AuthToken) HasUser() bool` + +HasUser returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthTokenInput.md b/services/metalv1/docs/AuthTokenInput.md new file mode 100644 index 00000000..e736b13e --- /dev/null +++ b/services/metalv1/docs/AuthTokenInput.md @@ -0,0 +1,82 @@ +# AuthTokenInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**ReadOnly** | Pointer to **bool** | | [optional] + +## Methods + +### NewAuthTokenInput + +`func NewAuthTokenInput() *AuthTokenInput` + +NewAuthTokenInput instantiates a new AuthTokenInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthTokenInputWithDefaults + +`func NewAuthTokenInputWithDefaults() *AuthTokenInput` + +NewAuthTokenInputWithDefaults instantiates a new AuthTokenInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *AuthTokenInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *AuthTokenInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *AuthTokenInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *AuthTokenInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetReadOnly + +`func (o *AuthTokenInput) GetReadOnly() bool` + +GetReadOnly returns the ReadOnly field if non-nil, zero value otherwise. + +### GetReadOnlyOk + +`func (o *AuthTokenInput) GetReadOnlyOk() (*bool, bool)` + +GetReadOnlyOk returns a tuple with the ReadOnly field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReadOnly + +`func (o *AuthTokenInput) SetReadOnly(v bool)` + +SetReadOnly sets ReadOnly field to given value. + +### HasReadOnly + +`func (o *AuthTokenInput) HasReadOnly() bool` + +HasReadOnly returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthTokenList.md b/services/metalv1/docs/AuthTokenList.md new file mode 100644 index 00000000..66132b13 --- /dev/null +++ b/services/metalv1/docs/AuthTokenList.md @@ -0,0 +1,56 @@ +# AuthTokenList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApiKeys** | Pointer to [**[]AuthToken**](AuthToken.md) | | [optional] + +## Methods + +### NewAuthTokenList + +`func NewAuthTokenList() *AuthTokenList` + +NewAuthTokenList instantiates a new AuthTokenList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthTokenListWithDefaults + +`func NewAuthTokenListWithDefaults() *AuthTokenList` + +NewAuthTokenListWithDefaults instantiates a new AuthTokenList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApiKeys + +`func (o *AuthTokenList) GetApiKeys() []AuthToken` + +GetApiKeys returns the ApiKeys field if non-nil, zero value otherwise. + +### GetApiKeysOk + +`func (o *AuthTokenList) GetApiKeysOk() (*[]AuthToken, bool)` + +GetApiKeysOk returns a tuple with the ApiKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApiKeys + +`func (o *AuthTokenList) SetApiKeys(v []AuthToken)` + +SetApiKeys sets ApiKeys field to given value. + +### HasApiKeys + +`func (o *AuthTokenList) HasApiKeys() bool` + +HasApiKeys returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthTokenProject.md b/services/metalv1/docs/AuthTokenProject.md new file mode 100644 index 00000000..eaf113d2 --- /dev/null +++ b/services/metalv1/docs/AuthTokenProject.md @@ -0,0 +1,524 @@ +# AuthTokenProject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpConfig** | Pointer to [**Href**](Href.md) | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Devices** | Pointer to [**[]Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Invitations** | Pointer to [**[]Href**](Href.md) | | [optional] +**MaxDevices** | Pointer to **map[string]interface{}** | | [optional] +**Members** | Pointer to [**[]Href**](Href.md) | | [optional] +**Memberships** | Pointer to [**[]Href**](Href.md) | | [optional] +**Name** | Pointer to **string** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**NetworkStatus** | Pointer to **map[string]interface{}** | | [optional] +**Organization** | Pointer to [**Organization**](Organization.md) | | [optional] +**PaymentMethod** | Pointer to [**Href**](Href.md) | | [optional] +**SshKeys** | Pointer to [**[]Href**](Href.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Volumes** | Pointer to [**[]Href**](Href.md) | | [optional] +**Type** | Pointer to [**ProjectType**](ProjectType.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewAuthTokenProject + +`func NewAuthTokenProject() *AuthTokenProject` + +NewAuthTokenProject instantiates a new AuthTokenProject object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthTokenProjectWithDefaults + +`func NewAuthTokenProjectWithDefaults() *AuthTokenProject` + +NewAuthTokenProjectWithDefaults instantiates a new AuthTokenProject object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpConfig + +`func (o *AuthTokenProject) GetBgpConfig() Href` + +GetBgpConfig returns the BgpConfig field if non-nil, zero value otherwise. + +### GetBgpConfigOk + +`func (o *AuthTokenProject) GetBgpConfigOk() (*Href, bool)` + +GetBgpConfigOk returns a tuple with the BgpConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpConfig + +`func (o *AuthTokenProject) SetBgpConfig(v Href)` + +SetBgpConfig sets BgpConfig field to given value. + +### HasBgpConfig + +`func (o *AuthTokenProject) HasBgpConfig() bool` + +HasBgpConfig returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AuthTokenProject) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AuthTokenProject) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AuthTokenProject) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AuthTokenProject) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *AuthTokenProject) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *AuthTokenProject) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *AuthTokenProject) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *AuthTokenProject) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDevices + +`func (o *AuthTokenProject) GetDevices() []Href` + +GetDevices returns the Devices field if non-nil, zero value otherwise. + +### GetDevicesOk + +`func (o *AuthTokenProject) GetDevicesOk() (*[]Href, bool)` + +GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevices + +`func (o *AuthTokenProject) SetDevices(v []Href)` + +SetDevices sets Devices field to given value. + +### HasDevices + +`func (o *AuthTokenProject) HasDevices() bool` + +HasDevices returns a boolean if a field has been set. + +### GetHref + +`func (o *AuthTokenProject) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *AuthTokenProject) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *AuthTokenProject) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *AuthTokenProject) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *AuthTokenProject) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *AuthTokenProject) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *AuthTokenProject) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *AuthTokenProject) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInvitations + +`func (o *AuthTokenProject) GetInvitations() []Href` + +GetInvitations returns the Invitations field if non-nil, zero value otherwise. + +### GetInvitationsOk + +`func (o *AuthTokenProject) GetInvitationsOk() (*[]Href, bool)` + +GetInvitationsOk returns a tuple with the Invitations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitations + +`func (o *AuthTokenProject) SetInvitations(v []Href)` + +SetInvitations sets Invitations field to given value. + +### HasInvitations + +`func (o *AuthTokenProject) HasInvitations() bool` + +HasInvitations returns a boolean if a field has been set. + +### GetMaxDevices + +`func (o *AuthTokenProject) GetMaxDevices() map[string]interface{}` + +GetMaxDevices returns the MaxDevices field if non-nil, zero value otherwise. + +### GetMaxDevicesOk + +`func (o *AuthTokenProject) GetMaxDevicesOk() (*map[string]interface{}, bool)` + +GetMaxDevicesOk returns a tuple with the MaxDevices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxDevices + +`func (o *AuthTokenProject) SetMaxDevices(v map[string]interface{})` + +SetMaxDevices sets MaxDevices field to given value. + +### HasMaxDevices + +`func (o *AuthTokenProject) HasMaxDevices() bool` + +HasMaxDevices returns a boolean if a field has been set. + +### GetMembers + +`func (o *AuthTokenProject) GetMembers() []Href` + +GetMembers returns the Members field if non-nil, zero value otherwise. + +### GetMembersOk + +`func (o *AuthTokenProject) GetMembersOk() (*[]Href, bool)` + +GetMembersOk returns a tuple with the Members field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembers + +`func (o *AuthTokenProject) SetMembers(v []Href)` + +SetMembers sets Members field to given value. + +### HasMembers + +`func (o *AuthTokenProject) HasMembers() bool` + +HasMembers returns a boolean if a field has been set. + +### GetMemberships + +`func (o *AuthTokenProject) GetMemberships() []Href` + +GetMemberships returns the Memberships field if non-nil, zero value otherwise. + +### GetMembershipsOk + +`func (o *AuthTokenProject) GetMembershipsOk() (*[]Href, bool)` + +GetMembershipsOk returns a tuple with the Memberships field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberships + +`func (o *AuthTokenProject) SetMemberships(v []Href)` + +SetMemberships sets Memberships field to given value. + +### HasMemberships + +`func (o *AuthTokenProject) HasMemberships() bool` + +HasMemberships returns a boolean if a field has been set. + +### GetName + +`func (o *AuthTokenProject) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *AuthTokenProject) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *AuthTokenProject) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *AuthTokenProject) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNetworkStatus + +`func (o *AuthTokenProject) GetNetworkStatus() map[string]interface{}` + +GetNetworkStatus returns the NetworkStatus field if non-nil, zero value otherwise. + +### GetNetworkStatusOk + +`func (o *AuthTokenProject) GetNetworkStatusOk() (*map[string]interface{}, bool)` + +GetNetworkStatusOk returns a tuple with the NetworkStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkStatus + +`func (o *AuthTokenProject) SetNetworkStatus(v map[string]interface{})` + +SetNetworkStatus sets NetworkStatus field to given value. + +### HasNetworkStatus + +`func (o *AuthTokenProject) HasNetworkStatus() bool` + +HasNetworkStatus returns a boolean if a field has been set. + +### GetOrganization + +`func (o *AuthTokenProject) GetOrganization() Organization` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *AuthTokenProject) GetOrganizationOk() (*Organization, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *AuthTokenProject) SetOrganization(v Organization)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *AuthTokenProject) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *AuthTokenProject) GetPaymentMethod() Href` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *AuthTokenProject) GetPaymentMethodOk() (*Href, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *AuthTokenProject) SetPaymentMethod(v Href)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *AuthTokenProject) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *AuthTokenProject) GetSshKeys() []Href` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *AuthTokenProject) GetSshKeysOk() (*[]Href, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *AuthTokenProject) SetSshKeys(v []Href)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *AuthTokenProject) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *AuthTokenProject) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *AuthTokenProject) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *AuthTokenProject) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *AuthTokenProject) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVolumes + +`func (o *AuthTokenProject) GetVolumes() []Href` + +GetVolumes returns the Volumes field if non-nil, zero value otherwise. + +### GetVolumesOk + +`func (o *AuthTokenProject) GetVolumesOk() (*[]Href, bool)` + +GetVolumesOk returns a tuple with the Volumes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumes + +`func (o *AuthTokenProject) SetVolumes(v []Href)` + +SetVolumes sets Volumes field to given value. + +### HasVolumes + +`func (o *AuthTokenProject) HasVolumes() bool` + +HasVolumes returns a boolean if a field has been set. + +### GetType + +`func (o *AuthTokenProject) GetType() ProjectType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *AuthTokenProject) GetTypeOk() (*ProjectType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *AuthTokenProject) SetType(v ProjectType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *AuthTokenProject) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetTags + +`func (o *AuthTokenProject) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *AuthTokenProject) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *AuthTokenProject) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *AuthTokenProject) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthTokenUser.md b/services/metalv1/docs/AuthTokenUser.md new file mode 100644 index 00000000..61729f62 --- /dev/null +++ b/services/metalv1/docs/AuthTokenUser.md @@ -0,0 +1,602 @@ +# AuthTokenUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvatarThumbUrl** | Pointer to **string** | | [optional] +**AvatarUrl** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**DefaultOrganizationId** | Pointer to **string** | | [optional] +**DefaultProjectId** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Emails** | Pointer to [**[]Href**](Href.md) | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**FraudScore** | Pointer to **string** | | [optional] +**FullName** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**LastLoginAt** | Pointer to **time.Time** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**MaxOrganizations** | Pointer to **int32** | | [optional] +**MaxProjects** | Pointer to **int32** | | [optional] +**PhoneNumber** | Pointer to **string** | | [optional] +**ShortId** | Pointer to **string** | | [optional] +**Timezone** | Pointer to **string** | | [optional] +**TwoFactorAuth** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewAuthTokenUser + +`func NewAuthTokenUser() *AuthTokenUser` + +NewAuthTokenUser instantiates a new AuthTokenUser object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAuthTokenUserWithDefaults + +`func NewAuthTokenUserWithDefaults() *AuthTokenUser` + +NewAuthTokenUserWithDefaults instantiates a new AuthTokenUser object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatarThumbUrl + +`func (o *AuthTokenUser) GetAvatarThumbUrl() string` + +GetAvatarThumbUrl returns the AvatarThumbUrl field if non-nil, zero value otherwise. + +### GetAvatarThumbUrlOk + +`func (o *AuthTokenUser) GetAvatarThumbUrlOk() (*string, bool)` + +GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarThumbUrl + +`func (o *AuthTokenUser) SetAvatarThumbUrl(v string)` + +SetAvatarThumbUrl sets AvatarThumbUrl field to given value. + +### HasAvatarThumbUrl + +`func (o *AuthTokenUser) HasAvatarThumbUrl() bool` + +HasAvatarThumbUrl returns a boolean if a field has been set. + +### GetAvatarUrl + +`func (o *AuthTokenUser) GetAvatarUrl() string` + +GetAvatarUrl returns the AvatarUrl field if non-nil, zero value otherwise. + +### GetAvatarUrlOk + +`func (o *AuthTokenUser) GetAvatarUrlOk() (*string, bool)` + +GetAvatarUrlOk returns a tuple with the AvatarUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarUrl + +`func (o *AuthTokenUser) SetAvatarUrl(v string)` + +SetAvatarUrl sets AvatarUrl field to given value. + +### HasAvatarUrl + +`func (o *AuthTokenUser) HasAvatarUrl() bool` + +HasAvatarUrl returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AuthTokenUser) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AuthTokenUser) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AuthTokenUser) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AuthTokenUser) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *AuthTokenUser) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *AuthTokenUser) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *AuthTokenUser) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *AuthTokenUser) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDefaultOrganizationId + +`func (o *AuthTokenUser) GetDefaultOrganizationId() string` + +GetDefaultOrganizationId returns the DefaultOrganizationId field if non-nil, zero value otherwise. + +### GetDefaultOrganizationIdOk + +`func (o *AuthTokenUser) GetDefaultOrganizationIdOk() (*string, bool)` + +GetDefaultOrganizationIdOk returns a tuple with the DefaultOrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultOrganizationId + +`func (o *AuthTokenUser) SetDefaultOrganizationId(v string)` + +SetDefaultOrganizationId sets DefaultOrganizationId field to given value. + +### HasDefaultOrganizationId + +`func (o *AuthTokenUser) HasDefaultOrganizationId() bool` + +HasDefaultOrganizationId returns a boolean if a field has been set. + +### GetDefaultProjectId + +`func (o *AuthTokenUser) GetDefaultProjectId() string` + +GetDefaultProjectId returns the DefaultProjectId field if non-nil, zero value otherwise. + +### GetDefaultProjectIdOk + +`func (o *AuthTokenUser) GetDefaultProjectIdOk() (*string, bool)` + +GetDefaultProjectIdOk returns a tuple with the DefaultProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultProjectId + +`func (o *AuthTokenUser) SetDefaultProjectId(v string)` + +SetDefaultProjectId sets DefaultProjectId field to given value. + +### HasDefaultProjectId + +`func (o *AuthTokenUser) HasDefaultProjectId() bool` + +HasDefaultProjectId returns a boolean if a field has been set. + +### GetEmail + +`func (o *AuthTokenUser) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *AuthTokenUser) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *AuthTokenUser) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *AuthTokenUser) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetEmails + +`func (o *AuthTokenUser) GetEmails() []Href` + +GetEmails returns the Emails field if non-nil, zero value otherwise. + +### GetEmailsOk + +`func (o *AuthTokenUser) GetEmailsOk() (*[]Href, bool)` + +GetEmailsOk returns a tuple with the Emails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmails + +`func (o *AuthTokenUser) SetEmails(v []Href)` + +SetEmails sets Emails field to given value. + +### HasEmails + +`func (o *AuthTokenUser) HasEmails() bool` + +HasEmails returns a boolean if a field has been set. + +### GetFirstName + +`func (o *AuthTokenUser) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *AuthTokenUser) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *AuthTokenUser) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *AuthTokenUser) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetFraudScore + +`func (o *AuthTokenUser) GetFraudScore() string` + +GetFraudScore returns the FraudScore field if non-nil, zero value otherwise. + +### GetFraudScoreOk + +`func (o *AuthTokenUser) GetFraudScoreOk() (*string, bool)` + +GetFraudScoreOk returns a tuple with the FraudScore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFraudScore + +`func (o *AuthTokenUser) SetFraudScore(v string)` + +SetFraudScore sets FraudScore field to given value. + +### HasFraudScore + +`func (o *AuthTokenUser) HasFraudScore() bool` + +HasFraudScore returns a boolean if a field has been set. + +### GetFullName + +`func (o *AuthTokenUser) GetFullName() string` + +GetFullName returns the FullName field if non-nil, zero value otherwise. + +### GetFullNameOk + +`func (o *AuthTokenUser) GetFullNameOk() (*string, bool)` + +GetFullNameOk returns a tuple with the FullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFullName + +`func (o *AuthTokenUser) SetFullName(v string)` + +SetFullName sets FullName field to given value. + +### HasFullName + +`func (o *AuthTokenUser) HasFullName() bool` + +HasFullName returns a boolean if a field has been set. + +### GetHref + +`func (o *AuthTokenUser) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *AuthTokenUser) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *AuthTokenUser) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *AuthTokenUser) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *AuthTokenUser) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *AuthTokenUser) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *AuthTokenUser) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *AuthTokenUser) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLastLoginAt + +`func (o *AuthTokenUser) GetLastLoginAt() time.Time` + +GetLastLoginAt returns the LastLoginAt field if non-nil, zero value otherwise. + +### GetLastLoginAtOk + +`func (o *AuthTokenUser) GetLastLoginAtOk() (*time.Time, bool)` + +GetLastLoginAtOk returns a tuple with the LastLoginAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastLoginAt + +`func (o *AuthTokenUser) SetLastLoginAt(v time.Time)` + +SetLastLoginAt sets LastLoginAt field to given value. + +### HasLastLoginAt + +`func (o *AuthTokenUser) HasLastLoginAt() bool` + +HasLastLoginAt returns a boolean if a field has been set. + +### GetLastName + +`func (o *AuthTokenUser) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *AuthTokenUser) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *AuthTokenUser) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *AuthTokenUser) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetMaxOrganizations + +`func (o *AuthTokenUser) GetMaxOrganizations() int32` + +GetMaxOrganizations returns the MaxOrganizations field if non-nil, zero value otherwise. + +### GetMaxOrganizationsOk + +`func (o *AuthTokenUser) GetMaxOrganizationsOk() (*int32, bool)` + +GetMaxOrganizationsOk returns a tuple with the MaxOrganizations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxOrganizations + +`func (o *AuthTokenUser) SetMaxOrganizations(v int32)` + +SetMaxOrganizations sets MaxOrganizations field to given value. + +### HasMaxOrganizations + +`func (o *AuthTokenUser) HasMaxOrganizations() bool` + +HasMaxOrganizations returns a boolean if a field has been set. + +### GetMaxProjects + +`func (o *AuthTokenUser) GetMaxProjects() int32` + +GetMaxProjects returns the MaxProjects field if non-nil, zero value otherwise. + +### GetMaxProjectsOk + +`func (o *AuthTokenUser) GetMaxProjectsOk() (*int32, bool)` + +GetMaxProjectsOk returns a tuple with the MaxProjects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxProjects + +`func (o *AuthTokenUser) SetMaxProjects(v int32)` + +SetMaxProjects sets MaxProjects field to given value. + +### HasMaxProjects + +`func (o *AuthTokenUser) HasMaxProjects() bool` + +HasMaxProjects returns a boolean if a field has been set. + +### GetPhoneNumber + +`func (o *AuthTokenUser) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *AuthTokenUser) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *AuthTokenUser) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *AuthTokenUser) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### GetShortId + +`func (o *AuthTokenUser) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *AuthTokenUser) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *AuthTokenUser) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + +### HasShortId + +`func (o *AuthTokenUser) HasShortId() bool` + +HasShortId returns a boolean if a field has been set. + +### GetTimezone + +`func (o *AuthTokenUser) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *AuthTokenUser) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *AuthTokenUser) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *AuthTokenUser) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + +### GetTwoFactorAuth + +`func (o *AuthTokenUser) GetTwoFactorAuth() string` + +GetTwoFactorAuth returns the TwoFactorAuth field if non-nil, zero value otherwise. + +### GetTwoFactorAuthOk + +`func (o *AuthTokenUser) GetTwoFactorAuthOk() (*string, bool)` + +GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwoFactorAuth + +`func (o *AuthTokenUser) SetTwoFactorAuth(v string)` + +SetTwoFactorAuth sets TwoFactorAuth field to given value. + +### HasTwoFactorAuth + +`func (o *AuthTokenUser) HasTwoFactorAuth() bool` + +HasTwoFactorAuth returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *AuthTokenUser) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *AuthTokenUser) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *AuthTokenUser) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *AuthTokenUser) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/AuthenticationApi.md b/services/metalv1/docs/AuthenticationApi.md new file mode 100644 index 00000000..6dda02ed --- /dev/null +++ b/services/metalv1/docs/AuthenticationApi.md @@ -0,0 +1,432 @@ +# \AuthenticationApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateAPIKey**](AuthenticationApi.md#CreateAPIKey) | **Post** /user/api-keys | Create an API key +[**CreateProjectAPIKey**](AuthenticationApi.md#CreateProjectAPIKey) | **Post** /projects/{id}/api-keys | Create an API key for a project. +[**DeleteAPIKey**](AuthenticationApi.md#DeleteAPIKey) | **Delete** /api-keys/{id} | Delete the API key +[**DeleteUserAPIKey**](AuthenticationApi.md#DeleteUserAPIKey) | **Delete** /user/api-keys/{id} | Delete the API key +[**FindAPIKeys**](AuthenticationApi.md#FindAPIKeys) | **Get** /user/api-keys | Retrieve all user API keys +[**FindProjectAPIKeys**](AuthenticationApi.md#FindProjectAPIKeys) | **Get** /projects/{id}/api-keys | Retrieve all API keys for the project. + + + +## CreateAPIKey + +> AuthToken CreateAPIKey(ctx).AuthTokenInput(authTokenInput).Include(include).Execute() + +Create an API key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + authTokenInput := *openapiclient.NewAuthTokenInput() // AuthTokenInput | API key to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthenticationApi.CreateAPIKey(context.Background()).AuthTokenInput(authTokenInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.CreateAPIKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateAPIKey`: AuthToken + fmt.Fprintf(os.Stdout, "Response from `AuthenticationApi.CreateAPIKey`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateAPIKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authTokenInput** | [**AuthTokenInput**](AuthTokenInput.md) | API key to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**AuthToken**](AuthToken.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectAPIKey + +> AuthToken CreateProjectAPIKey(ctx, id).AuthTokenInput(authTokenInput).Include(include).Execute() + +Create an API key for a project. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + authTokenInput := *openapiclient.NewAuthTokenInput() // AuthTokenInput | API Key to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthenticationApi.CreateProjectAPIKey(context.Background(), id).AuthTokenInput(authTokenInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.CreateProjectAPIKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateProjectAPIKey`: AuthToken + fmt.Fprintf(os.Stdout, "Response from `AuthenticationApi.CreateProjectAPIKey`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectAPIKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **authTokenInput** | [**AuthTokenInput**](AuthTokenInput.md) | API Key to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**AuthToken**](AuthToken.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteAPIKey + +> DeleteAPIKey(ctx, id).Execute() + +Delete the API key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | API Key UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AuthenticationApi.DeleteAPIKey(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.DeleteAPIKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | API Key UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteAPIKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteUserAPIKey + +> DeleteUserAPIKey(ctx, id).Execute() + +Delete the API key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | API Key UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.AuthenticationApi.DeleteUserAPIKey(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.DeleteUserAPIKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | API Key UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteUserAPIKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindAPIKeys + +> AuthTokenList FindAPIKeys(ctx).Search(search).Include(include).Execute() + +Retrieve all user API keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + search := "search_example" // string | Search by description (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthenticationApi.FindAPIKeys(context.Background()).Search(search).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.FindAPIKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindAPIKeys`: AuthTokenList + fmt.Fprintf(os.Stdout, "Response from `AuthenticationApi.FindAPIKeys`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindAPIKeysRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search** | **string** | Search by description | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**AuthTokenList**](AuthTokenList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectAPIKeys + +> AuthTokenList FindProjectAPIKeys(ctx, id).Include(include).Execute() + +Retrieve all API keys for the project. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthenticationApi.FindProjectAPIKeys(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationApi.FindProjectAPIKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectAPIKeys`: AuthTokenList + fmt.Fprintf(os.Stdout, "Response from `AuthenticationApi.FindProjectAPIKeys`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectAPIKeysRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**AuthTokenList**](AuthTokenList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/BGPApi.md b/services/metalv1/docs/BGPApi.md new file mode 100644 index 00000000..6f89093c --- /dev/null +++ b/services/metalv1/docs/BGPApi.md @@ -0,0 +1,509 @@ +# \BGPApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteBgpSession**](BGPApi.md#DeleteBgpSession) | **Delete** /bgp/sessions/{id} | Delete the BGP session +[**FindBgpConfigByProject**](BGPApi.md#FindBgpConfigByProject) | **Get** /projects/{id}/bgp-config | Retrieve a bgp config +[**FindBgpSessionById**](BGPApi.md#FindBgpSessionById) | **Get** /bgp/sessions/{id} | Retrieve a BGP session +[**FindGlobalBgpRanges**](BGPApi.md#FindGlobalBgpRanges) | **Get** /projects/{id}/global-bgp-ranges | Retrieve all global bgp ranges +[**FindProjectBgpSessions**](BGPApi.md#FindProjectBgpSessions) | **Get** /projects/{id}/bgp/sessions | Retrieve all BGP sessions for project +[**RequestBgpConfig**](BGPApi.md#RequestBgpConfig) | **Post** /projects/{id}/bgp-configs | Requesting bgp config +[**UpdateBgpSession**](BGPApi.md#UpdateBgpSession) | **Put** /bgp/sessions/{id} | Update the BGP session + + + +## DeleteBgpSession + +> DeleteBgpSession(ctx, id).Execute() + +Delete the BGP session + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | BGP session UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BGPApi.DeleteBgpSession(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.DeleteBgpSession``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | BGP session UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteBgpSessionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindBgpConfigByProject + +> BgpConfig FindBgpConfigByProject(ctx, id).Include(include).Execute() + +Retrieve a bgp config + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BGPApi.FindBgpConfigByProject(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.FindBgpConfigByProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindBgpConfigByProject`: BgpConfig + fmt.Fprintf(os.Stdout, "Response from `BGPApi.FindBgpConfigByProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindBgpConfigByProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BgpConfig**](BgpConfig.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindBgpSessionById + +> BgpSession FindBgpSessionById(ctx, id).Include(include).Execute() + +Retrieve a BGP session + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | BGP session UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BGPApi.FindBgpSessionById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.FindBgpSessionById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindBgpSessionById`: BgpSession + fmt.Fprintf(os.Stdout, "Response from `BGPApi.FindBgpSessionById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | BGP session UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindBgpSessionByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BgpSession**](BgpSession.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindGlobalBgpRanges + +> GlobalBgpRangeList FindGlobalBgpRanges(ctx, id).Execute() + +Retrieve all global bgp ranges + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BGPApi.FindGlobalBgpRanges(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.FindGlobalBgpRanges``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindGlobalBgpRanges`: GlobalBgpRangeList + fmt.Fprintf(os.Stdout, "Response from `BGPApi.FindGlobalBgpRanges`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindGlobalBgpRangesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**GlobalBgpRangeList**](GlobalBgpRangeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectBgpSessions + +> BgpSessionList FindProjectBgpSessions(ctx, id).Execute() + +Retrieve all BGP sessions for project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BGPApi.FindProjectBgpSessions(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.FindProjectBgpSessions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectBgpSessions`: BgpSessionList + fmt.Fprintf(os.Stdout, "Response from `BGPApi.FindProjectBgpSessions`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectBgpSessionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**BgpSessionList**](BgpSessionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestBgpConfig + +> RequestBgpConfig(ctx, id).BgpConfigRequestInput(bgpConfigRequestInput).Include(include).Execute() + +Requesting bgp config + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + bgpConfigRequestInput := *openapiclient.NewBgpConfigRequestInput(int32(65000), openapiclient.BgpConfigRequestInput_deployment_type("local")) // BgpConfigRequestInput | BGP config Request to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BGPApi.RequestBgpConfig(context.Background(), id).BgpConfigRequestInput(bgpConfigRequestInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.RequestBgpConfig``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestBgpConfigRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **bgpConfigRequestInput** | [**BgpConfigRequestInput**](BgpConfigRequestInput.md) | BGP config Request to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateBgpSession + +> UpdateBgpSession(ctx, id).Body(body).Execute() + +Update the BGP session + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | BGP session UUID + body := true // bool | Default route + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BGPApi.UpdateBgpSession(context.Background(), id).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BGPApi.UpdateBgpSession``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | BGP session UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateBgpSessionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **bool** | Default route | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/BGPSessionInput.md b/services/metalv1/docs/BGPSessionInput.md new file mode 100644 index 00000000..d5e5ddab --- /dev/null +++ b/services/metalv1/docs/BGPSessionInput.md @@ -0,0 +1,82 @@ +# BGPSessionInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to [**BGPSessionInputAddressFamily**](BGPSessionInputAddressFamily.md) | | [optional] +**DefaultRoute** | Pointer to **bool** | Set the default route policy. | [optional] [default to false] + +## Methods + +### NewBGPSessionInput + +`func NewBGPSessionInput() *BGPSessionInput` + +NewBGPSessionInput instantiates a new BGPSessionInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBGPSessionInputWithDefaults + +`func NewBGPSessionInputWithDefaults() *BGPSessionInput` + +NewBGPSessionInputWithDefaults instantiates a new BGPSessionInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *BGPSessionInput) GetAddressFamily() BGPSessionInputAddressFamily` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *BGPSessionInput) GetAddressFamilyOk() (*BGPSessionInputAddressFamily, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *BGPSessionInput) SetAddressFamily(v BGPSessionInputAddressFamily)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *BGPSessionInput) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetDefaultRoute + +`func (o *BGPSessionInput) GetDefaultRoute() bool` + +GetDefaultRoute returns the DefaultRoute field if non-nil, zero value otherwise. + +### GetDefaultRouteOk + +`func (o *BGPSessionInput) GetDefaultRouteOk() (*bool, bool)` + +GetDefaultRouteOk returns a tuple with the DefaultRoute field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRoute + +`func (o *BGPSessionInput) SetDefaultRoute(v bool)` + +SetDefaultRoute sets DefaultRoute field to given value. + +### HasDefaultRoute + +`func (o *BGPSessionInput) HasDefaultRoute() bool` + +HasDefaultRoute returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BGPSessionInputAddressFamily.md b/services/metalv1/docs/BGPSessionInputAddressFamily.md new file mode 100644 index 00000000..f8326765 --- /dev/null +++ b/services/metalv1/docs/BGPSessionInputAddressFamily.md @@ -0,0 +1,13 @@ +# BGPSessionInputAddressFamily + +## Enum + + +* `IPV4` (value: `"ipv4"`) + +* `IPV6` (value: `"ipv6"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Batch.md b/services/metalv1/docs/Batch.md new file mode 100644 index 00000000..38dc4c4b --- /dev/null +++ b/services/metalv1/docs/Batch.md @@ -0,0 +1,238 @@ +# Batch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Devices** | Pointer to [**[]Href**](Href.md) | | [optional] +**ErrorMessages** | Pointer to **[]string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**State** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewBatch + +`func NewBatch() *Batch` + +NewBatch instantiates a new Batch object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchWithDefaults + +`func NewBatchWithDefaults() *Batch` + +NewBatchWithDefaults instantiates a new Batch object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *Batch) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Batch) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Batch) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Batch) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDevices + +`func (o *Batch) GetDevices() []Href` + +GetDevices returns the Devices field if non-nil, zero value otherwise. + +### GetDevicesOk + +`func (o *Batch) GetDevicesOk() (*[]Href, bool)` + +GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevices + +`func (o *Batch) SetDevices(v []Href)` + +SetDevices sets Devices field to given value. + +### HasDevices + +`func (o *Batch) HasDevices() bool` + +HasDevices returns a boolean if a field has been set. + +### GetErrorMessages + +`func (o *Batch) GetErrorMessages() []string` + +GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. + +### GetErrorMessagesOk + +`func (o *Batch) GetErrorMessagesOk() (*[]string, bool)` + +GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessages + +`func (o *Batch) SetErrorMessages(v []string)` + +SetErrorMessages sets ErrorMessages field to given value. + +### HasErrorMessages + +`func (o *Batch) HasErrorMessages() bool` + +HasErrorMessages returns a boolean if a field has been set. + +### GetId + +`func (o *Batch) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Batch) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Batch) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Batch) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProject + +`func (o *Batch) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *Batch) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *Batch) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *Batch) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetQuantity + +`func (o *Batch) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Batch) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *Batch) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *Batch) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetState + +`func (o *Batch) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Batch) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Batch) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *Batch) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Batch) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Batch) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Batch) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Batch) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BatchesApi.md b/services/metalv1/docs/BatchesApi.md new file mode 100644 index 00000000..a7512fa4 --- /dev/null +++ b/services/metalv1/docs/BatchesApi.md @@ -0,0 +1,298 @@ +# \BatchesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateDeviceBatch**](BatchesApi.md#CreateDeviceBatch) | **Post** /projects/{id}/devices/batch | Create a devices batch +[**DeleteBatch**](BatchesApi.md#DeleteBatch) | **Delete** /batches/{id} | Delete the Batch +[**FindBatchById**](BatchesApi.md#FindBatchById) | **Get** /batches/{id} | Retrieve a Batch +[**FindBatchesByProject**](BatchesApi.md#FindBatchesByProject) | **Get** /projects/{id}/batches | Retrieve all batches by project + + + +## CreateDeviceBatch + +> BatchesList CreateDeviceBatch(ctx, id).InstancesBatchCreateInput(instancesBatchCreateInput).Execute() + +Create a devices batch + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + instancesBatchCreateInput := *openapiclient.NewInstancesBatchCreateInput() // InstancesBatchCreateInput | Batches to create + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BatchesApi.CreateDeviceBatch(context.Background(), id).InstancesBatchCreateInput(instancesBatchCreateInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BatchesApi.CreateDeviceBatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateDeviceBatch`: BatchesList + fmt.Fprintf(os.Stdout, "Response from `BatchesApi.CreateDeviceBatch`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateDeviceBatchRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **instancesBatchCreateInput** | [**InstancesBatchCreateInput**](InstancesBatchCreateInput.md) | Batches to create | + +### Return type + +[**BatchesList**](BatchesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteBatch + +> DeleteBatch(ctx, id).RemoveAssociatedInstances(removeAssociatedInstances).Execute() + +Delete the Batch + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Batch UUID + removeAssociatedInstances := true // bool | Delete all instances created from this batch (optional) (default to false) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.BatchesApi.DeleteBatch(context.Background(), id).RemoveAssociatedInstances(removeAssociatedInstances).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BatchesApi.DeleteBatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Batch UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteBatchRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **removeAssociatedInstances** | **bool** | Delete all instances created from this batch | [default to false] + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindBatchById + +> Batch FindBatchById(ctx, id).Include(include).Execute() + +Retrieve a Batch + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Batch UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BatchesApi.FindBatchById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BatchesApi.FindBatchById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindBatchById`: Batch + fmt.Fprintf(os.Stdout, "Response from `BatchesApi.FindBatchById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Batch UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindBatchByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Batch**](Batch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindBatchesByProject + +> BatchesList FindBatchesByProject(ctx, id).Include(include).Execute() + +Retrieve all batches by project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BatchesApi.FindBatchesByProject(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BatchesApi.FindBatchesByProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindBatchesByProject`: BatchesList + fmt.Fprintf(os.Stdout, "Response from `BatchesApi.FindBatchesByProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindBatchesByProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BatchesList**](BatchesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/BatchesList.md b/services/metalv1/docs/BatchesList.md new file mode 100644 index 00000000..fb55189a --- /dev/null +++ b/services/metalv1/docs/BatchesList.md @@ -0,0 +1,56 @@ +# BatchesList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Batches** | Pointer to [**[]Batch**](Batch.md) | | [optional] + +## Methods + +### NewBatchesList + +`func NewBatchesList() *BatchesList` + +NewBatchesList instantiates a new BatchesList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchesListWithDefaults + +`func NewBatchesListWithDefaults() *BatchesList` + +NewBatchesListWithDefaults instantiates a new BatchesList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBatches + +`func (o *BatchesList) GetBatches() []Batch` + +GetBatches returns the Batches field if non-nil, zero value otherwise. + +### GetBatchesOk + +`func (o *BatchesList) GetBatchesOk() (*[]Batch, bool)` + +GetBatchesOk returns a tuple with the Batches field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBatches + +`func (o *BatchesList) SetBatches(v []Batch)` + +SetBatches sets Batches field to given value. + +### HasBatches + +`func (o *BatchesList) HasBatches() bool` + +HasBatches returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpConfig.md b/services/metalv1/docs/BgpConfig.md new file mode 100644 index 00000000..4860ef1a --- /dev/null +++ b/services/metalv1/docs/BgpConfig.md @@ -0,0 +1,378 @@ +# BgpConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Asn** | Pointer to **int32** | Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned. | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**DeploymentType** | Pointer to [**BgpConfigDeploymentType**](BgpConfigDeploymentType.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**MaxPrefix** | Pointer to **int32** | The maximum number of route filters allowed per server | [optional] [default to 10] +**Md5** | Pointer to **NullableString** | (Optional) Password for BGP session in plaintext (not a checksum) | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Ranges** | Pointer to [**[]GlobalBgpRange**](GlobalBgpRange.md) | The IP block ranges associated to the ASN (Populated in Global BGP only) | [optional] +**RequestedAt** | Pointer to **time.Time** | | [optional] +**RouteObject** | Pointer to **string** | Specifies AS-MACRO (aka AS-SET) to use when building client route filters | [optional] +**Sessions** | Pointer to [**[]BgpSession**](BgpSession.md) | The direct connections between neighboring routers that want to exchange routing information. | [optional] +**Status** | Pointer to [**BgpConfigStatus**](BgpConfigStatus.md) | | [optional] + +## Methods + +### NewBgpConfig + +`func NewBgpConfig() *BgpConfig` + +NewBgpConfig instantiates a new BgpConfig object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpConfigWithDefaults + +`func NewBgpConfigWithDefaults() *BgpConfig` + +NewBgpConfigWithDefaults instantiates a new BgpConfig object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAsn + +`func (o *BgpConfig) GetAsn() int32` + +GetAsn returns the Asn field if non-nil, zero value otherwise. + +### GetAsnOk + +`func (o *BgpConfig) GetAsnOk() (*int32, bool)` + +GetAsnOk returns a tuple with the Asn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAsn + +`func (o *BgpConfig) SetAsn(v int32)` + +SetAsn sets Asn field to given value. + +### HasAsn + +`func (o *BgpConfig) HasAsn() bool` + +HasAsn returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *BgpConfig) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *BgpConfig) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *BgpConfig) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *BgpConfig) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDeploymentType + +`func (o *BgpConfig) GetDeploymentType() BgpConfigDeploymentType` + +GetDeploymentType returns the DeploymentType field if non-nil, zero value otherwise. + +### GetDeploymentTypeOk + +`func (o *BgpConfig) GetDeploymentTypeOk() (*BgpConfigDeploymentType, bool)` + +GetDeploymentTypeOk returns a tuple with the DeploymentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeploymentType + +`func (o *BgpConfig) SetDeploymentType(v BgpConfigDeploymentType)` + +SetDeploymentType sets DeploymentType field to given value. + +### HasDeploymentType + +`func (o *BgpConfig) HasDeploymentType() bool` + +HasDeploymentType returns a boolean if a field has been set. + +### GetHref + +`func (o *BgpConfig) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *BgpConfig) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *BgpConfig) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *BgpConfig) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *BgpConfig) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *BgpConfig) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *BgpConfig) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *BgpConfig) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMaxPrefix + +`func (o *BgpConfig) GetMaxPrefix() int32` + +GetMaxPrefix returns the MaxPrefix field if non-nil, zero value otherwise. + +### GetMaxPrefixOk + +`func (o *BgpConfig) GetMaxPrefixOk() (*int32, bool)` + +GetMaxPrefixOk returns a tuple with the MaxPrefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxPrefix + +`func (o *BgpConfig) SetMaxPrefix(v int32)` + +SetMaxPrefix sets MaxPrefix field to given value. + +### HasMaxPrefix + +`func (o *BgpConfig) HasMaxPrefix() bool` + +HasMaxPrefix returns a boolean if a field has been set. + +### GetMd5 + +`func (o *BgpConfig) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *BgpConfig) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *BgpConfig) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *BgpConfig) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### SetMd5Nil + +`func (o *BgpConfig) SetMd5Nil(b bool)` + + SetMd5Nil sets the value for Md5 to be an explicit nil + +### UnsetMd5 +`func (o *BgpConfig) UnsetMd5()` + +UnsetMd5 ensures that no value is present for Md5, not even an explicit nil +### GetProject + +`func (o *BgpConfig) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *BgpConfig) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *BgpConfig) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *BgpConfig) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRanges + +`func (o *BgpConfig) GetRanges() []GlobalBgpRange` + +GetRanges returns the Ranges field if non-nil, zero value otherwise. + +### GetRangesOk + +`func (o *BgpConfig) GetRangesOk() (*[]GlobalBgpRange, bool)` + +GetRangesOk returns a tuple with the Ranges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRanges + +`func (o *BgpConfig) SetRanges(v []GlobalBgpRange)` + +SetRanges sets Ranges field to given value. + +### HasRanges + +`func (o *BgpConfig) HasRanges() bool` + +HasRanges returns a boolean if a field has been set. + +### GetRequestedAt + +`func (o *BgpConfig) GetRequestedAt() time.Time` + +GetRequestedAt returns the RequestedAt field if non-nil, zero value otherwise. + +### GetRequestedAtOk + +`func (o *BgpConfig) GetRequestedAtOk() (*time.Time, bool)` + +GetRequestedAtOk returns a tuple with the RequestedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedAt + +`func (o *BgpConfig) SetRequestedAt(v time.Time)` + +SetRequestedAt sets RequestedAt field to given value. + +### HasRequestedAt + +`func (o *BgpConfig) HasRequestedAt() bool` + +HasRequestedAt returns a boolean if a field has been set. + +### GetRouteObject + +`func (o *BgpConfig) GetRouteObject() string` + +GetRouteObject returns the RouteObject field if non-nil, zero value otherwise. + +### GetRouteObjectOk + +`func (o *BgpConfig) GetRouteObjectOk() (*string, bool)` + +GetRouteObjectOk returns a tuple with the RouteObject field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRouteObject + +`func (o *BgpConfig) SetRouteObject(v string)` + +SetRouteObject sets RouteObject field to given value. + +### HasRouteObject + +`func (o *BgpConfig) HasRouteObject() bool` + +HasRouteObject returns a boolean if a field has been set. + +### GetSessions + +`func (o *BgpConfig) GetSessions() []BgpSession` + +GetSessions returns the Sessions field if non-nil, zero value otherwise. + +### GetSessionsOk + +`func (o *BgpConfig) GetSessionsOk() (*[]BgpSession, bool)` + +GetSessionsOk returns a tuple with the Sessions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSessions + +`func (o *BgpConfig) SetSessions(v []BgpSession)` + +SetSessions sets Sessions field to given value. + +### HasSessions + +`func (o *BgpConfig) HasSessions() bool` + +HasSessions returns a boolean if a field has been set. + +### GetStatus + +`func (o *BgpConfig) GetStatus() BgpConfigStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *BgpConfig) GetStatusOk() (*BgpConfigStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *BgpConfig) SetStatus(v BgpConfigStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *BgpConfig) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpConfigDeploymentType.md b/services/metalv1/docs/BgpConfigDeploymentType.md new file mode 100644 index 00000000..b6be0185 --- /dev/null +++ b/services/metalv1/docs/BgpConfigDeploymentType.md @@ -0,0 +1,13 @@ +# BgpConfigDeploymentType + +## Enum + + +* `GLOBAL` (value: `"global"`) + +* `LOCAL` (value: `"local"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpConfigRequestInput.md b/services/metalv1/docs/BgpConfigRequestInput.md new file mode 100644 index 00000000..1eababaf --- /dev/null +++ b/services/metalv1/docs/BgpConfigRequestInput.md @@ -0,0 +1,124 @@ +# BgpConfigRequestInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Asn** | **int32** | Autonomous System Number for local BGP deployment. | +**DeploymentType** | [**BgpConfigRequestInputDeploymentType**](BgpConfigRequestInputDeploymentType.md) | | +**Md5** | Pointer to **string** | The plaintext password to share between BGP neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**UseCase** | Pointer to **string** | A use case explanation (necessary for global BGP request review). | [optional] + +## Methods + +### NewBgpConfigRequestInput + +`func NewBgpConfigRequestInput(asn int32, deploymentType BgpConfigRequestInputDeploymentType, ) *BgpConfigRequestInput` + +NewBgpConfigRequestInput instantiates a new BgpConfigRequestInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpConfigRequestInputWithDefaults + +`func NewBgpConfigRequestInputWithDefaults() *BgpConfigRequestInput` + +NewBgpConfigRequestInputWithDefaults instantiates a new BgpConfigRequestInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAsn + +`func (o *BgpConfigRequestInput) GetAsn() int32` + +GetAsn returns the Asn field if non-nil, zero value otherwise. + +### GetAsnOk + +`func (o *BgpConfigRequestInput) GetAsnOk() (*int32, bool)` + +GetAsnOk returns a tuple with the Asn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAsn + +`func (o *BgpConfigRequestInput) SetAsn(v int32)` + +SetAsn sets Asn field to given value. + + +### GetDeploymentType + +`func (o *BgpConfigRequestInput) GetDeploymentType() BgpConfigRequestInputDeploymentType` + +GetDeploymentType returns the DeploymentType field if non-nil, zero value otherwise. + +### GetDeploymentTypeOk + +`func (o *BgpConfigRequestInput) GetDeploymentTypeOk() (*BgpConfigRequestInputDeploymentType, bool)` + +GetDeploymentTypeOk returns a tuple with the DeploymentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeploymentType + +`func (o *BgpConfigRequestInput) SetDeploymentType(v BgpConfigRequestInputDeploymentType)` + +SetDeploymentType sets DeploymentType field to given value. + + +### GetMd5 + +`func (o *BgpConfigRequestInput) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *BgpConfigRequestInput) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *BgpConfigRequestInput) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *BgpConfigRequestInput) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### GetUseCase + +`func (o *BgpConfigRequestInput) GetUseCase() string` + +GetUseCase returns the UseCase field if non-nil, zero value otherwise. + +### GetUseCaseOk + +`func (o *BgpConfigRequestInput) GetUseCaseOk() (*string, bool)` + +GetUseCaseOk returns a tuple with the UseCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseCase + +`func (o *BgpConfigRequestInput) SetUseCase(v string)` + +SetUseCase sets UseCase field to given value. + +### HasUseCase + +`func (o *BgpConfigRequestInput) HasUseCase() bool` + +HasUseCase returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpConfigRequestInputDeploymentType.md b/services/metalv1/docs/BgpConfigRequestInputDeploymentType.md new file mode 100644 index 00000000..95e08e59 --- /dev/null +++ b/services/metalv1/docs/BgpConfigRequestInputDeploymentType.md @@ -0,0 +1,13 @@ +# BgpConfigRequestInputDeploymentType + +## Enum + + +* `LOCAL` (value: `"local"`) + +* `GLOBAL` (value: `"global"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpConfigStatus.md b/services/metalv1/docs/BgpConfigStatus.md new file mode 100644 index 00000000..1c4e40c5 --- /dev/null +++ b/services/metalv1/docs/BgpConfigStatus.md @@ -0,0 +1,15 @@ +# BgpConfigStatus + +## Enum + + +* `REQUESTED` (value: `"requested"`) + +* `ENABLED` (value: `"enabled"`) + +* `DISABLED` (value: `"disabled"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpDynamicNeighbor.md b/services/metalv1/docs/BgpDynamicNeighbor.md new file mode 100644 index 00000000..3b562d8b --- /dev/null +++ b/services/metalv1/docs/BgpDynamicNeighbor.md @@ -0,0 +1,290 @@ +# BgpDynamicNeighbor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The unique identifier for the resource | [optional] [readonly] +**BgpNeighborAsn** | Pointer to **int32** | The ASN of the dynamic BGP neighbor | [optional] +**BgpNeighborRange** | Pointer to **string** | Network range of the dynamic BGP neighbor in CIDR format | [optional] +**MetalGateway** | Pointer to [**VrfMetalGateway**](VrfMetalGateway.md) | | [optional] +**State** | Pointer to [**BgpDynamicNeighborState**](BgpDynamicNeighborState.md) | | [optional] +**Href** | Pointer to **string** | | [optional] [readonly] +**CreatedAt** | Pointer to **time.Time** | | [optional] [readonly] +**CreatedBy** | Pointer to [**UserLimited**](UserLimited.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] [readonly] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewBgpDynamicNeighbor + +`func NewBgpDynamicNeighbor() *BgpDynamicNeighbor` + +NewBgpDynamicNeighbor instantiates a new BgpDynamicNeighbor object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpDynamicNeighborWithDefaults + +`func NewBgpDynamicNeighborWithDefaults() *BgpDynamicNeighbor` + +NewBgpDynamicNeighborWithDefaults instantiates a new BgpDynamicNeighbor object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *BgpDynamicNeighbor) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *BgpDynamicNeighbor) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *BgpDynamicNeighbor) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *BgpDynamicNeighbor) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetBgpNeighborAsn + +`func (o *BgpDynamicNeighbor) GetBgpNeighborAsn() int32` + +GetBgpNeighborAsn returns the BgpNeighborAsn field if non-nil, zero value otherwise. + +### GetBgpNeighborAsnOk + +`func (o *BgpDynamicNeighbor) GetBgpNeighborAsnOk() (*int32, bool)` + +GetBgpNeighborAsnOk returns a tuple with the BgpNeighborAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpNeighborAsn + +`func (o *BgpDynamicNeighbor) SetBgpNeighborAsn(v int32)` + +SetBgpNeighborAsn sets BgpNeighborAsn field to given value. + +### HasBgpNeighborAsn + +`func (o *BgpDynamicNeighbor) HasBgpNeighborAsn() bool` + +HasBgpNeighborAsn returns a boolean if a field has been set. + +### GetBgpNeighborRange + +`func (o *BgpDynamicNeighbor) GetBgpNeighborRange() string` + +GetBgpNeighborRange returns the BgpNeighborRange field if non-nil, zero value otherwise. + +### GetBgpNeighborRangeOk + +`func (o *BgpDynamicNeighbor) GetBgpNeighborRangeOk() (*string, bool)` + +GetBgpNeighborRangeOk returns a tuple with the BgpNeighborRange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpNeighborRange + +`func (o *BgpDynamicNeighbor) SetBgpNeighborRange(v string)` + +SetBgpNeighborRange sets BgpNeighborRange field to given value. + +### HasBgpNeighborRange + +`func (o *BgpDynamicNeighbor) HasBgpNeighborRange() bool` + +HasBgpNeighborRange returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *BgpDynamicNeighbor) GetMetalGateway() VrfMetalGateway` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *BgpDynamicNeighbor) GetMetalGatewayOk() (*VrfMetalGateway, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *BgpDynamicNeighbor) SetMetalGateway(v VrfMetalGateway)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *BgpDynamicNeighbor) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetState + +`func (o *BgpDynamicNeighbor) GetState() BgpDynamicNeighborState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *BgpDynamicNeighbor) GetStateOk() (*BgpDynamicNeighborState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *BgpDynamicNeighbor) SetState(v BgpDynamicNeighborState)` + +SetState sets State field to given value. + +### HasState + +`func (o *BgpDynamicNeighbor) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetHref + +`func (o *BgpDynamicNeighbor) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *BgpDynamicNeighbor) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *BgpDynamicNeighbor) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *BgpDynamicNeighbor) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *BgpDynamicNeighbor) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *BgpDynamicNeighbor) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *BgpDynamicNeighbor) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *BgpDynamicNeighbor) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *BgpDynamicNeighbor) GetCreatedBy() UserLimited` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *BgpDynamicNeighbor) GetCreatedByOk() (*UserLimited, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *BgpDynamicNeighbor) SetCreatedBy(v UserLimited)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *BgpDynamicNeighbor) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *BgpDynamicNeighbor) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *BgpDynamicNeighbor) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *BgpDynamicNeighbor) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *BgpDynamicNeighbor) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetTags + +`func (o *BgpDynamicNeighbor) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *BgpDynamicNeighbor) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *BgpDynamicNeighbor) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *BgpDynamicNeighbor) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpDynamicNeighborCreateInput.md b/services/metalv1/docs/BgpDynamicNeighborCreateInput.md new file mode 100644 index 00000000..0d85f859 --- /dev/null +++ b/services/metalv1/docs/BgpDynamicNeighborCreateInput.md @@ -0,0 +1,98 @@ +# BgpDynamicNeighborCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpNeighborRange** | **string** | Network range of the dynamic BGP neighbor in CIDR format | +**BgpNeighborAsn** | **int32** | The ASN of the dynamic BGP neighbor | +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewBgpDynamicNeighborCreateInput + +`func NewBgpDynamicNeighborCreateInput(bgpNeighborRange string, bgpNeighborAsn int32, ) *BgpDynamicNeighborCreateInput` + +NewBgpDynamicNeighborCreateInput instantiates a new BgpDynamicNeighborCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpDynamicNeighborCreateInputWithDefaults + +`func NewBgpDynamicNeighborCreateInputWithDefaults() *BgpDynamicNeighborCreateInput` + +NewBgpDynamicNeighborCreateInputWithDefaults instantiates a new BgpDynamicNeighborCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpNeighborRange + +`func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborRange() string` + +GetBgpNeighborRange returns the BgpNeighborRange field if non-nil, zero value otherwise. + +### GetBgpNeighborRangeOk + +`func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborRangeOk() (*string, bool)` + +GetBgpNeighborRangeOk returns a tuple with the BgpNeighborRange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpNeighborRange + +`func (o *BgpDynamicNeighborCreateInput) SetBgpNeighborRange(v string)` + +SetBgpNeighborRange sets BgpNeighborRange field to given value. + + +### GetBgpNeighborAsn + +`func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborAsn() int32` + +GetBgpNeighborAsn returns the BgpNeighborAsn field if non-nil, zero value otherwise. + +### GetBgpNeighborAsnOk + +`func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborAsnOk() (*int32, bool)` + +GetBgpNeighborAsnOk returns a tuple with the BgpNeighborAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpNeighborAsn + +`func (o *BgpDynamicNeighborCreateInput) SetBgpNeighborAsn(v int32)` + +SetBgpNeighborAsn sets BgpNeighborAsn field to given value. + + +### GetTags + +`func (o *BgpDynamicNeighborCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *BgpDynamicNeighborCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *BgpDynamicNeighborCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *BgpDynamicNeighborCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpDynamicNeighborList.md b/services/metalv1/docs/BgpDynamicNeighborList.md new file mode 100644 index 00000000..af522f76 --- /dev/null +++ b/services/metalv1/docs/BgpDynamicNeighborList.md @@ -0,0 +1,82 @@ +# BgpDynamicNeighborList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpDynamicNeighbors** | Pointer to [**[]BgpDynamicNeighbor**](BgpDynamicNeighbor.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewBgpDynamicNeighborList + +`func NewBgpDynamicNeighborList() *BgpDynamicNeighborList` + +NewBgpDynamicNeighborList instantiates a new BgpDynamicNeighborList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpDynamicNeighborListWithDefaults + +`func NewBgpDynamicNeighborListWithDefaults() *BgpDynamicNeighborList` + +NewBgpDynamicNeighborListWithDefaults instantiates a new BgpDynamicNeighborList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpDynamicNeighbors + +`func (o *BgpDynamicNeighborList) GetBgpDynamicNeighbors() []BgpDynamicNeighbor` + +GetBgpDynamicNeighbors returns the BgpDynamicNeighbors field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsOk + +`func (o *BgpDynamicNeighborList) GetBgpDynamicNeighborsOk() (*[]BgpDynamicNeighbor, bool)` + +GetBgpDynamicNeighborsOk returns a tuple with the BgpDynamicNeighbors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighbors + +`func (o *BgpDynamicNeighborList) SetBgpDynamicNeighbors(v []BgpDynamicNeighbor)` + +SetBgpDynamicNeighbors sets BgpDynamicNeighbors field to given value. + +### HasBgpDynamicNeighbors + +`func (o *BgpDynamicNeighborList) HasBgpDynamicNeighbors() bool` + +HasBgpDynamicNeighbors returns a boolean if a field has been set. + +### GetMeta + +`func (o *BgpDynamicNeighborList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *BgpDynamicNeighborList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *BgpDynamicNeighborList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *BgpDynamicNeighborList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpDynamicNeighborState.md b/services/metalv1/docs/BgpDynamicNeighborState.md new file mode 100644 index 00000000..8dbf07f5 --- /dev/null +++ b/services/metalv1/docs/BgpDynamicNeighborState.md @@ -0,0 +1,17 @@ +# BgpDynamicNeighborState + +## Enum + + +* `ACTIVE` (value: `"active"`) + +* `DELETING` (value: `"deleting"`) + +* `PENDING` (value: `"pending"`) + +* `READY` (value: `"ready"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpNeighborData.md b/services/metalv1/docs/BgpNeighborData.md new file mode 100644 index 00000000..ee4f794d --- /dev/null +++ b/services/metalv1/docs/BgpNeighborData.md @@ -0,0 +1,290 @@ +# BgpNeighborData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to **int32** | Address Family for IP Address. Accepted values are 4 or 6 | [optional] +**CustomerAs** | Pointer to **int32** | The customer's ASN. In a local BGP deployment, this will be an internal ASN used to route within the data center. For a global BGP deployment, this will be the your own ASN, configured when you set up BGP for your project. | [optional] +**CustomerIp** | Pointer to **string** | The device's IP address. For an IPv4 BGP session, this is typically the private bond0 address for the device. | [optional] +**Md5Enabled** | Pointer to **bool** | True if an MD5 password is configured for the project. | [optional] +**Md5Password** | Pointer to **string** | The MD5 password configured for the project, if set. | [optional] +**Multihop** | Pointer to **bool** | True when the BGP session should be configured as multihop. | [optional] +**PeerAs** | Pointer to **int32** | The Peer ASN to use when configuring BGP on your device. | [optional] +**PeerIps** | Pointer to **[]string** | A list of one or more IP addresses to use for the Peer IP section of your BGP configuration. For non-multihop sessions, this will typically be a single gateway address for the device. For multihop sessions, it will be a list of IPs. | [optional] +**RoutesIn** | Pointer to [**[]BgpRoute**](BgpRoute.md) | A list of project subnets | [optional] +**RoutesOut** | Pointer to [**[]BgpRoute**](BgpRoute.md) | A list of outgoing routes. Only populated if the BGP session has default route enabled. | [optional] + +## Methods + +### NewBgpNeighborData + +`func NewBgpNeighborData() *BgpNeighborData` + +NewBgpNeighborData instantiates a new BgpNeighborData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpNeighborDataWithDefaults + +`func NewBgpNeighborDataWithDefaults() *BgpNeighborData` + +NewBgpNeighborDataWithDefaults instantiates a new BgpNeighborData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *BgpNeighborData) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *BgpNeighborData) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *BgpNeighborData) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *BgpNeighborData) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetCustomerAs + +`func (o *BgpNeighborData) GetCustomerAs() int32` + +GetCustomerAs returns the CustomerAs field if non-nil, zero value otherwise. + +### GetCustomerAsOk + +`func (o *BgpNeighborData) GetCustomerAsOk() (*int32, bool)` + +GetCustomerAsOk returns a tuple with the CustomerAs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerAs + +`func (o *BgpNeighborData) SetCustomerAs(v int32)` + +SetCustomerAs sets CustomerAs field to given value. + +### HasCustomerAs + +`func (o *BgpNeighborData) HasCustomerAs() bool` + +HasCustomerAs returns a boolean if a field has been set. + +### GetCustomerIp + +`func (o *BgpNeighborData) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *BgpNeighborData) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *BgpNeighborData) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *BgpNeighborData) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetMd5Enabled + +`func (o *BgpNeighborData) GetMd5Enabled() bool` + +GetMd5Enabled returns the Md5Enabled field if non-nil, zero value otherwise. + +### GetMd5EnabledOk + +`func (o *BgpNeighborData) GetMd5EnabledOk() (*bool, bool)` + +GetMd5EnabledOk returns a tuple with the Md5Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5Enabled + +`func (o *BgpNeighborData) SetMd5Enabled(v bool)` + +SetMd5Enabled sets Md5Enabled field to given value. + +### HasMd5Enabled + +`func (o *BgpNeighborData) HasMd5Enabled() bool` + +HasMd5Enabled returns a boolean if a field has been set. + +### GetMd5Password + +`func (o *BgpNeighborData) GetMd5Password() string` + +GetMd5Password returns the Md5Password field if non-nil, zero value otherwise. + +### GetMd5PasswordOk + +`func (o *BgpNeighborData) GetMd5PasswordOk() (*string, bool)` + +GetMd5PasswordOk returns a tuple with the Md5Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5Password + +`func (o *BgpNeighborData) SetMd5Password(v string)` + +SetMd5Password sets Md5Password field to given value. + +### HasMd5Password + +`func (o *BgpNeighborData) HasMd5Password() bool` + +HasMd5Password returns a boolean if a field has been set. + +### GetMultihop + +`func (o *BgpNeighborData) GetMultihop() bool` + +GetMultihop returns the Multihop field if non-nil, zero value otherwise. + +### GetMultihopOk + +`func (o *BgpNeighborData) GetMultihopOk() (*bool, bool)` + +GetMultihopOk returns a tuple with the Multihop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMultihop + +`func (o *BgpNeighborData) SetMultihop(v bool)` + +SetMultihop sets Multihop field to given value. + +### HasMultihop + +`func (o *BgpNeighborData) HasMultihop() bool` + +HasMultihop returns a boolean if a field has been set. + +### GetPeerAs + +`func (o *BgpNeighborData) GetPeerAs() int32` + +GetPeerAs returns the PeerAs field if non-nil, zero value otherwise. + +### GetPeerAsOk + +`func (o *BgpNeighborData) GetPeerAsOk() (*int32, bool)` + +GetPeerAsOk returns a tuple with the PeerAs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAs + +`func (o *BgpNeighborData) SetPeerAs(v int32)` + +SetPeerAs sets PeerAs field to given value. + +### HasPeerAs + +`func (o *BgpNeighborData) HasPeerAs() bool` + +HasPeerAs returns a boolean if a field has been set. + +### GetPeerIps + +`func (o *BgpNeighborData) GetPeerIps() []string` + +GetPeerIps returns the PeerIps field if non-nil, zero value otherwise. + +### GetPeerIpsOk + +`func (o *BgpNeighborData) GetPeerIpsOk() (*[]string, bool)` + +GetPeerIpsOk returns a tuple with the PeerIps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerIps + +`func (o *BgpNeighborData) SetPeerIps(v []string)` + +SetPeerIps sets PeerIps field to given value. + +### HasPeerIps + +`func (o *BgpNeighborData) HasPeerIps() bool` + +HasPeerIps returns a boolean if a field has been set. + +### GetRoutesIn + +`func (o *BgpNeighborData) GetRoutesIn() []BgpRoute` + +GetRoutesIn returns the RoutesIn field if non-nil, zero value otherwise. + +### GetRoutesInOk + +`func (o *BgpNeighborData) GetRoutesInOk() (*[]BgpRoute, bool)` + +GetRoutesInOk returns a tuple with the RoutesIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoutesIn + +`func (o *BgpNeighborData) SetRoutesIn(v []BgpRoute)` + +SetRoutesIn sets RoutesIn field to given value. + +### HasRoutesIn + +`func (o *BgpNeighborData) HasRoutesIn() bool` + +HasRoutesIn returns a boolean if a field has been set. + +### GetRoutesOut + +`func (o *BgpNeighborData) GetRoutesOut() []BgpRoute` + +GetRoutesOut returns the RoutesOut field if non-nil, zero value otherwise. + +### GetRoutesOutOk + +`func (o *BgpNeighborData) GetRoutesOutOk() (*[]BgpRoute, bool)` + +GetRoutesOutOk returns a tuple with the RoutesOut field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoutesOut + +`func (o *BgpNeighborData) SetRoutesOut(v []BgpRoute)` + +SetRoutesOut sets RoutesOut field to given value. + +### HasRoutesOut + +`func (o *BgpNeighborData) HasRoutesOut() bool` + +HasRoutesOut returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpRoute.md b/services/metalv1/docs/BgpRoute.md new file mode 100644 index 00000000..173db91e --- /dev/null +++ b/services/metalv1/docs/BgpRoute.md @@ -0,0 +1,82 @@ +# BgpRoute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Exact** | Pointer to **bool** | | [optional] +**Route** | Pointer to **string** | | [optional] + +## Methods + +### NewBgpRoute + +`func NewBgpRoute() *BgpRoute` + +NewBgpRoute instantiates a new BgpRoute object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpRouteWithDefaults + +`func NewBgpRouteWithDefaults() *BgpRoute` + +NewBgpRouteWithDefaults instantiates a new BgpRoute object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExact + +`func (o *BgpRoute) GetExact() bool` + +GetExact returns the Exact field if non-nil, zero value otherwise. + +### GetExactOk + +`func (o *BgpRoute) GetExactOk() (*bool, bool)` + +GetExactOk returns a tuple with the Exact field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExact + +`func (o *BgpRoute) SetExact(v bool)` + +SetExact sets Exact field to given value. + +### HasExact + +`func (o *BgpRoute) HasExact() bool` + +HasExact returns a boolean if a field has been set. + +### GetRoute + +`func (o *BgpRoute) GetRoute() string` + +GetRoute returns the Route field if non-nil, zero value otherwise. + +### GetRouteOk + +`func (o *BgpRoute) GetRouteOk() (*string, bool)` + +GetRouteOk returns a tuple with the Route field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoute + +`func (o *BgpRoute) SetRoute(v string)` + +SetRoute sets Route field to given value. + +### HasRoute + +`func (o *BgpRoute) HasRoute() bool` + +HasRoute returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpSession.md b/services/metalv1/docs/BgpSession.md new file mode 100644 index 00000000..f8aaf294 --- /dev/null +++ b/services/metalv1/docs/BgpSession.md @@ -0,0 +1,259 @@ +# BgpSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | [**BgpSessionAddressFamily**](BgpSessionAddressFamily.md) | | +**CreatedAt** | Pointer to **time.Time** | | [optional] +**DefaultRoute** | Pointer to **bool** | | [optional] +**Device** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**LearnedRoutes** | Pointer to **[]string** | | [optional] +**Status** | Pointer to **string** | The status of the BGP Session. Multiple status values may be reported when the device is connected to multiple switches, one value per switch. Each status will start with \"unknown\" and progress to \"up\" or \"down\" depending on the connected device. Subsequent \"unknown\" values indicate a problem acquiring status from the switch. | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewBgpSession + +`func NewBgpSession(addressFamily BgpSessionAddressFamily, ) *BgpSession` + +NewBgpSession instantiates a new BgpSession object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpSessionWithDefaults + +`func NewBgpSessionWithDefaults() *BgpSession` + +NewBgpSessionWithDefaults instantiates a new BgpSession object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *BgpSession) GetAddressFamily() BgpSessionAddressFamily` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *BgpSession) GetAddressFamilyOk() (*BgpSessionAddressFamily, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *BgpSession) SetAddressFamily(v BgpSessionAddressFamily)` + +SetAddressFamily sets AddressFamily field to given value. + + +### GetCreatedAt + +`func (o *BgpSession) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *BgpSession) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *BgpSession) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *BgpSession) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDefaultRoute + +`func (o *BgpSession) GetDefaultRoute() bool` + +GetDefaultRoute returns the DefaultRoute field if non-nil, zero value otherwise. + +### GetDefaultRouteOk + +`func (o *BgpSession) GetDefaultRouteOk() (*bool, bool)` + +GetDefaultRouteOk returns a tuple with the DefaultRoute field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultRoute + +`func (o *BgpSession) SetDefaultRoute(v bool)` + +SetDefaultRoute sets DefaultRoute field to given value. + +### HasDefaultRoute + +`func (o *BgpSession) HasDefaultRoute() bool` + +HasDefaultRoute returns a boolean if a field has been set. + +### GetDevice + +`func (o *BgpSession) GetDevice() Href` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *BgpSession) GetDeviceOk() (*Href, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *BgpSession) SetDevice(v Href)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *BgpSession) HasDevice() bool` + +HasDevice returns a boolean if a field has been set. + +### GetHref + +`func (o *BgpSession) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *BgpSession) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *BgpSession) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *BgpSession) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *BgpSession) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *BgpSession) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *BgpSession) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *BgpSession) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLearnedRoutes + +`func (o *BgpSession) GetLearnedRoutes() []string` + +GetLearnedRoutes returns the LearnedRoutes field if non-nil, zero value otherwise. + +### GetLearnedRoutesOk + +`func (o *BgpSession) GetLearnedRoutesOk() (*[]string, bool)` + +GetLearnedRoutesOk returns a tuple with the LearnedRoutes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLearnedRoutes + +`func (o *BgpSession) SetLearnedRoutes(v []string)` + +SetLearnedRoutes sets LearnedRoutes field to given value. + +### HasLearnedRoutes + +`func (o *BgpSession) HasLearnedRoutes() bool` + +HasLearnedRoutes returns a boolean if a field has been set. + +### GetStatus + +`func (o *BgpSession) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *BgpSession) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *BgpSession) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *BgpSession) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *BgpSession) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *BgpSession) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *BgpSession) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *BgpSession) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpSessionAddressFamily.md b/services/metalv1/docs/BgpSessionAddressFamily.md new file mode 100644 index 00000000..c9c48a48 --- /dev/null +++ b/services/metalv1/docs/BgpSessionAddressFamily.md @@ -0,0 +1,13 @@ +# BgpSessionAddressFamily + +## Enum + + +* `IPV4` (value: `"ipv4"`) + +* `IPV6` (value: `"ipv6"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpSessionList.md b/services/metalv1/docs/BgpSessionList.md new file mode 100644 index 00000000..3df3ac31 --- /dev/null +++ b/services/metalv1/docs/BgpSessionList.md @@ -0,0 +1,56 @@ +# BgpSessionList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpSessions** | Pointer to [**[]BgpSession**](BgpSession.md) | | [optional] + +## Methods + +### NewBgpSessionList + +`func NewBgpSessionList() *BgpSessionList` + +NewBgpSessionList instantiates a new BgpSessionList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpSessionListWithDefaults + +`func NewBgpSessionListWithDefaults() *BgpSessionList` + +NewBgpSessionListWithDefaults instantiates a new BgpSessionList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpSessions + +`func (o *BgpSessionList) GetBgpSessions() []BgpSession` + +GetBgpSessions returns the BgpSessions field if non-nil, zero value otherwise. + +### GetBgpSessionsOk + +`func (o *BgpSessionList) GetBgpSessionsOk() (*[]BgpSession, bool)` + +GetBgpSessionsOk returns a tuple with the BgpSessions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpSessions + +`func (o *BgpSessionList) SetBgpSessions(v []BgpSession)` + +SetBgpSessions sets BgpSessions field to given value. + +### HasBgpSessions + +`func (o *BgpSessionList) HasBgpSessions() bool` + +HasBgpSessions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BgpSessionNeighbors.md b/services/metalv1/docs/BgpSessionNeighbors.md new file mode 100644 index 00000000..19760c62 --- /dev/null +++ b/services/metalv1/docs/BgpSessionNeighbors.md @@ -0,0 +1,56 @@ +# BgpSessionNeighbors + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpNeighbors** | Pointer to [**[]BgpNeighborData**](BgpNeighborData.md) | A list of BGP session neighbor data | [optional] + +## Methods + +### NewBgpSessionNeighbors + +`func NewBgpSessionNeighbors() *BgpSessionNeighbors` + +NewBgpSessionNeighbors instantiates a new BgpSessionNeighbors object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBgpSessionNeighborsWithDefaults + +`func NewBgpSessionNeighborsWithDefaults() *BgpSessionNeighbors` + +NewBgpSessionNeighborsWithDefaults instantiates a new BgpSessionNeighbors object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpNeighbors + +`func (o *BgpSessionNeighbors) GetBgpNeighbors() []BgpNeighborData` + +GetBgpNeighbors returns the BgpNeighbors field if non-nil, zero value otherwise. + +### GetBgpNeighborsOk + +`func (o *BgpSessionNeighbors) GetBgpNeighborsOk() (*[]BgpNeighborData, bool)` + +GetBgpNeighborsOk returns a tuple with the BgpNeighbors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpNeighbors + +`func (o *BgpSessionNeighbors) SetBgpNeighbors(v []BgpNeighborData)` + +SetBgpNeighbors sets BgpNeighbors field to given value. + +### HasBgpNeighbors + +`func (o *BgpSessionNeighbors) HasBgpNeighbors() bool` + +HasBgpNeighbors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/BondPortData.md b/services/metalv1/docs/BondPortData.md new file mode 100644 index 00000000..14e2d0a0 --- /dev/null +++ b/services/metalv1/docs/BondPortData.md @@ -0,0 +1,82 @@ +# BondPortData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | ID of the bonding port | [optional] +**Name** | Pointer to **string** | Name of the port interface for the bond (\"bond0\") | [optional] + +## Methods + +### NewBondPortData + +`func NewBondPortData() *BondPortData` + +NewBondPortData instantiates a new BondPortData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBondPortDataWithDefaults + +`func NewBondPortDataWithDefaults() *BondPortData` + +NewBondPortDataWithDefaults instantiates a new BondPortData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *BondPortData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *BondPortData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *BondPortData) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *BondPortData) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *BondPortData) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *BondPortData) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *BondPortData) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *BondPortData) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityApi.md b/services/metalv1/docs/CapacityApi.md new file mode 100644 index 00000000..fe40e370 --- /dev/null +++ b/services/metalv1/docs/CapacityApi.md @@ -0,0 +1,408 @@ +# \CapacityApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CheckCapacityForFacility**](CapacityApi.md#CheckCapacityForFacility) | **Post** /capacity | Check capacity +[**CheckCapacityForMetro**](CapacityApi.md#CheckCapacityForMetro) | **Post** /capacity/metros | Check capacity for a metro +[**FindCapacityForFacility**](CapacityApi.md#FindCapacityForFacility) | **Get** /capacity | View capacity +[**FindCapacityForMetro**](CapacityApi.md#FindCapacityForMetro) | **Get** /capacity/metros | View capacity for metros +[**FindOrganizationCapacityPerFacility**](CapacityApi.md#FindOrganizationCapacityPerFacility) | **Get** /organizations/{id}/capacity | View available hardware plans per Facility for given organization +[**FindOrganizationCapacityPerMetro**](CapacityApi.md#FindOrganizationCapacityPerMetro) | **Get** /organizations/{id}/capacity/metros | View available hardware plans per Metro for given organization + + + +## CheckCapacityForFacility + +> CapacityCheckPerFacilityList CheckCapacityForFacility(ctx).CapacityInput(capacityInput).Execute() + +Check capacity + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + capacityInput := *openapiclient.NewCapacityInput() // CapacityInput | Facility to check capacity in + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.CheckCapacityForFacility(context.Background()).CapacityInput(capacityInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.CheckCapacityForFacility``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CheckCapacityForFacility`: CapacityCheckPerFacilityList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.CheckCapacityForFacility`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCheckCapacityForFacilityRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **capacityInput** | [**CapacityInput**](CapacityInput.md) | Facility to check capacity in | + +### Return type + +[**CapacityCheckPerFacilityList**](CapacityCheckPerFacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CheckCapacityForMetro + +> CapacityCheckPerMetroList CheckCapacityForMetro(ctx).CapacityInput(capacityInput).Execute() + +Check capacity for a metro + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + capacityInput := *openapiclient.NewCapacityInput() // CapacityInput | Metro to check capacity in + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.CheckCapacityForMetro(context.Background()).CapacityInput(capacityInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.CheckCapacityForMetro``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CheckCapacityForMetro`: CapacityCheckPerMetroList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.CheckCapacityForMetro`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCheckCapacityForMetroRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **capacityInput** | [**CapacityInput**](CapacityInput.md) | Metro to check capacity in | + +### Return type + +[**CapacityCheckPerMetroList**](CapacityCheckPerMetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindCapacityForFacility + +> CapacityList FindCapacityForFacility(ctx).Execute() + +View capacity + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.FindCapacityForFacility(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.FindCapacityForFacility``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindCapacityForFacility`: CapacityList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.FindCapacityForFacility`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindCapacityForFacilityRequest struct via the builder pattern + + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindCapacityForMetro + +> CapacityList FindCapacityForMetro(ctx).Execute() + +View capacity for metros + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.FindCapacityForMetro(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.FindCapacityForMetro``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindCapacityForMetro`: CapacityList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.FindCapacityForMetro`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindCapacityForMetroRequest struct via the builder pattern + + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationCapacityPerFacility + +> CapacityList FindOrganizationCapacityPerFacility(ctx, id).Execute() + +View available hardware plans per Facility for given organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.FindOrganizationCapacityPerFacility(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.FindOrganizationCapacityPerFacility``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationCapacityPerFacility`: CapacityList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.FindOrganizationCapacityPerFacility`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationCapacityPerFacilityRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationCapacityPerMetro + +> CapacityList FindOrganizationCapacityPerMetro(ctx, id).Execute() + +View available hardware plans per Metro for given organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.CapacityApi.FindOrganizationCapacityPerMetro(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CapacityApi.FindOrganizationCapacityPerMetro``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationCapacityPerMetro`: CapacityList + fmt.Fprintf(os.Stdout, "Response from `CapacityApi.FindOrganizationCapacityPerMetro`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationCapacityPerMetroRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**CapacityList**](CapacityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/CapacityCheckPerFacilityInfo.md b/services/metalv1/docs/CapacityCheckPerFacilityInfo.md new file mode 100644 index 00000000..15209805 --- /dev/null +++ b/services/metalv1/docs/CapacityCheckPerFacilityInfo.md @@ -0,0 +1,134 @@ +# CapacityCheckPerFacilityInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Available** | Pointer to **bool** | | [optional] +**Facility** | Pointer to **string** | | [optional] +**Plan** | Pointer to **string** | | [optional] +**Quantity** | Pointer to **string** | | [optional] + +## Methods + +### NewCapacityCheckPerFacilityInfo + +`func NewCapacityCheckPerFacilityInfo() *CapacityCheckPerFacilityInfo` + +NewCapacityCheckPerFacilityInfo instantiates a new CapacityCheckPerFacilityInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityCheckPerFacilityInfoWithDefaults + +`func NewCapacityCheckPerFacilityInfoWithDefaults() *CapacityCheckPerFacilityInfo` + +NewCapacityCheckPerFacilityInfoWithDefaults instantiates a new CapacityCheckPerFacilityInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvailable + +`func (o *CapacityCheckPerFacilityInfo) GetAvailable() bool` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *CapacityCheckPerFacilityInfo) GetAvailableOk() (*bool, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *CapacityCheckPerFacilityInfo) SetAvailable(v bool)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *CapacityCheckPerFacilityInfo) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetFacility + +`func (o *CapacityCheckPerFacilityInfo) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *CapacityCheckPerFacilityInfo) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *CapacityCheckPerFacilityInfo) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *CapacityCheckPerFacilityInfo) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetPlan + +`func (o *CapacityCheckPerFacilityInfo) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *CapacityCheckPerFacilityInfo) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *CapacityCheckPerFacilityInfo) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *CapacityCheckPerFacilityInfo) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetQuantity + +`func (o *CapacityCheckPerFacilityInfo) GetQuantity() string` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *CapacityCheckPerFacilityInfo) GetQuantityOk() (*string, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *CapacityCheckPerFacilityInfo) SetQuantity(v string)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *CapacityCheckPerFacilityInfo) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityCheckPerFacilityList.md b/services/metalv1/docs/CapacityCheckPerFacilityList.md new file mode 100644 index 00000000..85f2d61a --- /dev/null +++ b/services/metalv1/docs/CapacityCheckPerFacilityList.md @@ -0,0 +1,56 @@ +# CapacityCheckPerFacilityList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Servers** | Pointer to [**[]CapacityCheckPerFacilityInfo**](CapacityCheckPerFacilityInfo.md) | | [optional] + +## Methods + +### NewCapacityCheckPerFacilityList + +`func NewCapacityCheckPerFacilityList() *CapacityCheckPerFacilityList` + +NewCapacityCheckPerFacilityList instantiates a new CapacityCheckPerFacilityList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityCheckPerFacilityListWithDefaults + +`func NewCapacityCheckPerFacilityListWithDefaults() *CapacityCheckPerFacilityList` + +NewCapacityCheckPerFacilityListWithDefaults instantiates a new CapacityCheckPerFacilityList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetServers + +`func (o *CapacityCheckPerFacilityList) GetServers() []CapacityCheckPerFacilityInfo` + +GetServers returns the Servers field if non-nil, zero value otherwise. + +### GetServersOk + +`func (o *CapacityCheckPerFacilityList) GetServersOk() (*[]CapacityCheckPerFacilityInfo, bool)` + +GetServersOk returns a tuple with the Servers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServers + +`func (o *CapacityCheckPerFacilityList) SetServers(v []CapacityCheckPerFacilityInfo)` + +SetServers sets Servers field to given value. + +### HasServers + +`func (o *CapacityCheckPerFacilityList) HasServers() bool` + +HasServers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityCheckPerMetroInfo.md b/services/metalv1/docs/CapacityCheckPerMetroInfo.md new file mode 100644 index 00000000..c745da9a --- /dev/null +++ b/services/metalv1/docs/CapacityCheckPerMetroInfo.md @@ -0,0 +1,134 @@ +# CapacityCheckPerMetroInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Available** | Pointer to **bool** | Returns true if there is enough capacity in the metro to fulfill the quantity set. Returns false if there is not enough. | [optional] +**Metro** | Pointer to **string** | The metro ID or code sent to check capacity. | [optional] +**Plan** | Pointer to **string** | The plan ID or slug sent to check capacity. | [optional] +**Quantity** | Pointer to **string** | The number of servers sent to check capacity. | [optional] + +## Methods + +### NewCapacityCheckPerMetroInfo + +`func NewCapacityCheckPerMetroInfo() *CapacityCheckPerMetroInfo` + +NewCapacityCheckPerMetroInfo instantiates a new CapacityCheckPerMetroInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityCheckPerMetroInfoWithDefaults + +`func NewCapacityCheckPerMetroInfoWithDefaults() *CapacityCheckPerMetroInfo` + +NewCapacityCheckPerMetroInfoWithDefaults instantiates a new CapacityCheckPerMetroInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvailable + +`func (o *CapacityCheckPerMetroInfo) GetAvailable() bool` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *CapacityCheckPerMetroInfo) GetAvailableOk() (*bool, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *CapacityCheckPerMetroInfo) SetAvailable(v bool)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *CapacityCheckPerMetroInfo) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetMetro + +`func (o *CapacityCheckPerMetroInfo) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *CapacityCheckPerMetroInfo) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *CapacityCheckPerMetroInfo) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *CapacityCheckPerMetroInfo) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetPlan + +`func (o *CapacityCheckPerMetroInfo) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *CapacityCheckPerMetroInfo) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *CapacityCheckPerMetroInfo) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *CapacityCheckPerMetroInfo) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetQuantity + +`func (o *CapacityCheckPerMetroInfo) GetQuantity() string` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *CapacityCheckPerMetroInfo) GetQuantityOk() (*string, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *CapacityCheckPerMetroInfo) SetQuantity(v string)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *CapacityCheckPerMetroInfo) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityCheckPerMetroList.md b/services/metalv1/docs/CapacityCheckPerMetroList.md new file mode 100644 index 00000000..58f5a5e6 --- /dev/null +++ b/services/metalv1/docs/CapacityCheckPerMetroList.md @@ -0,0 +1,56 @@ +# CapacityCheckPerMetroList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Servers** | Pointer to [**[]CapacityCheckPerMetroInfo**](CapacityCheckPerMetroInfo.md) | | [optional] + +## Methods + +### NewCapacityCheckPerMetroList + +`func NewCapacityCheckPerMetroList() *CapacityCheckPerMetroList` + +NewCapacityCheckPerMetroList instantiates a new CapacityCheckPerMetroList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityCheckPerMetroListWithDefaults + +`func NewCapacityCheckPerMetroListWithDefaults() *CapacityCheckPerMetroList` + +NewCapacityCheckPerMetroListWithDefaults instantiates a new CapacityCheckPerMetroList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetServers + +`func (o *CapacityCheckPerMetroList) GetServers() []CapacityCheckPerMetroInfo` + +GetServers returns the Servers field if non-nil, zero value otherwise. + +### GetServersOk + +`func (o *CapacityCheckPerMetroList) GetServersOk() (*[]CapacityCheckPerMetroInfo, bool)` + +GetServersOk returns a tuple with the Servers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServers + +`func (o *CapacityCheckPerMetroList) SetServers(v []CapacityCheckPerMetroInfo)` + +SetServers sets Servers field to given value. + +### HasServers + +`func (o *CapacityCheckPerMetroList) HasServers() bool` + +HasServers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityInput.md b/services/metalv1/docs/CapacityInput.md new file mode 100644 index 00000000..dbc92b5e --- /dev/null +++ b/services/metalv1/docs/CapacityInput.md @@ -0,0 +1,56 @@ +# CapacityInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Servers** | Pointer to [**[]ServerInfo**](ServerInfo.md) | | [optional] + +## Methods + +### NewCapacityInput + +`func NewCapacityInput() *CapacityInput` + +NewCapacityInput instantiates a new CapacityInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityInputWithDefaults + +`func NewCapacityInputWithDefaults() *CapacityInput` + +NewCapacityInputWithDefaults instantiates a new CapacityInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetServers + +`func (o *CapacityInput) GetServers() []ServerInfo` + +GetServers returns the Servers field if non-nil, zero value otherwise. + +### GetServersOk + +`func (o *CapacityInput) GetServersOk() (*[]ServerInfo, bool)` + +GetServersOk returns a tuple with the Servers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServers + +`func (o *CapacityInput) SetServers(v []ServerInfo)` + +SetServers sets Servers field to given value. + +### HasServers + +`func (o *CapacityInput) HasServers() bool` + +HasServers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityLevelPerBaremetal.md b/services/metalv1/docs/CapacityLevelPerBaremetal.md new file mode 100644 index 00000000..926dc475 --- /dev/null +++ b/services/metalv1/docs/CapacityLevelPerBaremetal.md @@ -0,0 +1,56 @@ +# CapacityLevelPerBaremetal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Level** | Pointer to **string** | | [optional] + +## Methods + +### NewCapacityLevelPerBaremetal + +`func NewCapacityLevelPerBaremetal() *CapacityLevelPerBaremetal` + +NewCapacityLevelPerBaremetal instantiates a new CapacityLevelPerBaremetal object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityLevelPerBaremetalWithDefaults + +`func NewCapacityLevelPerBaremetalWithDefaults() *CapacityLevelPerBaremetal` + +NewCapacityLevelPerBaremetalWithDefaults instantiates a new CapacityLevelPerBaremetal object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLevel + +`func (o *CapacityLevelPerBaremetal) GetLevel() string` + +GetLevel returns the Level field if non-nil, zero value otherwise. + +### GetLevelOk + +`func (o *CapacityLevelPerBaremetal) GetLevelOk() (*string, bool)` + +GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLevel + +`func (o *CapacityLevelPerBaremetal) SetLevel(v string)` + +SetLevel sets Level field to given value. + +### HasLevel + +`func (o *CapacityLevelPerBaremetal) HasLevel() bool` + +HasLevel returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CapacityList.md b/services/metalv1/docs/CapacityList.md new file mode 100644 index 00000000..258d9a67 --- /dev/null +++ b/services/metalv1/docs/CapacityList.md @@ -0,0 +1,56 @@ +# CapacityList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Capacity** | Pointer to [**map[string]map[string]CapacityLevelPerBaremetal**](map.md) | | [optional] + +## Methods + +### NewCapacityList + +`func NewCapacityList() *CapacityList` + +NewCapacityList instantiates a new CapacityList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCapacityListWithDefaults + +`func NewCapacityListWithDefaults() *CapacityList` + +NewCapacityListWithDefaults instantiates a new CapacityList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCapacity + +`func (o *CapacityList) GetCapacity() map[string]map[string]CapacityLevelPerBaremetal` + +GetCapacity returns the Capacity field if non-nil, zero value otherwise. + +### GetCapacityOk + +`func (o *CapacityList) GetCapacityOk() (*map[string]map[string]CapacityLevelPerBaremetal, bool)` + +GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCapacity + +`func (o *CapacityList) SetCapacity(v map[string]map[string]CapacityLevelPerBaremetal)` + +SetCapacity sets Capacity field to given value. + +### HasCapacity + +`func (o *CapacityList) HasCapacity() bool` + +HasCapacity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Component.md b/services/metalv1/docs/Component.md new file mode 100644 index 00000000..fa0d8227 --- /dev/null +++ b/services/metalv1/docs/Component.md @@ -0,0 +1,316 @@ +# Component + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | Pointer to **string** | Component UUID | [optional] [readonly] +**Vendor** | Pointer to **string** | Component vendor | [optional] [readonly] +**Model** | Pointer to **[]string** | List of models where this component version can be applied | [optional] [readonly] +**Filename** | Pointer to **string** | name of the file | [optional] [readonly] +**Version** | Pointer to **string** | Version of the component | [optional] [readonly] +**Component** | Pointer to **string** | Component type | [optional] [readonly] +**Checksum** | Pointer to **string** | File checksum | [optional] [readonly] +**UpstreamUrl** | Pointer to **string** | Location of the file | [optional] [readonly] +**RepositoryUrl** | Pointer to **string** | Location of the file in the repository | [optional] [readonly] +**CreatedAt** | Pointer to **time.Time** | Datetime when the block was created. | [optional] [readonly] +**UpdatedAt** | Pointer to **time.Time** | Datetime when the block was updated. | [optional] [readonly] + +## Methods + +### NewComponent + +`func NewComponent() *Component` + +NewComponent instantiates a new Component object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComponentWithDefaults + +`func NewComponentWithDefaults() *Component` + +NewComponentWithDefaults instantiates a new Component object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUuid + +`func (o *Component) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *Component) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *Component) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + +### HasUuid + +`func (o *Component) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### GetVendor + +`func (o *Component) GetVendor() string` + +GetVendor returns the Vendor field if non-nil, zero value otherwise. + +### GetVendorOk + +`func (o *Component) GetVendorOk() (*string, bool)` + +GetVendorOk returns a tuple with the Vendor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVendor + +`func (o *Component) SetVendor(v string)` + +SetVendor sets Vendor field to given value. + +### HasVendor + +`func (o *Component) HasVendor() bool` + +HasVendor returns a boolean if a field has been set. + +### GetModel + +`func (o *Component) GetModel() []string` + +GetModel returns the Model field if non-nil, zero value otherwise. + +### GetModelOk + +`func (o *Component) GetModelOk() (*[]string, bool)` + +GetModelOk returns a tuple with the Model field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModel + +`func (o *Component) SetModel(v []string)` + +SetModel sets Model field to given value. + +### HasModel + +`func (o *Component) HasModel() bool` + +HasModel returns a boolean if a field has been set. + +### GetFilename + +`func (o *Component) GetFilename() string` + +GetFilename returns the Filename field if non-nil, zero value otherwise. + +### GetFilenameOk + +`func (o *Component) GetFilenameOk() (*string, bool)` + +GetFilenameOk returns a tuple with the Filename field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilename + +`func (o *Component) SetFilename(v string)` + +SetFilename sets Filename field to given value. + +### HasFilename + +`func (o *Component) HasFilename() bool` + +HasFilename returns a boolean if a field has been set. + +### GetVersion + +`func (o *Component) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *Component) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *Component) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *Component) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetComponent + +`func (o *Component) GetComponent() string` + +GetComponent returns the Component field if non-nil, zero value otherwise. + +### GetComponentOk + +`func (o *Component) GetComponentOk() (*string, bool)` + +GetComponentOk returns a tuple with the Component field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComponent + +`func (o *Component) SetComponent(v string)` + +SetComponent sets Component field to given value. + +### HasComponent + +`func (o *Component) HasComponent() bool` + +HasComponent returns a boolean if a field has been set. + +### GetChecksum + +`func (o *Component) GetChecksum() string` + +GetChecksum returns the Checksum field if non-nil, zero value otherwise. + +### GetChecksumOk + +`func (o *Component) GetChecksumOk() (*string, bool)` + +GetChecksumOk returns a tuple with the Checksum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChecksum + +`func (o *Component) SetChecksum(v string)` + +SetChecksum sets Checksum field to given value. + +### HasChecksum + +`func (o *Component) HasChecksum() bool` + +HasChecksum returns a boolean if a field has been set. + +### GetUpstreamUrl + +`func (o *Component) GetUpstreamUrl() string` + +GetUpstreamUrl returns the UpstreamUrl field if non-nil, zero value otherwise. + +### GetUpstreamUrlOk + +`func (o *Component) GetUpstreamUrlOk() (*string, bool)` + +GetUpstreamUrlOk returns a tuple with the UpstreamUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpstreamUrl + +`func (o *Component) SetUpstreamUrl(v string)` + +SetUpstreamUrl sets UpstreamUrl field to given value. + +### HasUpstreamUrl + +`func (o *Component) HasUpstreamUrl() bool` + +HasUpstreamUrl returns a boolean if a field has been set. + +### GetRepositoryUrl + +`func (o *Component) GetRepositoryUrl() string` + +GetRepositoryUrl returns the RepositoryUrl field if non-nil, zero value otherwise. + +### GetRepositoryUrlOk + +`func (o *Component) GetRepositoryUrlOk() (*string, bool)` + +GetRepositoryUrlOk returns a tuple with the RepositoryUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRepositoryUrl + +`func (o *Component) SetRepositoryUrl(v string)` + +SetRepositoryUrl sets RepositoryUrl field to given value. + +### HasRepositoryUrl + +`func (o *Component) HasRepositoryUrl() bool` + +HasRepositoryUrl returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Component) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Component) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Component) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Component) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Component) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Component) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Component) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Component) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ConsoleLogDetailsApi.md b/services/metalv1/docs/ConsoleLogDetailsApi.md new file mode 100644 index 00000000..bd652486 --- /dev/null +++ b/services/metalv1/docs/ConsoleLogDetailsApi.md @@ -0,0 +1,79 @@ +# \ConsoleLogDetailsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CaptureScreenshot**](ConsoleLogDetailsApi.md#CaptureScreenshot) | **Get** /devices/{id}/diagnostics/screenshot | + + + +## CaptureScreenshot + +> *os.File CaptureScreenshot(ctx, id).Execute() + + + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConsoleLogDetailsApi.CaptureScreenshot(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConsoleLogDetailsApi.CaptureScreenshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CaptureScreenshot`: *os.File + fmt.Fprintf(os.Stdout, "Response from `ConsoleLogDetailsApi.CaptureScreenshot`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCaptureScreenshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/jpeg, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Coordinates.md b/services/metalv1/docs/Coordinates.md new file mode 100644 index 00000000..13ce3650 --- /dev/null +++ b/services/metalv1/docs/Coordinates.md @@ -0,0 +1,82 @@ +# Coordinates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Latitude** | Pointer to **string** | | [optional] +**Longitude** | Pointer to **string** | | [optional] + +## Methods + +### NewCoordinates + +`func NewCoordinates() *Coordinates` + +NewCoordinates instantiates a new Coordinates object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCoordinatesWithDefaults + +`func NewCoordinatesWithDefaults() *Coordinates` + +NewCoordinatesWithDefaults instantiates a new Coordinates object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLatitude + +`func (o *Coordinates) GetLatitude() string` + +GetLatitude returns the Latitude field if non-nil, zero value otherwise. + +### GetLatitudeOk + +`func (o *Coordinates) GetLatitudeOk() (*string, bool)` + +GetLatitudeOk returns a tuple with the Latitude field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLatitude + +`func (o *Coordinates) SetLatitude(v string)` + +SetLatitude sets Latitude field to given value. + +### HasLatitude + +`func (o *Coordinates) HasLatitude() bool` + +HasLatitude returns a boolean if a field has been set. + +### GetLongitude + +`func (o *Coordinates) GetLongitude() string` + +GetLongitude returns the Longitude field if non-nil, zero value otherwise. + +### GetLongitudeOk + +`func (o *Coordinates) GetLongitudeOk() (*string, bool)` + +GetLongitudeOk returns a tuple with the Longitude field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLongitude + +`func (o *Coordinates) SetLongitude(v string)` + +SetLongitude sets Longitude field to given value. + +### HasLongitude + +`func (o *Coordinates) HasLongitude() bool` + +HasLongitude returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateDeviceRequest.md b/services/metalv1/docs/CreateDeviceRequest.md new file mode 100644 index 00000000..eec7b77b --- /dev/null +++ b/services/metalv1/docs/CreateDeviceRequest.md @@ -0,0 +1,712 @@ +# CreateDeviceRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metro** | **string** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**AlwaysPxe** | Pointer to **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] [default to false] +**BillingCycle** | Pointer to [**DeviceCreateInputBillingCycle**](DeviceCreateInputBillingCycle.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] [default to {}] +**Description** | Pointer to **string** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**Features** | Pointer to **[]string** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] +**HardwareReservationId** | Pointer to **string** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. | [optional] [default to ""] +**Hostname** | Pointer to **string** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] +**IpAddresses** | Pointer to [**[]IPAddress**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**IpxeScriptUrl** | Pointer to **string** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to false] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**NoSshKeys** | Pointer to **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to false] +**OperatingSystem** | **string** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**Plan** | **string** | The slug of the device plan to provision. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] [default to 28] +**ProjectSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] [default to 31] +**SpotInstance** | Pointer to **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum amount to bid for a spot instance. | [optional] +**SshKeys** | Pointer to [**[]SSHKeyInput**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UserSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**Userdata** | Pointer to **string** | The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. | [optional] +**Facility** | **[]string** | The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. | + +## Methods + +### NewCreateDeviceRequest + +`func NewCreateDeviceRequest(metro string, operatingSystem string, plan string, facility []string, ) *CreateDeviceRequest` + +NewCreateDeviceRequest instantiates a new CreateDeviceRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateDeviceRequestWithDefaults + +`func NewCreateDeviceRequestWithDefaults() *CreateDeviceRequest` + +NewCreateDeviceRequestWithDefaults instantiates a new CreateDeviceRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMetro + +`func (o *CreateDeviceRequest) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *CreateDeviceRequest) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *CreateDeviceRequest) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetAlwaysPxe + +`func (o *CreateDeviceRequest) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *CreateDeviceRequest) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *CreateDeviceRequest) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *CreateDeviceRequest) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *CreateDeviceRequest) GetBillingCycle() DeviceCreateInputBillingCycle` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *CreateDeviceRequest) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *CreateDeviceRequest) SetBillingCycle(v DeviceCreateInputBillingCycle)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *CreateDeviceRequest) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *CreateDeviceRequest) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *CreateDeviceRequest) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *CreateDeviceRequest) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *CreateDeviceRequest) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *CreateDeviceRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *CreateDeviceRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *CreateDeviceRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *CreateDeviceRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *CreateDeviceRequest) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *CreateDeviceRequest) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *CreateDeviceRequest) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *CreateDeviceRequest) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHardwareReservationId + +`func (o *CreateDeviceRequest) GetHardwareReservationId() string` + +GetHardwareReservationId returns the HardwareReservationId field if non-nil, zero value otherwise. + +### GetHardwareReservationIdOk + +`func (o *CreateDeviceRequest) GetHardwareReservationIdOk() (*string, bool)` + +GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservationId + +`func (o *CreateDeviceRequest) SetHardwareReservationId(v string)` + +SetHardwareReservationId sets HardwareReservationId field to given value. + +### HasHardwareReservationId + +`func (o *CreateDeviceRequest) HasHardwareReservationId() bool` + +HasHardwareReservationId returns a boolean if a field has been set. + +### GetHostname + +`func (o *CreateDeviceRequest) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *CreateDeviceRequest) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *CreateDeviceRequest) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *CreateDeviceRequest) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *CreateDeviceRequest) GetIpAddresses() []IPAddress` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *CreateDeviceRequest) GetIpAddressesOk() (*[]IPAddress, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *CreateDeviceRequest) SetIpAddresses(v []IPAddress)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *CreateDeviceRequest) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *CreateDeviceRequest) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *CreateDeviceRequest) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *CreateDeviceRequest) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *CreateDeviceRequest) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *CreateDeviceRequest) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *CreateDeviceRequest) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *CreateDeviceRequest) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *CreateDeviceRequest) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *CreateDeviceRequest) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *CreateDeviceRequest) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *CreateDeviceRequest) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *CreateDeviceRequest) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *CreateDeviceRequest) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *CreateDeviceRequest) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *CreateDeviceRequest) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *CreateDeviceRequest) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *CreateDeviceRequest) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *CreateDeviceRequest) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *CreateDeviceRequest) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + + +### GetPlan + +`func (o *CreateDeviceRequest) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *CreateDeviceRequest) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *CreateDeviceRequest) SetPlan(v string)` + +SetPlan sets Plan field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *CreateDeviceRequest) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *CreateDeviceRequest) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *CreateDeviceRequest) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *CreateDeviceRequest) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *CreateDeviceRequest) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *CreateDeviceRequest) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *CreateDeviceRequest) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *CreateDeviceRequest) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *CreateDeviceRequest) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *CreateDeviceRequest) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *CreateDeviceRequest) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *CreateDeviceRequest) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *CreateDeviceRequest) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *CreateDeviceRequest) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *CreateDeviceRequest) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *CreateDeviceRequest) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *CreateDeviceRequest) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *CreateDeviceRequest) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *CreateDeviceRequest) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *CreateDeviceRequest) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *CreateDeviceRequest) GetSshKeys() []SSHKeyInput` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *CreateDeviceRequest) GetSshKeysOk() (*[]SSHKeyInput, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *CreateDeviceRequest) SetSshKeys(v []SSHKeyInput)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *CreateDeviceRequest) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetStorage + +`func (o *CreateDeviceRequest) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *CreateDeviceRequest) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *CreateDeviceRequest) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *CreateDeviceRequest) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetTags + +`func (o *CreateDeviceRequest) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *CreateDeviceRequest) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *CreateDeviceRequest) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *CreateDeviceRequest) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *CreateDeviceRequest) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *CreateDeviceRequest) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *CreateDeviceRequest) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *CreateDeviceRequest) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *CreateDeviceRequest) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *CreateDeviceRequest) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *CreateDeviceRequest) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *CreateDeviceRequest) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *CreateDeviceRequest) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *CreateDeviceRequest) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *CreateDeviceRequest) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *CreateDeviceRequest) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + +### GetFacility + +`func (o *CreateDeviceRequest) GetFacility() []string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *CreateDeviceRequest) GetFacilityOk() (*[]string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *CreateDeviceRequest) SetFacility(v []string)` + +SetFacility sets Facility field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateEmailInput.md b/services/metalv1/docs/CreateEmailInput.md new file mode 100644 index 00000000..b9826496 --- /dev/null +++ b/services/metalv1/docs/CreateEmailInput.md @@ -0,0 +1,51 @@ +# CreateEmailInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | + +## Methods + +### NewCreateEmailInput + +`func NewCreateEmailInput(address string, ) *CreateEmailInput` + +NewCreateEmailInput instantiates a new CreateEmailInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateEmailInputWithDefaults + +`func NewCreateEmailInputWithDefaults() *CreateEmailInput` + +NewCreateEmailInputWithDefaults instantiates a new CreateEmailInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *CreateEmailInput) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *CreateEmailInput) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *CreateEmailInput) SetAddress(v string)` + +SetAddress sets Address field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateMetalGatewayRequest.md b/services/metalv1/docs/CreateMetalGatewayRequest.md new file mode 100644 index 00000000..a9016d81 --- /dev/null +++ b/services/metalv1/docs/CreateMetalGatewayRequest.md @@ -0,0 +1,98 @@ +# CreateMetalGatewayRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpReservationId** | **string** | The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. | [optional] +**VirtualNetworkId** | **string** | THe UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. | + +## Methods + +### NewCreateMetalGatewayRequest + +`func NewCreateMetalGatewayRequest(ipReservationId string, virtualNetworkId string, ) *CreateMetalGatewayRequest` + +NewCreateMetalGatewayRequest instantiates a new CreateMetalGatewayRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateMetalGatewayRequestWithDefaults + +`func NewCreateMetalGatewayRequestWithDefaults() *CreateMetalGatewayRequest` + +NewCreateMetalGatewayRequestWithDefaults instantiates a new CreateMetalGatewayRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpReservationId + +`func (o *CreateMetalGatewayRequest) GetIpReservationId() string` + +GetIpReservationId returns the IpReservationId field if non-nil, zero value otherwise. + +### GetIpReservationIdOk + +`func (o *CreateMetalGatewayRequest) GetIpReservationIdOk() (*string, bool)` + +GetIpReservationIdOk returns a tuple with the IpReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservationId + +`func (o *CreateMetalGatewayRequest) SetIpReservationId(v string)` + +SetIpReservationId sets IpReservationId field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *CreateMetalGatewayRequest) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *CreateMetalGatewayRequest) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *CreateMetalGatewayRequest) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *CreateMetalGatewayRequest) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetVirtualNetworkId + +`func (o *CreateMetalGatewayRequest) GetVirtualNetworkId() string` + +GetVirtualNetworkId returns the VirtualNetworkId field if non-nil, zero value otherwise. + +### GetVirtualNetworkIdOk + +`func (o *CreateMetalGatewayRequest) GetVirtualNetworkIdOk() (*string, bool)` + +GetVirtualNetworkIdOk returns a tuple with the VirtualNetworkId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetworkId + +`func (o *CreateMetalGatewayRequest) SetVirtualNetworkId(v string)` + +SetVirtualNetworkId sets VirtualNetworkId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md b/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md new file mode 100644 index 00000000..a3b96696 --- /dev/null +++ b/services/metalv1/docs/CreateOrganizationInterconnectionRequest.md @@ -0,0 +1,390 @@ +# CreateOrganizationInterconnectionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingAccountName** | Pointer to **string** | The billing account name of the Equinix Fabric account. | [optional] +**ContactEmail** | Pointer to **string** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] +**Description** | Pointer to **string** | | [optional] +**Metro** | **string** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | +**Mode** | Pointer to [**DedicatedPortCreateInputMode**](DedicatedPortCreateInputMode.md) | | [optional] +**Name** | **string** | | +**Project** | Pointer to **string** | | [optional] +**Redundancy** | **string** | Either 'primary' or 'redundant'. | +**Speed** | Pointer to **int32** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VlanFabricVcCreateInputType**](VlanFabricVcCreateInputType.md) | | +**UseCase** | Pointer to **string** | The intended use case of the dedicated port. | [optional] +**ServiceTokenType** | [**VlanFabricVcCreateInputServiceTokenType**](VlanFabricVcCreateInputServiceTokenType.md) | | +**Vlans** | Pointer to **[]int32** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | [optional] +**Vrfs** | **[]string** | This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | + +## Methods + +### NewCreateOrganizationInterconnectionRequest + +`func NewCreateOrganizationInterconnectionRequest(metro string, name string, redundancy string, type_ VlanFabricVcCreateInputType, serviceTokenType VlanFabricVcCreateInputServiceTokenType, vrfs []string, ) *CreateOrganizationInterconnectionRequest` + +NewCreateOrganizationInterconnectionRequest instantiates a new CreateOrganizationInterconnectionRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateOrganizationInterconnectionRequestWithDefaults + +`func NewCreateOrganizationInterconnectionRequestWithDefaults() *CreateOrganizationInterconnectionRequest` + +NewCreateOrganizationInterconnectionRequestWithDefaults instantiates a new CreateOrganizationInterconnectionRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBillingAccountName + +`func (o *CreateOrganizationInterconnectionRequest) GetBillingAccountName() string` + +GetBillingAccountName returns the BillingAccountName field if non-nil, zero value otherwise. + +### GetBillingAccountNameOk + +`func (o *CreateOrganizationInterconnectionRequest) GetBillingAccountNameOk() (*string, bool)` + +GetBillingAccountNameOk returns a tuple with the BillingAccountName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAccountName + +`func (o *CreateOrganizationInterconnectionRequest) SetBillingAccountName(v string)` + +SetBillingAccountName sets BillingAccountName field to given value. + +### HasBillingAccountName + +`func (o *CreateOrganizationInterconnectionRequest) HasBillingAccountName() bool` + +HasBillingAccountName returns a boolean if a field has been set. + +### GetContactEmail + +`func (o *CreateOrganizationInterconnectionRequest) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *CreateOrganizationInterconnectionRequest) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *CreateOrganizationInterconnectionRequest) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *CreateOrganizationInterconnectionRequest) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *CreateOrganizationInterconnectionRequest) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *CreateOrganizationInterconnectionRequest) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *CreateOrganizationInterconnectionRequest) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *CreateOrganizationInterconnectionRequest) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMetro + +`func (o *CreateOrganizationInterconnectionRequest) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *CreateOrganizationInterconnectionRequest) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *CreateOrganizationInterconnectionRequest) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetMode + +`func (o *CreateOrganizationInterconnectionRequest) GetMode() DedicatedPortCreateInputMode` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *CreateOrganizationInterconnectionRequest) GetModeOk() (*DedicatedPortCreateInputMode, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *CreateOrganizationInterconnectionRequest) SetMode(v DedicatedPortCreateInputMode)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *CreateOrganizationInterconnectionRequest) HasMode() bool` + +HasMode returns a boolean if a field has been set. + +### GetName + +`func (o *CreateOrganizationInterconnectionRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateOrganizationInterconnectionRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateOrganizationInterconnectionRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetProject + +`func (o *CreateOrganizationInterconnectionRequest) GetProject() string` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *CreateOrganizationInterconnectionRequest) GetProjectOk() (*string, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *CreateOrganizationInterconnectionRequest) SetProject(v string)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *CreateOrganizationInterconnectionRequest) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *CreateOrganizationInterconnectionRequest) GetRedundancy() string` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *CreateOrganizationInterconnectionRequest) GetRedundancyOk() (*string, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *CreateOrganizationInterconnectionRequest) SetRedundancy(v string)` + +SetRedundancy sets Redundancy field to given value. + + +### GetSpeed + +`func (o *CreateOrganizationInterconnectionRequest) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *CreateOrganizationInterconnectionRequest) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *CreateOrganizationInterconnectionRequest) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *CreateOrganizationInterconnectionRequest) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *CreateOrganizationInterconnectionRequest) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *CreateOrganizationInterconnectionRequest) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *CreateOrganizationInterconnectionRequest) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *CreateOrganizationInterconnectionRequest) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *CreateOrganizationInterconnectionRequest) GetType() VlanFabricVcCreateInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CreateOrganizationInterconnectionRequest) GetTypeOk() (*VlanFabricVcCreateInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CreateOrganizationInterconnectionRequest) SetType(v VlanFabricVcCreateInputType)` + +SetType sets Type field to given value. + + +### GetUseCase + +`func (o *CreateOrganizationInterconnectionRequest) GetUseCase() string` + +GetUseCase returns the UseCase field if non-nil, zero value otherwise. + +### GetUseCaseOk + +`func (o *CreateOrganizationInterconnectionRequest) GetUseCaseOk() (*string, bool)` + +GetUseCaseOk returns a tuple with the UseCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseCase + +`func (o *CreateOrganizationInterconnectionRequest) SetUseCase(v string)` + +SetUseCase sets UseCase field to given value. + +### HasUseCase + +`func (o *CreateOrganizationInterconnectionRequest) HasUseCase() bool` + +HasUseCase returns a boolean if a field has been set. + +### GetServiceTokenType + +`func (o *CreateOrganizationInterconnectionRequest) GetServiceTokenType() VlanFabricVcCreateInputServiceTokenType` + +GetServiceTokenType returns the ServiceTokenType field if non-nil, zero value otherwise. + +### GetServiceTokenTypeOk + +`func (o *CreateOrganizationInterconnectionRequest) GetServiceTokenTypeOk() (*VlanFabricVcCreateInputServiceTokenType, bool)` + +GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceTokenType + +`func (o *CreateOrganizationInterconnectionRequest) SetServiceTokenType(v VlanFabricVcCreateInputServiceTokenType)` + +SetServiceTokenType sets ServiceTokenType field to given value. + + +### GetVlans + +`func (o *CreateOrganizationInterconnectionRequest) GetVlans() []int32` + +GetVlans returns the Vlans field if non-nil, zero value otherwise. + +### GetVlansOk + +`func (o *CreateOrganizationInterconnectionRequest) GetVlansOk() (*[]int32, bool)` + +GetVlansOk returns a tuple with the Vlans field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlans + +`func (o *CreateOrganizationInterconnectionRequest) SetVlans(v []int32)` + +SetVlans sets Vlans field to given value. + +### HasVlans + +`func (o *CreateOrganizationInterconnectionRequest) HasVlans() bool` + +HasVlans returns a boolean if a field has been set. + +### GetVrfs + +`func (o *CreateOrganizationInterconnectionRequest) GetVrfs() []string` + +GetVrfs returns the Vrfs field if non-nil, zero value otherwise. + +### GetVrfsOk + +`func (o *CreateOrganizationInterconnectionRequest) GetVrfsOk() (*[]string, bool)` + +GetVrfsOk returns a tuple with the Vrfs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrfs + +`func (o *CreateOrganizationInterconnectionRequest) SetVrfs(v []string)` + +SetVrfs sets Vrfs field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateSelfServiceReservationRequest.md b/services/metalv1/docs/CreateSelfServiceReservationRequest.md new file mode 100644 index 00000000..feb3f95b --- /dev/null +++ b/services/metalv1/docs/CreateSelfServiceReservationRequest.md @@ -0,0 +1,134 @@ +# CreateSelfServiceReservationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Item** | Pointer to [**[]SelfServiceReservationItemRequest**](SelfServiceReservationItemRequest.md) | | [optional] +**Notes** | Pointer to **string** | | [optional] +**Period** | Pointer to [**CreateSelfServiceReservationRequestPeriod**](CreateSelfServiceReservationRequestPeriod.md) | | [optional] +**StartDate** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewCreateSelfServiceReservationRequest + +`func NewCreateSelfServiceReservationRequest() *CreateSelfServiceReservationRequest` + +NewCreateSelfServiceReservationRequest instantiates a new CreateSelfServiceReservationRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateSelfServiceReservationRequestWithDefaults + +`func NewCreateSelfServiceReservationRequestWithDefaults() *CreateSelfServiceReservationRequest` + +NewCreateSelfServiceReservationRequestWithDefaults instantiates a new CreateSelfServiceReservationRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItem + +`func (o *CreateSelfServiceReservationRequest) GetItem() []SelfServiceReservationItemRequest` + +GetItem returns the Item field if non-nil, zero value otherwise. + +### GetItemOk + +`func (o *CreateSelfServiceReservationRequest) GetItemOk() (*[]SelfServiceReservationItemRequest, bool)` + +GetItemOk returns a tuple with the Item field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItem + +`func (o *CreateSelfServiceReservationRequest) SetItem(v []SelfServiceReservationItemRequest)` + +SetItem sets Item field to given value. + +### HasItem + +`func (o *CreateSelfServiceReservationRequest) HasItem() bool` + +HasItem returns a boolean if a field has been set. + +### GetNotes + +`func (o *CreateSelfServiceReservationRequest) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *CreateSelfServiceReservationRequest) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *CreateSelfServiceReservationRequest) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *CreateSelfServiceReservationRequest) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetPeriod + +`func (o *CreateSelfServiceReservationRequest) GetPeriod() CreateSelfServiceReservationRequestPeriod` + +GetPeriod returns the Period field if non-nil, zero value otherwise. + +### GetPeriodOk + +`func (o *CreateSelfServiceReservationRequest) GetPeriodOk() (*CreateSelfServiceReservationRequestPeriod, bool)` + +GetPeriodOk returns a tuple with the Period field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriod + +`func (o *CreateSelfServiceReservationRequest) SetPeriod(v CreateSelfServiceReservationRequestPeriod)` + +SetPeriod sets Period field to given value. + +### HasPeriod + +`func (o *CreateSelfServiceReservationRequest) HasPeriod() bool` + +HasPeriod returns a boolean if a field has been set. + +### GetStartDate + +`func (o *CreateSelfServiceReservationRequest) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *CreateSelfServiceReservationRequest) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *CreateSelfServiceReservationRequest) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *CreateSelfServiceReservationRequest) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md new file mode 100644 index 00000000..8841e44d --- /dev/null +++ b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriod.md @@ -0,0 +1,82 @@ +# CreateSelfServiceReservationRequestPeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | Pointer to [**CreateSelfServiceReservationRequestPeriodCount**](CreateSelfServiceReservationRequestPeriodCount.md) | | [optional] +**Unit** | Pointer to [**CreateSelfServiceReservationRequestPeriodUnit**](CreateSelfServiceReservationRequestPeriodUnit.md) | | [optional] + +## Methods + +### NewCreateSelfServiceReservationRequestPeriod + +`func NewCreateSelfServiceReservationRequestPeriod() *CreateSelfServiceReservationRequestPeriod` + +NewCreateSelfServiceReservationRequestPeriod instantiates a new CreateSelfServiceReservationRequestPeriod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateSelfServiceReservationRequestPeriodWithDefaults + +`func NewCreateSelfServiceReservationRequestPeriodWithDefaults() *CreateSelfServiceReservationRequestPeriod` + +NewCreateSelfServiceReservationRequestPeriodWithDefaults instantiates a new CreateSelfServiceReservationRequestPeriod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCount + +`func (o *CreateSelfServiceReservationRequestPeriod) GetCount() CreateSelfServiceReservationRequestPeriodCount` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *CreateSelfServiceReservationRequestPeriod) GetCountOk() (*CreateSelfServiceReservationRequestPeriodCount, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *CreateSelfServiceReservationRequestPeriod) SetCount(v CreateSelfServiceReservationRequestPeriodCount)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *CreateSelfServiceReservationRequestPeriod) HasCount() bool` + +HasCount returns a boolean if a field has been set. + +### GetUnit + +`func (o *CreateSelfServiceReservationRequestPeriod) GetUnit() CreateSelfServiceReservationRequestPeriodUnit` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *CreateSelfServiceReservationRequestPeriod) GetUnitOk() (*CreateSelfServiceReservationRequestPeriodUnit, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *CreateSelfServiceReservationRequestPeriod) SetUnit(v CreateSelfServiceReservationRequestPeriodUnit)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *CreateSelfServiceReservationRequestPeriod) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodCount.md b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodCount.md new file mode 100644 index 00000000..cda1594b --- /dev/null +++ b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodCount.md @@ -0,0 +1,13 @@ +# CreateSelfServiceReservationRequestPeriodCount + +## Enum + + +* `_12` (value: `12`) + +* `_36` (value: `36`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodUnit.md b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodUnit.md new file mode 100644 index 00000000..922ad38d --- /dev/null +++ b/services/metalv1/docs/CreateSelfServiceReservationRequestPeriodUnit.md @@ -0,0 +1,11 @@ +# CreateSelfServiceReservationRequestPeriodUnit + +## Enum + + +* `MONTHLY` (value: `"monthly"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DedicatedPortCreateInput.md b/services/metalv1/docs/DedicatedPortCreateInput.md new file mode 100644 index 00000000..15029a0f --- /dev/null +++ b/services/metalv1/docs/DedicatedPortCreateInput.md @@ -0,0 +1,322 @@ +# DedicatedPortCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingAccountName** | Pointer to **string** | The billing account name of the Equinix Fabric account. | [optional] +**ContactEmail** | Pointer to **string** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] +**Description** | Pointer to **string** | | [optional] +**Metro** | **string** | A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. | +**Mode** | Pointer to [**DedicatedPortCreateInputMode**](DedicatedPortCreateInputMode.md) | | [optional] +**Name** | **string** | | +**Project** | Pointer to **string** | | [optional] +**Redundancy** | **string** | Either 'primary' or 'redundant'. | +**Speed** | Pointer to **int32** | A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**DedicatedPortCreateInputType**](DedicatedPortCreateInputType.md) | | +**UseCase** | Pointer to **string** | The intended use case of the dedicated port. | [optional] + +## Methods + +### NewDedicatedPortCreateInput + +`func NewDedicatedPortCreateInput(metro string, name string, redundancy string, type_ DedicatedPortCreateInputType, ) *DedicatedPortCreateInput` + +NewDedicatedPortCreateInput instantiates a new DedicatedPortCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDedicatedPortCreateInputWithDefaults + +`func NewDedicatedPortCreateInputWithDefaults() *DedicatedPortCreateInput` + +NewDedicatedPortCreateInputWithDefaults instantiates a new DedicatedPortCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBillingAccountName + +`func (o *DedicatedPortCreateInput) GetBillingAccountName() string` + +GetBillingAccountName returns the BillingAccountName field if non-nil, zero value otherwise. + +### GetBillingAccountNameOk + +`func (o *DedicatedPortCreateInput) GetBillingAccountNameOk() (*string, bool)` + +GetBillingAccountNameOk returns a tuple with the BillingAccountName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAccountName + +`func (o *DedicatedPortCreateInput) SetBillingAccountName(v string)` + +SetBillingAccountName sets BillingAccountName field to given value. + +### HasBillingAccountName + +`func (o *DedicatedPortCreateInput) HasBillingAccountName() bool` + +HasBillingAccountName returns a boolean if a field has been set. + +### GetContactEmail + +`func (o *DedicatedPortCreateInput) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *DedicatedPortCreateInput) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *DedicatedPortCreateInput) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *DedicatedPortCreateInput) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *DedicatedPortCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *DedicatedPortCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *DedicatedPortCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *DedicatedPortCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMetro + +`func (o *DedicatedPortCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *DedicatedPortCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *DedicatedPortCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetMode + +`func (o *DedicatedPortCreateInput) GetMode() DedicatedPortCreateInputMode` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *DedicatedPortCreateInput) GetModeOk() (*DedicatedPortCreateInputMode, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *DedicatedPortCreateInput) SetMode(v DedicatedPortCreateInputMode)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *DedicatedPortCreateInput) HasMode() bool` + +HasMode returns a boolean if a field has been set. + +### GetName + +`func (o *DedicatedPortCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DedicatedPortCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DedicatedPortCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetProject + +`func (o *DedicatedPortCreateInput) GetProject() string` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *DedicatedPortCreateInput) GetProjectOk() (*string, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *DedicatedPortCreateInput) SetProject(v string)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *DedicatedPortCreateInput) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *DedicatedPortCreateInput) GetRedundancy() string` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *DedicatedPortCreateInput) GetRedundancyOk() (*string, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *DedicatedPortCreateInput) SetRedundancy(v string)` + +SetRedundancy sets Redundancy field to given value. + + +### GetSpeed + +`func (o *DedicatedPortCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *DedicatedPortCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *DedicatedPortCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *DedicatedPortCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *DedicatedPortCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *DedicatedPortCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *DedicatedPortCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *DedicatedPortCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *DedicatedPortCreateInput) GetType() DedicatedPortCreateInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DedicatedPortCreateInput) GetTypeOk() (*DedicatedPortCreateInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DedicatedPortCreateInput) SetType(v DedicatedPortCreateInputType)` + +SetType sets Type field to given value. + + +### GetUseCase + +`func (o *DedicatedPortCreateInput) GetUseCase() string` + +GetUseCase returns the UseCase field if non-nil, zero value otherwise. + +### GetUseCaseOk + +`func (o *DedicatedPortCreateInput) GetUseCaseOk() (*string, bool)` + +GetUseCaseOk returns a tuple with the UseCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUseCase + +`func (o *DedicatedPortCreateInput) SetUseCase(v string)` + +SetUseCase sets UseCase field to given value. + +### HasUseCase + +`func (o *DedicatedPortCreateInput) HasUseCase() bool` + +HasUseCase returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DedicatedPortCreateInputMode.md b/services/metalv1/docs/DedicatedPortCreateInputMode.md new file mode 100644 index 00000000..09582f87 --- /dev/null +++ b/services/metalv1/docs/DedicatedPortCreateInputMode.md @@ -0,0 +1,13 @@ +# DedicatedPortCreateInputMode + +## Enum + + +* `STANDARD` (value: `"standard"`) + +* `TUNNEL` (value: `"tunnel"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DedicatedPortCreateInputType.md b/services/metalv1/docs/DedicatedPortCreateInputType.md new file mode 100644 index 00000000..60045aa5 --- /dev/null +++ b/services/metalv1/docs/DedicatedPortCreateInputType.md @@ -0,0 +1,11 @@ +# DedicatedPortCreateInputType + +## Enum + + +* `DEDICATED` (value: `"dedicated"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Device.md b/services/metalv1/docs/Device.md new file mode 100644 index 00000000..bd82d15a --- /dev/null +++ b/services/metalv1/docs/Device.md @@ -0,0 +1,1148 @@ +# Device + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AlwaysPxe** | Pointer to **bool** | | [optional] +**BillingCycle** | Pointer to **string** | | [optional] +**BondingMode** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**DeviceCreatedBy**](DeviceCreatedBy.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] [default to {}] +**Description** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**Facility**](Facility.md) | | [optional] +**FirmwareSetId** | Pointer to **string** | The UUID of the firmware set to associate with the device. | [optional] +**HardwareReservation** | Pointer to [**HardwareReservation**](HardwareReservation.md) | | [optional] +**Hostname** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**ImageUrl** | Pointer to **string** | | [optional] +**IpAddresses** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] +**IpxeScriptUrl** | Pointer to **string** | | [optional] +**Iqn** | Pointer to **string** | | [optional] +**Locked** | Pointer to **bool** | Prevents accidental deletion of this resource when set to true. | [optional] +**Metro** | Pointer to [**DeviceMetro**](DeviceMetro.md) | | [optional] +**NetworkFrozen** | Pointer to **bool** | Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. | [optional] +**NetworkPorts** | Pointer to [**[]Port**](Port.md) | By default, servers at Equinix Metal are configured in a “bonded” mode using LACP (Link Aggregation Control Protocol). Each 2-NIC server is configured with a single bond (namely bond0) with both interfaces eth0 and eth1 as members of the bond in a default Layer 3 mode. Some device plans may have a different number of ports and bonds available. | [optional] +**OperatingSystem** | Pointer to [**OperatingSystem**](OperatingSystem.md) | | [optional] +**Actions** | Pointer to [**[]DeviceActionsInner**](DeviceActionsInner.md) | Actions supported by the device instance. | [optional] +**Plan** | Pointer to [**Plan**](Plan.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**ProjectLite** | Pointer to [**DeviceProjectLite**](DeviceProjectLite.md) | | [optional] +**ProvisioningEvents** | Pointer to [**[]Event**](Event.md) | | [optional] +**ProvisioningPercentage** | Pointer to **float32** | Only visible while device provisioning | [optional] +**RootPassword** | Pointer to **string** | Root password is automatically generated when server is provisioned and it is removed after 24 hours | [optional] +**ShortId** | Pointer to **string** | | [optional] +**SpotInstance** | Pointer to **bool** | Whether or not the device is a spot instance. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum price per hour you are willing to pay to keep this spot instance. If you are outbid, the termination will be set allowing two minutes before shutdown. | [optional] +**SshKeys** | Pointer to [**[]Href**](Href.md) | | [optional] +**State** | Pointer to [**DeviceState**](DeviceState.md) | | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**SwitchUuid** | Pointer to **string** | Switch short id. This can be used to determine if two devices are connected to the same switch, for example. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**User** | Pointer to **string** | | [optional] +**Userdata** | Pointer to **string** | | [optional] +**Volumes** | Pointer to [**[]Href**](Href.md) | | [optional] +**Sos** | Pointer to **string** | Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. | [optional] + +## Methods + +### NewDevice + +`func NewDevice() *Device` + +NewDevice instantiates a new Device object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceWithDefaults + +`func NewDeviceWithDefaults() *Device` + +NewDeviceWithDefaults instantiates a new Device object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlwaysPxe + +`func (o *Device) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *Device) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *Device) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *Device) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *Device) GetBillingCycle() string` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *Device) GetBillingCycleOk() (*string, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *Device) SetBillingCycle(v string)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *Device) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetBondingMode + +`func (o *Device) GetBondingMode() int32` + +GetBondingMode returns the BondingMode field if non-nil, zero value otherwise. + +### GetBondingModeOk + +`func (o *Device) GetBondingModeOk() (*int32, bool)` + +GetBondingModeOk returns a tuple with the BondingMode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBondingMode + +`func (o *Device) SetBondingMode(v int32)` + +SetBondingMode sets BondingMode field to given value. + +### HasBondingMode + +`func (o *Device) HasBondingMode() bool` + +HasBondingMode returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Device) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Device) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Device) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Device) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *Device) GetCreatedBy() DeviceCreatedBy` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *Device) GetCreatedByOk() (*DeviceCreatedBy, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *Device) SetCreatedBy(v DeviceCreatedBy)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *Device) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *Device) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *Device) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *Device) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *Device) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *Device) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Device) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Device) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Device) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFacility + +`func (o *Device) GetFacility() Facility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *Device) GetFacilityOk() (*Facility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *Device) SetFacility(v Facility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *Device) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetFirmwareSetId + +`func (o *Device) GetFirmwareSetId() string` + +GetFirmwareSetId returns the FirmwareSetId field if non-nil, zero value otherwise. + +### GetFirmwareSetIdOk + +`func (o *Device) GetFirmwareSetIdOk() (*string, bool)` + +GetFirmwareSetIdOk returns a tuple with the FirmwareSetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirmwareSetId + +`func (o *Device) SetFirmwareSetId(v string)` + +SetFirmwareSetId sets FirmwareSetId field to given value. + +### HasFirmwareSetId + +`func (o *Device) HasFirmwareSetId() bool` + +HasFirmwareSetId returns a boolean if a field has been set. + +### GetHardwareReservation + +`func (o *Device) GetHardwareReservation() HardwareReservation` + +GetHardwareReservation returns the HardwareReservation field if non-nil, zero value otherwise. + +### GetHardwareReservationOk + +`func (o *Device) GetHardwareReservationOk() (*HardwareReservation, bool)` + +GetHardwareReservationOk returns a tuple with the HardwareReservation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservation + +`func (o *Device) SetHardwareReservation(v HardwareReservation)` + +SetHardwareReservation sets HardwareReservation field to given value. + +### HasHardwareReservation + +`func (o *Device) HasHardwareReservation() bool` + +HasHardwareReservation returns a boolean if a field has been set. + +### GetHostname + +`func (o *Device) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *Device) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *Device) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *Device) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetHref + +`func (o *Device) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Device) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Device) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Device) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Device) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Device) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Device) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Device) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetImageUrl + +`func (o *Device) GetImageUrl() string` + +GetImageUrl returns the ImageUrl field if non-nil, zero value otherwise. + +### GetImageUrlOk + +`func (o *Device) GetImageUrlOk() (*string, bool)` + +GetImageUrlOk returns a tuple with the ImageUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetImageUrl + +`func (o *Device) SetImageUrl(v string)` + +SetImageUrl sets ImageUrl field to given value. + +### HasImageUrl + +`func (o *Device) HasImageUrl() bool` + +HasImageUrl returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *Device) GetIpAddresses() []IPAssignment` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *Device) GetIpAddressesOk() (*[]IPAssignment, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *Device) SetIpAddresses(v []IPAssignment)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *Device) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *Device) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *Device) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *Device) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *Device) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetIqn + +`func (o *Device) GetIqn() string` + +GetIqn returns the Iqn field if non-nil, zero value otherwise. + +### GetIqnOk + +`func (o *Device) GetIqnOk() (*string, bool)` + +GetIqnOk returns a tuple with the Iqn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIqn + +`func (o *Device) SetIqn(v string)` + +SetIqn sets Iqn field to given value. + +### HasIqn + +`func (o *Device) HasIqn() bool` + +HasIqn returns a boolean if a field has been set. + +### GetLocked + +`func (o *Device) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *Device) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *Device) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *Device) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetMetro + +`func (o *Device) GetMetro() DeviceMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *Device) GetMetroOk() (*DeviceMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *Device) SetMetro(v DeviceMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *Device) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *Device) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *Device) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *Device) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *Device) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNetworkPorts + +`func (o *Device) GetNetworkPorts() []Port` + +GetNetworkPorts returns the NetworkPorts field if non-nil, zero value otherwise. + +### GetNetworkPortsOk + +`func (o *Device) GetNetworkPortsOk() (*[]Port, bool)` + +GetNetworkPortsOk returns a tuple with the NetworkPorts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkPorts + +`func (o *Device) SetNetworkPorts(v []Port)` + +SetNetworkPorts sets NetworkPorts field to given value. + +### HasNetworkPorts + +`func (o *Device) HasNetworkPorts() bool` + +HasNetworkPorts returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *Device) GetOperatingSystem() OperatingSystem` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *Device) GetOperatingSystemOk() (*OperatingSystem, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *Device) SetOperatingSystem(v OperatingSystem)` + +SetOperatingSystem sets OperatingSystem field to given value. + +### HasOperatingSystem + +`func (o *Device) HasOperatingSystem() bool` + +HasOperatingSystem returns a boolean if a field has been set. + +### GetActions + +`func (o *Device) GetActions() []DeviceActionsInner` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *Device) GetActionsOk() (*[]DeviceActionsInner, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *Device) SetActions(v []DeviceActionsInner)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *Device) HasActions() bool` + +HasActions returns a boolean if a field has been set. + +### GetPlan + +`func (o *Device) GetPlan() Plan` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *Device) GetPlanOk() (*Plan, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *Device) SetPlan(v Plan)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *Device) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetProject + +`func (o *Device) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *Device) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *Device) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *Device) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *Device) GetProjectLite() DeviceProjectLite` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *Device) GetProjectLiteOk() (*DeviceProjectLite, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *Device) SetProjectLite(v DeviceProjectLite)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *Device) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetProvisioningEvents + +`func (o *Device) GetProvisioningEvents() []Event` + +GetProvisioningEvents returns the ProvisioningEvents field if non-nil, zero value otherwise. + +### GetProvisioningEventsOk + +`func (o *Device) GetProvisioningEventsOk() (*[]Event, bool)` + +GetProvisioningEventsOk returns a tuple with the ProvisioningEvents field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvisioningEvents + +`func (o *Device) SetProvisioningEvents(v []Event)` + +SetProvisioningEvents sets ProvisioningEvents field to given value. + +### HasProvisioningEvents + +`func (o *Device) HasProvisioningEvents() bool` + +HasProvisioningEvents returns a boolean if a field has been set. + +### GetProvisioningPercentage + +`func (o *Device) GetProvisioningPercentage() float32` + +GetProvisioningPercentage returns the ProvisioningPercentage field if non-nil, zero value otherwise. + +### GetProvisioningPercentageOk + +`func (o *Device) GetProvisioningPercentageOk() (*float32, bool)` + +GetProvisioningPercentageOk returns a tuple with the ProvisioningPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvisioningPercentage + +`func (o *Device) SetProvisioningPercentage(v float32)` + +SetProvisioningPercentage sets ProvisioningPercentage field to given value. + +### HasProvisioningPercentage + +`func (o *Device) HasProvisioningPercentage() bool` + +HasProvisioningPercentage returns a boolean if a field has been set. + +### GetRootPassword + +`func (o *Device) GetRootPassword() string` + +GetRootPassword returns the RootPassword field if non-nil, zero value otherwise. + +### GetRootPasswordOk + +`func (o *Device) GetRootPasswordOk() (*string, bool)` + +GetRootPasswordOk returns a tuple with the RootPassword field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRootPassword + +`func (o *Device) SetRootPassword(v string)` + +SetRootPassword sets RootPassword field to given value. + +### HasRootPassword + +`func (o *Device) HasRootPassword() bool` + +HasRootPassword returns a boolean if a field has been set. + +### GetShortId + +`func (o *Device) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *Device) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *Device) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + +### HasShortId + +`func (o *Device) HasShortId() bool` + +HasShortId returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *Device) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *Device) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *Device) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *Device) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *Device) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *Device) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *Device) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *Device) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *Device) GetSshKeys() []Href` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *Device) GetSshKeysOk() (*[]Href, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *Device) SetSshKeys(v []Href)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *Device) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetState + +`func (o *Device) GetState() DeviceState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Device) GetStateOk() (*DeviceState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Device) SetState(v DeviceState)` + +SetState sets State field to given value. + +### HasState + +`func (o *Device) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetStorage + +`func (o *Device) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *Device) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *Device) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *Device) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetSwitchUuid + +`func (o *Device) GetSwitchUuid() string` + +GetSwitchUuid returns the SwitchUuid field if non-nil, zero value otherwise. + +### GetSwitchUuidOk + +`func (o *Device) GetSwitchUuidOk() (*string, bool)` + +GetSwitchUuidOk returns a tuple with the SwitchUuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSwitchUuid + +`func (o *Device) SetSwitchUuid(v string)` + +SetSwitchUuid sets SwitchUuid field to given value. + +### HasSwitchUuid + +`func (o *Device) HasSwitchUuid() bool` + +HasSwitchUuid returns a boolean if a field has been set. + +### GetTags + +`func (o *Device) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Device) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Device) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Device) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *Device) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *Device) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *Device) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *Device) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Device) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Device) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Device) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Device) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetUser + +`func (o *Device) GetUser() string` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *Device) GetUserOk() (*string, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *Device) SetUser(v string)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *Device) HasUser() bool` + +HasUser returns a boolean if a field has been set. + +### GetUserdata + +`func (o *Device) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *Device) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *Device) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *Device) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + +### GetVolumes + +`func (o *Device) GetVolumes() []Href` + +GetVolumes returns the Volumes field if non-nil, zero value otherwise. + +### GetVolumesOk + +`func (o *Device) GetVolumesOk() (*[]Href, bool)` + +GetVolumesOk returns a tuple with the Volumes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumes + +`func (o *Device) SetVolumes(v []Href)` + +SetVolumes sets Volumes field to given value. + +### HasVolumes + +`func (o *Device) HasVolumes() bool` + +HasVolumes returns a boolean if a field has been set. + +### GetSos + +`func (o *Device) GetSos() string` + +GetSos returns the Sos field if non-nil, zero value otherwise. + +### GetSosOk + +`func (o *Device) GetSosOk() (*string, bool)` + +GetSosOk returns a tuple with the Sos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSos + +`func (o *Device) SetSos(v string)` + +SetSos sets Sos field to given value. + +### HasSos + +`func (o *Device) HasSos() bool` + +HasSos returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceActionInput.md b/services/metalv1/docs/DeviceActionInput.md new file mode 100644 index 00000000..649ea961 --- /dev/null +++ b/services/metalv1/docs/DeviceActionInput.md @@ -0,0 +1,181 @@ +# DeviceActionInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | [**DeviceActionInputType**](DeviceActionInputType.md) | | +**ForceDelete** | Pointer to **bool** | May be required to perform actions under certain conditions | [optional] +**DeprovisionFast** | Pointer to **bool** | When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. | [optional] +**PreserveData** | Pointer to **bool** | When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. | [optional] +**OperatingSystem** | Pointer to **string** | When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) | [optional] +**IpxeScriptUrl** | Pointer to **string** | When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) | [optional] + +## Methods + +### NewDeviceActionInput + +`func NewDeviceActionInput(type_ DeviceActionInputType, ) *DeviceActionInput` + +NewDeviceActionInput instantiates a new DeviceActionInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceActionInputWithDefaults + +`func NewDeviceActionInputWithDefaults() *DeviceActionInput` + +NewDeviceActionInputWithDefaults instantiates a new DeviceActionInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *DeviceActionInput) GetType() DeviceActionInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DeviceActionInput) GetTypeOk() (*DeviceActionInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DeviceActionInput) SetType(v DeviceActionInputType)` + +SetType sets Type field to given value. + + +### GetForceDelete + +`func (o *DeviceActionInput) GetForceDelete() bool` + +GetForceDelete returns the ForceDelete field if non-nil, zero value otherwise. + +### GetForceDeleteOk + +`func (o *DeviceActionInput) GetForceDeleteOk() (*bool, bool)` + +GetForceDeleteOk returns a tuple with the ForceDelete field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForceDelete + +`func (o *DeviceActionInput) SetForceDelete(v bool)` + +SetForceDelete sets ForceDelete field to given value. + +### HasForceDelete + +`func (o *DeviceActionInput) HasForceDelete() bool` + +HasForceDelete returns a boolean if a field has been set. + +### GetDeprovisionFast + +`func (o *DeviceActionInput) GetDeprovisionFast() bool` + +GetDeprovisionFast returns the DeprovisionFast field if non-nil, zero value otherwise. + +### GetDeprovisionFastOk + +`func (o *DeviceActionInput) GetDeprovisionFastOk() (*bool, bool)` + +GetDeprovisionFastOk returns a tuple with the DeprovisionFast field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeprovisionFast + +`func (o *DeviceActionInput) SetDeprovisionFast(v bool)` + +SetDeprovisionFast sets DeprovisionFast field to given value. + +### HasDeprovisionFast + +`func (o *DeviceActionInput) HasDeprovisionFast() bool` + +HasDeprovisionFast returns a boolean if a field has been set. + +### GetPreserveData + +`func (o *DeviceActionInput) GetPreserveData() bool` + +GetPreserveData returns the PreserveData field if non-nil, zero value otherwise. + +### GetPreserveDataOk + +`func (o *DeviceActionInput) GetPreserveDataOk() (*bool, bool)` + +GetPreserveDataOk returns a tuple with the PreserveData field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreserveData + +`func (o *DeviceActionInput) SetPreserveData(v bool)` + +SetPreserveData sets PreserveData field to given value. + +### HasPreserveData + +`func (o *DeviceActionInput) HasPreserveData() bool` + +HasPreserveData returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *DeviceActionInput) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *DeviceActionInput) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *DeviceActionInput) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + +### HasOperatingSystem + +`func (o *DeviceActionInput) HasOperatingSystem() bool` + +HasOperatingSystem returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *DeviceActionInput) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *DeviceActionInput) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *DeviceActionInput) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *DeviceActionInput) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceActionInputType.md b/services/metalv1/docs/DeviceActionInputType.md new file mode 100644 index 00000000..dbdf0b9f --- /dev/null +++ b/services/metalv1/docs/DeviceActionInputType.md @@ -0,0 +1,19 @@ +# DeviceActionInputType + +## Enum + + +* `POWER_ON` (value: `"power_on"`) + +* `POWER_OFF` (value: `"power_off"`) + +* `REBOOT` (value: `"reboot"`) + +* `RESCUE` (value: `"rescue"`) + +* `REINSTALL` (value: `"reinstall"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceActionsInner.md b/services/metalv1/docs/DeviceActionsInner.md new file mode 100644 index 00000000..94dc4e70 --- /dev/null +++ b/services/metalv1/docs/DeviceActionsInner.md @@ -0,0 +1,82 @@ +# DeviceActionsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewDeviceActionsInner + +`func NewDeviceActionsInner() *DeviceActionsInner` + +NewDeviceActionsInner instantiates a new DeviceActionsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceActionsInnerWithDefaults + +`func NewDeviceActionsInnerWithDefaults() *DeviceActionsInner` + +NewDeviceActionsInnerWithDefaults instantiates a new DeviceActionsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *DeviceActionsInner) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *DeviceActionsInner) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *DeviceActionsInner) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *DeviceActionsInner) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetName + +`func (o *DeviceActionsInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DeviceActionsInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DeviceActionsInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *DeviceActionsInner) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceCreateInFacilityInput.md b/services/metalv1/docs/DeviceCreateInFacilityInput.md new file mode 100644 index 00000000..e1bfe924 --- /dev/null +++ b/services/metalv1/docs/DeviceCreateInFacilityInput.md @@ -0,0 +1,691 @@ +# DeviceCreateInFacilityInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Facility** | **[]string** | The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. | +**AlwaysPxe** | Pointer to **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] [default to false] +**BillingCycle** | Pointer to [**DeviceCreateInputBillingCycle**](DeviceCreateInputBillingCycle.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] [default to {}] +**Description** | Pointer to **string** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**Features** | Pointer to **[]string** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] +**HardwareReservationId** | Pointer to **string** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. | [optional] [default to ""] +**Hostname** | Pointer to **string** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] +**IpAddresses** | Pointer to [**[]IPAddress**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**IpxeScriptUrl** | Pointer to **string** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to false] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**NoSshKeys** | Pointer to **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to false] +**OperatingSystem** | **string** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**Plan** | **string** | The slug of the device plan to provision. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] [default to 28] +**ProjectSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] [default to 31] +**SpotInstance** | Pointer to **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum amount to bid for a spot instance. | [optional] +**SshKeys** | Pointer to [**[]SSHKeyInput**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UserSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**Userdata** | Pointer to **string** | The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. | [optional] + +## Methods + +### NewDeviceCreateInFacilityInput + +`func NewDeviceCreateInFacilityInput(facility []string, operatingSystem string, plan string, ) *DeviceCreateInFacilityInput` + +NewDeviceCreateInFacilityInput instantiates a new DeviceCreateInFacilityInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceCreateInFacilityInputWithDefaults + +`func NewDeviceCreateInFacilityInputWithDefaults() *DeviceCreateInFacilityInput` + +NewDeviceCreateInFacilityInputWithDefaults instantiates a new DeviceCreateInFacilityInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFacility + +`func (o *DeviceCreateInFacilityInput) GetFacility() []string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *DeviceCreateInFacilityInput) GetFacilityOk() (*[]string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *DeviceCreateInFacilityInput) SetFacility(v []string)` + +SetFacility sets Facility field to given value. + + +### GetAlwaysPxe + +`func (o *DeviceCreateInFacilityInput) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *DeviceCreateInFacilityInput) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *DeviceCreateInFacilityInput) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *DeviceCreateInFacilityInput) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *DeviceCreateInFacilityInput) GetBillingCycle() DeviceCreateInputBillingCycle` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *DeviceCreateInFacilityInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *DeviceCreateInFacilityInput) SetBillingCycle(v DeviceCreateInputBillingCycle)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *DeviceCreateInFacilityInput) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *DeviceCreateInFacilityInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *DeviceCreateInFacilityInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *DeviceCreateInFacilityInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *DeviceCreateInFacilityInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *DeviceCreateInFacilityInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *DeviceCreateInFacilityInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *DeviceCreateInFacilityInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *DeviceCreateInFacilityInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *DeviceCreateInFacilityInput) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *DeviceCreateInFacilityInput) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *DeviceCreateInFacilityInput) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *DeviceCreateInFacilityInput) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHardwareReservationId + +`func (o *DeviceCreateInFacilityInput) GetHardwareReservationId() string` + +GetHardwareReservationId returns the HardwareReservationId field if non-nil, zero value otherwise. + +### GetHardwareReservationIdOk + +`func (o *DeviceCreateInFacilityInput) GetHardwareReservationIdOk() (*string, bool)` + +GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservationId + +`func (o *DeviceCreateInFacilityInput) SetHardwareReservationId(v string)` + +SetHardwareReservationId sets HardwareReservationId field to given value. + +### HasHardwareReservationId + +`func (o *DeviceCreateInFacilityInput) HasHardwareReservationId() bool` + +HasHardwareReservationId returns a boolean if a field has been set. + +### GetHostname + +`func (o *DeviceCreateInFacilityInput) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *DeviceCreateInFacilityInput) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *DeviceCreateInFacilityInput) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *DeviceCreateInFacilityInput) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *DeviceCreateInFacilityInput) GetIpAddresses() []IPAddress` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *DeviceCreateInFacilityInput) GetIpAddressesOk() (*[]IPAddress, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *DeviceCreateInFacilityInput) SetIpAddresses(v []IPAddress)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *DeviceCreateInFacilityInput) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *DeviceCreateInFacilityInput) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *DeviceCreateInFacilityInput) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *DeviceCreateInFacilityInput) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *DeviceCreateInFacilityInput) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *DeviceCreateInFacilityInput) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *DeviceCreateInFacilityInput) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *DeviceCreateInFacilityInput) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *DeviceCreateInFacilityInput) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *DeviceCreateInFacilityInput) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *DeviceCreateInFacilityInput) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *DeviceCreateInFacilityInput) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *DeviceCreateInFacilityInput) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *DeviceCreateInFacilityInput) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *DeviceCreateInFacilityInput) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *DeviceCreateInFacilityInput) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *DeviceCreateInFacilityInput) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *DeviceCreateInFacilityInput) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *DeviceCreateInFacilityInput) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *DeviceCreateInFacilityInput) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + + +### GetPlan + +`func (o *DeviceCreateInFacilityInput) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *DeviceCreateInFacilityInput) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *DeviceCreateInFacilityInput) SetPlan(v string)` + +SetPlan sets Plan field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *DeviceCreateInFacilityInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *DeviceCreateInFacilityInput) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *DeviceCreateInFacilityInput) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *DeviceCreateInFacilityInput) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *DeviceCreateInFacilityInput) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *DeviceCreateInFacilityInput) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *DeviceCreateInFacilityInput) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *DeviceCreateInFacilityInput) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *DeviceCreateInFacilityInput) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *DeviceCreateInFacilityInput) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *DeviceCreateInFacilityInput) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *DeviceCreateInFacilityInput) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *DeviceCreateInFacilityInput) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *DeviceCreateInFacilityInput) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *DeviceCreateInFacilityInput) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *DeviceCreateInFacilityInput) GetSshKeys() []SSHKeyInput` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *DeviceCreateInFacilityInput) GetSshKeysOk() (*[]SSHKeyInput, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *DeviceCreateInFacilityInput) SetSshKeys(v []SSHKeyInput)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *DeviceCreateInFacilityInput) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetStorage + +`func (o *DeviceCreateInFacilityInput) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *DeviceCreateInFacilityInput) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *DeviceCreateInFacilityInput) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *DeviceCreateInFacilityInput) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetTags + +`func (o *DeviceCreateInFacilityInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *DeviceCreateInFacilityInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *DeviceCreateInFacilityInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *DeviceCreateInFacilityInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *DeviceCreateInFacilityInput) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *DeviceCreateInFacilityInput) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *DeviceCreateInFacilityInput) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *DeviceCreateInFacilityInput) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *DeviceCreateInFacilityInput) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *DeviceCreateInFacilityInput) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *DeviceCreateInFacilityInput) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *DeviceCreateInFacilityInput) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *DeviceCreateInFacilityInput) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *DeviceCreateInFacilityInput) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *DeviceCreateInFacilityInput) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *DeviceCreateInFacilityInput) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceCreateInMetroInput.md b/services/metalv1/docs/DeviceCreateInMetroInput.md new file mode 100644 index 00000000..b47a3fcd --- /dev/null +++ b/services/metalv1/docs/DeviceCreateInMetroInput.md @@ -0,0 +1,691 @@ +# DeviceCreateInMetroInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metro** | **string** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**AlwaysPxe** | Pointer to **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] [default to false] +**BillingCycle** | Pointer to [**DeviceCreateInputBillingCycle**](DeviceCreateInputBillingCycle.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] [default to {}] +**Description** | Pointer to **string** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**Features** | Pointer to **[]string** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] +**HardwareReservationId** | Pointer to **string** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. | [optional] [default to ""] +**Hostname** | Pointer to **string** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] +**IpAddresses** | Pointer to [**[]IPAddress**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**IpxeScriptUrl** | Pointer to **string** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to false] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**NoSshKeys** | Pointer to **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to false] +**OperatingSystem** | **string** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**Plan** | **string** | The slug of the device plan to provision. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] [default to 28] +**ProjectSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] [default to 31] +**SpotInstance** | Pointer to **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum amount to bid for a spot instance. | [optional] +**SshKeys** | Pointer to [**[]SSHKeyInput**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UserSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**Userdata** | Pointer to **string** | The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. | [optional] + +## Methods + +### NewDeviceCreateInMetroInput + +`func NewDeviceCreateInMetroInput(metro string, operatingSystem string, plan string, ) *DeviceCreateInMetroInput` + +NewDeviceCreateInMetroInput instantiates a new DeviceCreateInMetroInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceCreateInMetroInputWithDefaults + +`func NewDeviceCreateInMetroInputWithDefaults() *DeviceCreateInMetroInput` + +NewDeviceCreateInMetroInputWithDefaults instantiates a new DeviceCreateInMetroInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMetro + +`func (o *DeviceCreateInMetroInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *DeviceCreateInMetroInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *DeviceCreateInMetroInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetAlwaysPxe + +`func (o *DeviceCreateInMetroInput) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *DeviceCreateInMetroInput) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *DeviceCreateInMetroInput) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *DeviceCreateInMetroInput) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *DeviceCreateInMetroInput) GetBillingCycle() DeviceCreateInputBillingCycle` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *DeviceCreateInMetroInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *DeviceCreateInMetroInput) SetBillingCycle(v DeviceCreateInputBillingCycle)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *DeviceCreateInMetroInput) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *DeviceCreateInMetroInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *DeviceCreateInMetroInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *DeviceCreateInMetroInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *DeviceCreateInMetroInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *DeviceCreateInMetroInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *DeviceCreateInMetroInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *DeviceCreateInMetroInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *DeviceCreateInMetroInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *DeviceCreateInMetroInput) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *DeviceCreateInMetroInput) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *DeviceCreateInMetroInput) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *DeviceCreateInMetroInput) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHardwareReservationId + +`func (o *DeviceCreateInMetroInput) GetHardwareReservationId() string` + +GetHardwareReservationId returns the HardwareReservationId field if non-nil, zero value otherwise. + +### GetHardwareReservationIdOk + +`func (o *DeviceCreateInMetroInput) GetHardwareReservationIdOk() (*string, bool)` + +GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservationId + +`func (o *DeviceCreateInMetroInput) SetHardwareReservationId(v string)` + +SetHardwareReservationId sets HardwareReservationId field to given value. + +### HasHardwareReservationId + +`func (o *DeviceCreateInMetroInput) HasHardwareReservationId() bool` + +HasHardwareReservationId returns a boolean if a field has been set. + +### GetHostname + +`func (o *DeviceCreateInMetroInput) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *DeviceCreateInMetroInput) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *DeviceCreateInMetroInput) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *DeviceCreateInMetroInput) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *DeviceCreateInMetroInput) GetIpAddresses() []IPAddress` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *DeviceCreateInMetroInput) GetIpAddressesOk() (*[]IPAddress, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *DeviceCreateInMetroInput) SetIpAddresses(v []IPAddress)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *DeviceCreateInMetroInput) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *DeviceCreateInMetroInput) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *DeviceCreateInMetroInput) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *DeviceCreateInMetroInput) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *DeviceCreateInMetroInput) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *DeviceCreateInMetroInput) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *DeviceCreateInMetroInput) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *DeviceCreateInMetroInput) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *DeviceCreateInMetroInput) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *DeviceCreateInMetroInput) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *DeviceCreateInMetroInput) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *DeviceCreateInMetroInput) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *DeviceCreateInMetroInput) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *DeviceCreateInMetroInput) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *DeviceCreateInMetroInput) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *DeviceCreateInMetroInput) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *DeviceCreateInMetroInput) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *DeviceCreateInMetroInput) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *DeviceCreateInMetroInput) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *DeviceCreateInMetroInput) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + + +### GetPlan + +`func (o *DeviceCreateInMetroInput) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *DeviceCreateInMetroInput) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *DeviceCreateInMetroInput) SetPlan(v string)` + +SetPlan sets Plan field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *DeviceCreateInMetroInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *DeviceCreateInMetroInput) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *DeviceCreateInMetroInput) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *DeviceCreateInMetroInput) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *DeviceCreateInMetroInput) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *DeviceCreateInMetroInput) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *DeviceCreateInMetroInput) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *DeviceCreateInMetroInput) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *DeviceCreateInMetroInput) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *DeviceCreateInMetroInput) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *DeviceCreateInMetroInput) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *DeviceCreateInMetroInput) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *DeviceCreateInMetroInput) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *DeviceCreateInMetroInput) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *DeviceCreateInMetroInput) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *DeviceCreateInMetroInput) GetSshKeys() []SSHKeyInput` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *DeviceCreateInMetroInput) GetSshKeysOk() (*[]SSHKeyInput, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *DeviceCreateInMetroInput) SetSshKeys(v []SSHKeyInput)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *DeviceCreateInMetroInput) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetStorage + +`func (o *DeviceCreateInMetroInput) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *DeviceCreateInMetroInput) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *DeviceCreateInMetroInput) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *DeviceCreateInMetroInput) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetTags + +`func (o *DeviceCreateInMetroInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *DeviceCreateInMetroInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *DeviceCreateInMetroInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *DeviceCreateInMetroInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *DeviceCreateInMetroInput) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *DeviceCreateInMetroInput) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *DeviceCreateInMetroInput) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *DeviceCreateInMetroInput) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *DeviceCreateInMetroInput) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *DeviceCreateInMetroInput) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *DeviceCreateInMetroInput) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *DeviceCreateInMetroInput) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *DeviceCreateInMetroInput) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *DeviceCreateInMetroInput) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *DeviceCreateInMetroInput) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *DeviceCreateInMetroInput) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceCreateInput.md b/services/metalv1/docs/DeviceCreateInput.md new file mode 100644 index 00000000..8bb8e827 --- /dev/null +++ b/services/metalv1/docs/DeviceCreateInput.md @@ -0,0 +1,670 @@ +# DeviceCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AlwaysPxe** | Pointer to **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] [default to false] +**BillingCycle** | Pointer to [**DeviceCreateInputBillingCycle**](DeviceCreateInputBillingCycle.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] [default to {}] +**Description** | Pointer to **string** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**Features** | Pointer to **[]string** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] +**HardwareReservationId** | Pointer to **string** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. | [optional] [default to ""] +**Hostname** | Pointer to **string** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] +**IpAddresses** | Pointer to [**[]IPAddress**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**IpxeScriptUrl** | Pointer to **string** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to false] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**NoSshKeys** | Pointer to **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to false] +**OperatingSystem** | **string** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**Plan** | **string** | The slug of the device plan to provision. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] [default to 28] +**ProjectSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] [default to 31] +**SpotInstance** | Pointer to **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum amount to bid for a spot instance. | [optional] +**SshKeys** | Pointer to [**[]SSHKeyInput**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UserSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**Userdata** | Pointer to **string** | The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. | [optional] + +## Methods + +### NewDeviceCreateInput + +`func NewDeviceCreateInput(operatingSystem string, plan string, ) *DeviceCreateInput` + +NewDeviceCreateInput instantiates a new DeviceCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceCreateInputWithDefaults + +`func NewDeviceCreateInputWithDefaults() *DeviceCreateInput` + +NewDeviceCreateInputWithDefaults instantiates a new DeviceCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlwaysPxe + +`func (o *DeviceCreateInput) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *DeviceCreateInput) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *DeviceCreateInput) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *DeviceCreateInput) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *DeviceCreateInput) GetBillingCycle() DeviceCreateInputBillingCycle` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *DeviceCreateInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *DeviceCreateInput) SetBillingCycle(v DeviceCreateInputBillingCycle)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *DeviceCreateInput) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *DeviceCreateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *DeviceCreateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *DeviceCreateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *DeviceCreateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *DeviceCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *DeviceCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *DeviceCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *DeviceCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *DeviceCreateInput) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *DeviceCreateInput) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *DeviceCreateInput) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *DeviceCreateInput) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHardwareReservationId + +`func (o *DeviceCreateInput) GetHardwareReservationId() string` + +GetHardwareReservationId returns the HardwareReservationId field if non-nil, zero value otherwise. + +### GetHardwareReservationIdOk + +`func (o *DeviceCreateInput) GetHardwareReservationIdOk() (*string, bool)` + +GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservationId + +`func (o *DeviceCreateInput) SetHardwareReservationId(v string)` + +SetHardwareReservationId sets HardwareReservationId field to given value. + +### HasHardwareReservationId + +`func (o *DeviceCreateInput) HasHardwareReservationId() bool` + +HasHardwareReservationId returns a boolean if a field has been set. + +### GetHostname + +`func (o *DeviceCreateInput) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *DeviceCreateInput) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *DeviceCreateInput) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *DeviceCreateInput) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *DeviceCreateInput) GetIpAddresses() []IPAddress` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *DeviceCreateInput) GetIpAddressesOk() (*[]IPAddress, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *DeviceCreateInput) SetIpAddresses(v []IPAddress)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *DeviceCreateInput) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *DeviceCreateInput) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *DeviceCreateInput) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *DeviceCreateInput) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *DeviceCreateInput) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *DeviceCreateInput) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *DeviceCreateInput) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *DeviceCreateInput) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *DeviceCreateInput) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *DeviceCreateInput) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *DeviceCreateInput) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *DeviceCreateInput) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *DeviceCreateInput) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *DeviceCreateInput) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *DeviceCreateInput) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *DeviceCreateInput) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *DeviceCreateInput) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *DeviceCreateInput) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *DeviceCreateInput) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *DeviceCreateInput) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + + +### GetPlan + +`func (o *DeviceCreateInput) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *DeviceCreateInput) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *DeviceCreateInput) SetPlan(v string)` + +SetPlan sets Plan field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInput) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *DeviceCreateInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *DeviceCreateInput) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *DeviceCreateInput) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *DeviceCreateInput) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *DeviceCreateInput) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *DeviceCreateInput) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *DeviceCreateInput) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *DeviceCreateInput) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *DeviceCreateInput) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *DeviceCreateInput) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *DeviceCreateInput) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *DeviceCreateInput) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *DeviceCreateInput) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *DeviceCreateInput) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *DeviceCreateInput) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *DeviceCreateInput) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *DeviceCreateInput) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *DeviceCreateInput) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *DeviceCreateInput) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *DeviceCreateInput) GetSshKeys() []SSHKeyInput` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *DeviceCreateInput) GetSshKeysOk() (*[]SSHKeyInput, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *DeviceCreateInput) SetSshKeys(v []SSHKeyInput)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *DeviceCreateInput) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetStorage + +`func (o *DeviceCreateInput) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *DeviceCreateInput) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *DeviceCreateInput) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *DeviceCreateInput) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetTags + +`func (o *DeviceCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *DeviceCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *DeviceCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *DeviceCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *DeviceCreateInput) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *DeviceCreateInput) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *DeviceCreateInput) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *DeviceCreateInput) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *DeviceCreateInput) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *DeviceCreateInput) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *DeviceCreateInput) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *DeviceCreateInput) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *DeviceCreateInput) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *DeviceCreateInput) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *DeviceCreateInput) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *DeviceCreateInput) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceCreateInputBillingCycle.md b/services/metalv1/docs/DeviceCreateInputBillingCycle.md new file mode 100644 index 00000000..068878e6 --- /dev/null +++ b/services/metalv1/docs/DeviceCreateInputBillingCycle.md @@ -0,0 +1,17 @@ +# DeviceCreateInputBillingCycle + +## Enum + + +* `HOURLY` (value: `"hourly"`) + +* `DAILY` (value: `"daily"`) + +* `MONTHLY` (value: `"monthly"`) + +* `YEARLY` (value: `"yearly"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceCreatedBy.md b/services/metalv1/docs/DeviceCreatedBy.md new file mode 100644 index 00000000..b98e4a41 --- /dev/null +++ b/services/metalv1/docs/DeviceCreatedBy.md @@ -0,0 +1,280 @@ +# DeviceCreatedBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvatarThumbUrl** | Pointer to **string** | Avatar thumbnail URL of the User | [optional] +**CreatedAt** | Pointer to **time.Time** | When the user was created | [optional] +**Email** | Pointer to **string** | Primary email address of the User | [optional] +**FirstName** | Pointer to **string** | First name of the User | [optional] +**FullName** | Pointer to **string** | Full name of the User | [optional] +**Href** | Pointer to **string** | API URL uniquely representing the User | [optional] +**Id** | **string** | ID of the User | +**LastName** | Pointer to **string** | Last name of the User | [optional] +**ShortId** | **string** | Short ID of the User | +**UpdatedAt** | Pointer to **time.Time** | When the user details were last updated | [optional] + +## Methods + +### NewDeviceCreatedBy + +`func NewDeviceCreatedBy(id string, shortId string, ) *DeviceCreatedBy` + +NewDeviceCreatedBy instantiates a new DeviceCreatedBy object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceCreatedByWithDefaults + +`func NewDeviceCreatedByWithDefaults() *DeviceCreatedBy` + +NewDeviceCreatedByWithDefaults instantiates a new DeviceCreatedBy object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatarThumbUrl + +`func (o *DeviceCreatedBy) GetAvatarThumbUrl() string` + +GetAvatarThumbUrl returns the AvatarThumbUrl field if non-nil, zero value otherwise. + +### GetAvatarThumbUrlOk + +`func (o *DeviceCreatedBy) GetAvatarThumbUrlOk() (*string, bool)` + +GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarThumbUrl + +`func (o *DeviceCreatedBy) SetAvatarThumbUrl(v string)` + +SetAvatarThumbUrl sets AvatarThumbUrl field to given value. + +### HasAvatarThumbUrl + +`func (o *DeviceCreatedBy) HasAvatarThumbUrl() bool` + +HasAvatarThumbUrl returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *DeviceCreatedBy) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *DeviceCreatedBy) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *DeviceCreatedBy) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *DeviceCreatedBy) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetEmail + +`func (o *DeviceCreatedBy) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *DeviceCreatedBy) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *DeviceCreatedBy) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *DeviceCreatedBy) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetFirstName + +`func (o *DeviceCreatedBy) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *DeviceCreatedBy) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *DeviceCreatedBy) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *DeviceCreatedBy) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetFullName + +`func (o *DeviceCreatedBy) GetFullName() string` + +GetFullName returns the FullName field if non-nil, zero value otherwise. + +### GetFullNameOk + +`func (o *DeviceCreatedBy) GetFullNameOk() (*string, bool)` + +GetFullNameOk returns a tuple with the FullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFullName + +`func (o *DeviceCreatedBy) SetFullName(v string)` + +SetFullName sets FullName field to given value. + +### HasFullName + +`func (o *DeviceCreatedBy) HasFullName() bool` + +HasFullName returns a boolean if a field has been set. + +### GetHref + +`func (o *DeviceCreatedBy) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *DeviceCreatedBy) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *DeviceCreatedBy) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *DeviceCreatedBy) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *DeviceCreatedBy) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DeviceCreatedBy) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DeviceCreatedBy) SetId(v string)` + +SetId sets Id field to given value. + + +### GetLastName + +`func (o *DeviceCreatedBy) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *DeviceCreatedBy) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *DeviceCreatedBy) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *DeviceCreatedBy) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetShortId + +`func (o *DeviceCreatedBy) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *DeviceCreatedBy) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *DeviceCreatedBy) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + + +### GetUpdatedAt + +`func (o *DeviceCreatedBy) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *DeviceCreatedBy) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *DeviceCreatedBy) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *DeviceCreatedBy) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceHealthRollup.md b/services/metalv1/docs/DeviceHealthRollup.md new file mode 100644 index 00000000..e0bd3f6b --- /dev/null +++ b/services/metalv1/docs/DeviceHealthRollup.md @@ -0,0 +1,82 @@ +# DeviceHealthRollup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HealthRollup** | Pointer to [**DeviceHealthRollupHealthRollup**](DeviceHealthRollupHealthRollup.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | Last update of health status. | [optional] [readonly] + +## Methods + +### NewDeviceHealthRollup + +`func NewDeviceHealthRollup() *DeviceHealthRollup` + +NewDeviceHealthRollup instantiates a new DeviceHealthRollup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceHealthRollupWithDefaults + +`func NewDeviceHealthRollupWithDefaults() *DeviceHealthRollup` + +NewDeviceHealthRollupWithDefaults instantiates a new DeviceHealthRollup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHealthRollup + +`func (o *DeviceHealthRollup) GetHealthRollup() DeviceHealthRollupHealthRollup` + +GetHealthRollup returns the HealthRollup field if non-nil, zero value otherwise. + +### GetHealthRollupOk + +`func (o *DeviceHealthRollup) GetHealthRollupOk() (*DeviceHealthRollupHealthRollup, bool)` + +GetHealthRollupOk returns a tuple with the HealthRollup field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHealthRollup + +`func (o *DeviceHealthRollup) SetHealthRollup(v DeviceHealthRollupHealthRollup)` + +SetHealthRollup sets HealthRollup field to given value. + +### HasHealthRollup + +`func (o *DeviceHealthRollup) HasHealthRollup() bool` + +HasHealthRollup returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *DeviceHealthRollup) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *DeviceHealthRollup) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *DeviceHealthRollup) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *DeviceHealthRollup) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceHealthRollupHealthRollup.md b/services/metalv1/docs/DeviceHealthRollupHealthRollup.md new file mode 100644 index 00000000..b0558014 --- /dev/null +++ b/services/metalv1/docs/DeviceHealthRollupHealthRollup.md @@ -0,0 +1,15 @@ +# DeviceHealthRollupHealthRollup + +## Enum + + +* `OK` (value: `"ok"`) + +* `WARNING` (value: `"warning"`) + +* `CRITICAL` (value: `"critical"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceList.md b/services/metalv1/docs/DeviceList.md new file mode 100644 index 00000000..dc380b7a --- /dev/null +++ b/services/metalv1/docs/DeviceList.md @@ -0,0 +1,82 @@ +# DeviceList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Devices** | Pointer to [**[]Device**](Device.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewDeviceList + +`func NewDeviceList() *DeviceList` + +NewDeviceList instantiates a new DeviceList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceListWithDefaults + +`func NewDeviceListWithDefaults() *DeviceList` + +NewDeviceListWithDefaults instantiates a new DeviceList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDevices + +`func (o *DeviceList) GetDevices() []Device` + +GetDevices returns the Devices field if non-nil, zero value otherwise. + +### GetDevicesOk + +`func (o *DeviceList) GetDevicesOk() (*[]Device, bool)` + +GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevices + +`func (o *DeviceList) SetDevices(v []Device)` + +SetDevices sets Devices field to given value. + +### HasDevices + +`func (o *DeviceList) HasDevices() bool` + +HasDevices returns a boolean if a field has been set. + +### GetMeta + +`func (o *DeviceList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *DeviceList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *DeviceList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *DeviceList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceMetro.md b/services/metalv1/docs/DeviceMetro.md new file mode 100644 index 00000000..71158065 --- /dev/null +++ b/services/metalv1/docs/DeviceMetro.md @@ -0,0 +1,134 @@ +# DeviceMetro + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewDeviceMetro + +`func NewDeviceMetro() *DeviceMetro` + +NewDeviceMetro instantiates a new DeviceMetro object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceMetroWithDefaults + +`func NewDeviceMetroWithDefaults() *DeviceMetro` + +NewDeviceMetroWithDefaults instantiates a new DeviceMetro object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *DeviceMetro) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *DeviceMetro) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *DeviceMetro) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *DeviceMetro) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *DeviceMetro) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *DeviceMetro) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *DeviceMetro) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *DeviceMetro) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetId + +`func (o *DeviceMetro) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DeviceMetro) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DeviceMetro) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *DeviceMetro) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *DeviceMetro) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DeviceMetro) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DeviceMetro) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *DeviceMetro) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceProjectLite.md b/services/metalv1/docs/DeviceProjectLite.md new file mode 100644 index 00000000..389055be --- /dev/null +++ b/services/metalv1/docs/DeviceProjectLite.md @@ -0,0 +1,51 @@ +# DeviceProjectLite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | | + +## Methods + +### NewDeviceProjectLite + +`func NewDeviceProjectLite(href string, ) *DeviceProjectLite` + +NewDeviceProjectLite instantiates a new DeviceProjectLite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceProjectLiteWithDefaults + +`func NewDeviceProjectLiteWithDefaults() *DeviceProjectLite` + +NewDeviceProjectLiteWithDefaults instantiates a new DeviceProjectLite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *DeviceProjectLite) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *DeviceProjectLite) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *DeviceProjectLite) SetHref(v string)` + +SetHref sets Href field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceState.md b/services/metalv1/docs/DeviceState.md new file mode 100644 index 00000000..d0b9fd21 --- /dev/null +++ b/services/metalv1/docs/DeviceState.md @@ -0,0 +1,29 @@ +# DeviceState + +## Enum + + +* `QUEUED` (value: `"queued"`) + +* `PROVISIONING` (value: `"provisioning"`) + +* `DEPROVISIONING` (value: `"deprovisioning"`) + +* `REINSTALLING` (value: `"reinstalling"`) + +* `ACTIVE` (value: `"active"`) + +* `INACTIVE` (value: `"inactive"`) + +* `FAILED` (value: `"failed"`) + +* `POWERING_ON` (value: `"powering_on"`) + +* `POWERING_OFF` (value: `"powering_off"`) + +* `DELETED` (value: `"deleted"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceUpdateInput.md b/services/metalv1/docs/DeviceUpdateInput.md new file mode 100644 index 00000000..da6f2cad --- /dev/null +++ b/services/metalv1/docs/DeviceUpdateInput.md @@ -0,0 +1,342 @@ +# DeviceUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AlwaysPxe** | Pointer to **bool** | | [optional] +**BillingCycle** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] [default to {}] +**Description** | Pointer to **string** | | [optional] +**Hostname** | Pointer to **string** | | [optional] +**FirmwareSetId** | Pointer to **string** | | [optional] +**IpxeScriptUrl** | Pointer to **string** | | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**SpotInstance** | Pointer to **bool** | Can be set to false to convert a spot-market instance to on-demand. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Userdata** | Pointer to **string** | | [optional] + +## Methods + +### NewDeviceUpdateInput + +`func NewDeviceUpdateInput() *DeviceUpdateInput` + +NewDeviceUpdateInput instantiates a new DeviceUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceUpdateInputWithDefaults + +`func NewDeviceUpdateInputWithDefaults() *DeviceUpdateInput` + +NewDeviceUpdateInputWithDefaults instantiates a new DeviceUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlwaysPxe + +`func (o *DeviceUpdateInput) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *DeviceUpdateInput) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *DeviceUpdateInput) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *DeviceUpdateInput) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *DeviceUpdateInput) GetBillingCycle() string` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *DeviceUpdateInput) GetBillingCycleOk() (*string, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *DeviceUpdateInput) SetBillingCycle(v string)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *DeviceUpdateInput) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *DeviceUpdateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *DeviceUpdateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *DeviceUpdateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *DeviceUpdateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *DeviceUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *DeviceUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *DeviceUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *DeviceUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetHostname + +`func (o *DeviceUpdateInput) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *DeviceUpdateInput) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *DeviceUpdateInput) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *DeviceUpdateInput) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetFirmwareSetId + +`func (o *DeviceUpdateInput) GetFirmwareSetId() string` + +GetFirmwareSetId returns the FirmwareSetId field if non-nil, zero value otherwise. + +### GetFirmwareSetIdOk + +`func (o *DeviceUpdateInput) GetFirmwareSetIdOk() (*string, bool)` + +GetFirmwareSetIdOk returns a tuple with the FirmwareSetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirmwareSetId + +`func (o *DeviceUpdateInput) SetFirmwareSetId(v string)` + +SetFirmwareSetId sets FirmwareSetId field to given value. + +### HasFirmwareSetId + +`func (o *DeviceUpdateInput) HasFirmwareSetId() bool` + +HasFirmwareSetId returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *DeviceUpdateInput) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *DeviceUpdateInput) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *DeviceUpdateInput) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *DeviceUpdateInput) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *DeviceUpdateInput) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *DeviceUpdateInput) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *DeviceUpdateInput) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *DeviceUpdateInput) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *DeviceUpdateInput) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *DeviceUpdateInput) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *DeviceUpdateInput) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *DeviceUpdateInput) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *DeviceUpdateInput) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *DeviceUpdateInput) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *DeviceUpdateInput) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *DeviceUpdateInput) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetTags + +`func (o *DeviceUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *DeviceUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *DeviceUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *DeviceUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetUserdata + +`func (o *DeviceUpdateInput) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *DeviceUpdateInput) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *DeviceUpdateInput) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *DeviceUpdateInput) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceUsage.md b/services/metalv1/docs/DeviceUsage.md new file mode 100644 index 00000000..d2cc539c --- /dev/null +++ b/services/metalv1/docs/DeviceUsage.md @@ -0,0 +1,108 @@ +# DeviceUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Quantity** | Pointer to **string** | | [optional] +**Total** | Pointer to **string** | | [optional] +**Unit** | Pointer to **string** | | [optional] + +## Methods + +### NewDeviceUsage + +`func NewDeviceUsage() *DeviceUsage` + +NewDeviceUsage instantiates a new DeviceUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceUsageWithDefaults + +`func NewDeviceUsageWithDefaults() *DeviceUsage` + +NewDeviceUsageWithDefaults instantiates a new DeviceUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetQuantity + +`func (o *DeviceUsage) GetQuantity() string` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *DeviceUsage) GetQuantityOk() (*string, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *DeviceUsage) SetQuantity(v string)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *DeviceUsage) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetTotal + +`func (o *DeviceUsage) GetTotal() string` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *DeviceUsage) GetTotalOk() (*string, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *DeviceUsage) SetTotal(v string)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *DeviceUsage) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetUnit + +`func (o *DeviceUsage) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *DeviceUsage) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *DeviceUsage) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *DeviceUsage) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DeviceUsageList.md b/services/metalv1/docs/DeviceUsageList.md new file mode 100644 index 00000000..200b9443 --- /dev/null +++ b/services/metalv1/docs/DeviceUsageList.md @@ -0,0 +1,56 @@ +# DeviceUsageList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Usages** | Pointer to [**[]DeviceUsage**](DeviceUsage.md) | | [optional] + +## Methods + +### NewDeviceUsageList + +`func NewDeviceUsageList() *DeviceUsageList` + +NewDeviceUsageList instantiates a new DeviceUsageList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDeviceUsageListWithDefaults + +`func NewDeviceUsageListWithDefaults() *DeviceUsageList` + +NewDeviceUsageListWithDefaults instantiates a new DeviceUsageList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsages + +`func (o *DeviceUsageList) GetUsages() []DeviceUsage` + +GetUsages returns the Usages field if non-nil, zero value otherwise. + +### GetUsagesOk + +`func (o *DeviceUsageList) GetUsagesOk() (*[]DeviceUsage, bool)` + +GetUsagesOk returns a tuple with the Usages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsages + +`func (o *DeviceUsageList) SetUsages(v []DeviceUsage)` + +SetUsages sets Usages field to given value. + +### HasUsages + +`func (o *DeviceUsageList) HasUsages() bool` + +HasUsages returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/DevicesApi.md b/services/metalv1/docs/DevicesApi.md new file mode 100644 index 00000000..88746c2e --- /dev/null +++ b/services/metalv1/docs/DevicesApi.md @@ -0,0 +1,1522 @@ +# \DevicesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateBgpSession**](DevicesApi.md#CreateBgpSession) | **Post** /devices/{id}/bgp/sessions | Create a BGP session +[**CreateDevice**](DevicesApi.md#CreateDevice) | **Post** /projects/{id}/devices | Create a device +[**CreateIPAssignment**](DevicesApi.md#CreateIPAssignment) | **Post** /devices/{id}/ips | Create an ip assignment +[**DeleteDevice**](DevicesApi.md#DeleteDevice) | **Delete** /devices/{id} | Delete the device +[**FindBgpSessions**](DevicesApi.md#FindBgpSessions) | **Get** /devices/{id}/bgp/sessions | Retrieve all BGP sessions +[**FindDeviceById**](DevicesApi.md#FindDeviceById) | **Get** /devices/{id} | Retrieve a device +[**FindDeviceCustomdata**](DevicesApi.md#FindDeviceCustomdata) | **Get** /devices/{id}/customdata | Retrieve the custom metadata of an instance +[**FindDeviceMetadataByID**](DevicesApi.md#FindDeviceMetadataByID) | **Get** /devices/{id}/metadata | Retrieve metadata +[**FindDeviceUserdataByID**](DevicesApi.md#FindDeviceUserdataByID) | **Get** /devices/{id}/userdata | Retrieve userdata +[**FindIPAssignmentCustomdata**](DevicesApi.md#FindIPAssignmentCustomdata) | **Get** /devices/{instance_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Assignment +[**FindIPAssignments**](DevicesApi.md#FindIPAssignments) | **Get** /devices/{id}/ips | Retrieve all ip assignments +[**FindInstanceBandwidth**](DevicesApi.md#FindInstanceBandwidth) | **Get** /devices/{id}/bandwidth | Retrieve an instance bandwidth +[**FindOrganizationDevices**](DevicesApi.md#FindOrganizationDevices) | **Get** /organizations/{id}/devices | Retrieve all devices of an organization +[**FindProjectDevices**](DevicesApi.md#FindProjectDevices) | **Get** /projects/{id}/devices | Retrieve all devices of a project +[**FindTraffic**](DevicesApi.md#FindTraffic) | **Get** /devices/{id}/traffic | Retrieve device traffic +[**GetBgpNeighborData**](DevicesApi.md#GetBgpNeighborData) | **Get** /devices/{id}/bgp/neighbors | Retrieve BGP neighbor data for this device +[**GetDeviceFirmwareSets**](DevicesApi.md#GetDeviceFirmwareSets) | **Get** /devices/{id}/firmware-sets | Get Device's associated Firmware Set +[**GetDeviceHealthRollup**](DevicesApi.md#GetDeviceHealthRollup) | **Get** /devices/{id}/diagnostics/health/rollup | Get Device's Health Status +[**PerformAction**](DevicesApi.md#PerformAction) | **Post** /devices/{id}/actions | Perform an action +[**UpdateDevice**](DevicesApi.md#UpdateDevice) | **Put** /devices/{id} | Update the device + + + +## CreateBgpSession + +> BgpSession CreateBgpSession(ctx, id).BGPSessionInput(bGPSessionInput).Include(include).Execute() + +Create a BGP session + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + bGPSessionInput := *openapiclient.NewBGPSessionInput() // BGPSessionInput | BGP session to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.CreateBgpSession(context.Background(), id).BGPSessionInput(bGPSessionInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateBgpSession``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateBgpSession`: BgpSession + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateBgpSession`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateBgpSessionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **bGPSessionInput** | [**BGPSessionInput**](BGPSessionInput.md) | BGP session to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BgpSession**](BgpSession.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateDevice + +> Device CreateDevice(ctx, id).CreateDeviceRequest(createDeviceRequest).Include(include).Exclude(exclude).Execute() + +Create a device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + createDeviceRequest := openapiclient.createDevice_request{DeviceCreateInFacilityInput: openapiclient.NewDeviceCreateInFacilityInput([]string{"Facility_example"}, "OperatingSystem_example", "c3.large.x86")} // CreateDeviceRequest | Device to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.CreateDevice(context.Background(), id).CreateDeviceRequest(createDeviceRequest).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateDevice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateDevice`: Device + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateDevice`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateDeviceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createDeviceRequest** | [**CreateDeviceRequest**](CreateDeviceRequest.md) | Device to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateIPAssignment + +> IPAssignment CreateIPAssignment(ctx, id).IPAssignmentInput(iPAssignmentInput).Include(include).Exclude(exclude).Execute() + +Create an ip assignment + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + iPAssignmentInput := *openapiclient.NewIPAssignmentInput("Address_example") // IPAssignmentInput | IPAssignment to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.CreateIPAssignment(context.Background(), id).IPAssignmentInput(iPAssignmentInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.CreateIPAssignment``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateIPAssignment`: IPAssignment + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.CreateIPAssignment`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateIPAssignmentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **iPAssignmentInput** | [**IPAssignmentInput**](IPAssignmentInput.md) | IPAssignment to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**IPAssignment**](IPAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteDevice + +> DeleteDevice(ctx, id).ForceDelete(forceDelete).Execute() + +Delete the device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + forceDelete := true // bool | Force the deletion of the device, by detaching any storage volume still active. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.DeleteDevice(context.Background(), id).ForceDelete(forceDelete).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.DeleteDevice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **forceDelete** | **bool** | Force the deletion of the device, by detaching any storage volume still active. | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindBgpSessions + +> BgpSessionList FindBgpSessions(ctx, id).Include(include).Execute() + +Retrieve all BGP sessions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindBgpSessions(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindBgpSessions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindBgpSessions`: BgpSessionList + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindBgpSessions`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindBgpSessionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BgpSessionList**](BgpSessionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindDeviceById + +> Device FindDeviceById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindDeviceById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceById`: Device + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindDeviceCustomdata + +> FindDeviceCustomdata(ctx, id).Execute() + +Retrieve the custom metadata of an instance + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Instance UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.FindDeviceCustomdata(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Instance UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindDeviceMetadataByID + +> Metadata FindDeviceMetadataByID(ctx, id).Execute() + +Retrieve metadata + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindDeviceMetadataByID(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceMetadataByID``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceMetadataByID`: Metadata + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceMetadataByID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceMetadataByIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Metadata**](Metadata.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindDeviceUserdataByID + +> Userdata FindDeviceUserdataByID(ctx, id).Execute() + +Retrieve userdata + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindDeviceUserdataByID(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindDeviceUserdataByID``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceUserdataByID`: Userdata + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindDeviceUserdataByID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceUserdataByIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Userdata**](Userdata.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPAssignmentCustomdata + +> FindIPAssignmentCustomdata(ctx, instanceId, id).Execute() + +Retrieve the custom metadata of an IP Assignment + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + instanceId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Instance UUID + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Ip Assignment UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.FindIPAssignmentCustomdata(context.Background(), instanceId, id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindIPAssignmentCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**instanceId** | **string** | Instance UUID | +**id** | **string** | Ip Assignment UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPAssignmentCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPAssignments + +> IPAssignmentList FindIPAssignments(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all ip assignments + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindIPAssignments(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindIPAssignments``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindIPAssignments`: IPAssignmentList + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindIPAssignments`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPAssignmentsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**IPAssignmentList**](IPAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindInstanceBandwidth + +> FindInstanceBandwidth(ctx, id).From(from).Until(until).Execute() + +Retrieve an instance bandwidth + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + from := "from_example" // string | Timestamp from range + until := "until_example" // string | Timestamp to range + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.FindInstanceBandwidth(context.Background(), id).From(from).Until(until).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindInstanceBandwidth``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindInstanceBandwidthRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **from** | **string** | Timestamp from range | + **until** | **string** | Timestamp to range | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationDevices + +> DeviceList FindOrganizationDevices(ctx, id).Search(search).Categories(categories).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all devices of an organization + + +FindOrganizationDevices is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + search := "search_example" // string | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. (optional) + categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter by plan category (optional) + facility := "facility_example" // string | Filter by device facility (optional) + hostname := "hostname_example" // string | Filter by partial hostname (optional) + reserved := true // bool | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. (optional) + tag := "tag_example" // string | Filter by device tag (optional) + type_ := "type__example" // string | Filter by instance type (ondemand,spot,reserved) (optional) + hasTerminationTime := true // bool | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindOrganizationDevices(context.Background(), id).Search(search).Categories(categories).Facility(facility).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindOrganizationDevices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationDevices`: DeviceList + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindOrganizationDevices`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationDevicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **search** | **string** | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. | + **categories** | [**[]FindOrganizationDevicesCategoriesParameterInner**](FindOrganizationDevicesCategoriesParameterInner.md) | Filter by plan category | + **facility** | **string** | Filter by device facility | + **hostname** | **string** | Filter by partial hostname | + **reserved** | **bool** | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. | + **tag** | **string** | Filter by device tag | + **type_** | **string** | Filter by instance type (ondemand,spot,reserved) | + **hasTerminationTime** | **bool** | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**DeviceList**](DeviceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectDevices + +> DeviceList FindProjectDevices(ctx, id).Search(search).Categories(categories).Facility(facility).Metro(metro).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all devices of a project + + +FindProjectDevices is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + search := "search_example" // string | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. (optional) + categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter by plan category (optional) + facility := "facility_example" // string | Filter by device facility (optional) + metro := "metro_example" // string | Filter by device metro (optional) + hostname := "hostname_example" // string | Filter by partial hostname (optional) + reserved := true // bool | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. (optional) + tag := "tag_example" // string | Filter by device tag (optional) + type_ := "type__example" // string | Filter by instance type (ondemand,spot,reserved) (optional) + hasTerminationTime := true // bool | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.FindProjectDevices(context.Background(), id).Search(search).Categories(categories).Facility(facility).Metro(metro).Hostname(hostname).Reserved(reserved).Tag(tag).Type_(type_).HasTerminationTime(hasTerminationTime).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindProjectDevices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectDevices`: DeviceList + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.FindProjectDevices`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectDevicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **search** | **string** | Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. | + **categories** | [**[]FindOrganizationDevicesCategoriesParameterInner**](FindOrganizationDevicesCategoriesParameterInner.md) | Filter by plan category | + **facility** | **string** | Filter by device facility | + **metro** | **string** | Filter by device metro | + **hostname** | **string** | Filter by partial hostname | + **reserved** | **bool** | Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. | + **tag** | **string** | Filter by device tag | + **type_** | **string** | Filter by instance type (ondemand,spot,reserved) | + **hasTerminationTime** | **bool** | Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**DeviceList**](DeviceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindTraffic + +> FindTraffic(ctx, id).Direction(direction).Interval(interval).Bucket(bucket).Timeframe(timeframe).Execute() + +Retrieve device traffic + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + direction := openapiclient.findTraffic_direction_parameter("inbound") // FindTrafficDirectionParameter | Traffic direction + interval := openapiclient.findTraffic_interval_parameter("minute") // FindTrafficIntervalParameter | Traffic interval (optional) + bucket := openapiclient.findTraffic_bucket_parameter("internal") // FindTrafficBucketParameter | Traffic bucket (optional) + timeframe := *openapiclient.NewFindTrafficTimeframeParameter(time.Now(), time.Now()) // FindTrafficTimeframeParameter | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.FindTraffic(context.Background(), id).Direction(direction).Interval(interval).Bucket(bucket).Timeframe(timeframe).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.FindTraffic``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindTrafficRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **direction** | [**FindTrafficDirectionParameter**](FindTrafficDirectionParameter.md) | Traffic direction | + **interval** | [**FindTrafficIntervalParameter**](FindTrafficIntervalParameter.md) | Traffic interval | + **bucket** | [**FindTrafficBucketParameter**](FindTrafficBucketParameter.md) | Traffic bucket | + **timeframe** | [**FindTrafficTimeframeParameter**](FindTrafficTimeframeParameter.md) | | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetBgpNeighborData + +> BgpSessionNeighbors GetBgpNeighborData(ctx, id).Include(include).Execute() + +Retrieve BGP neighbor data for this device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.GetBgpNeighborData(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.GetBgpNeighborData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBgpNeighborData`: BgpSessionNeighbors + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.GetBgpNeighborData`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBgpNeighborDataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**BgpSessionNeighbors**](BgpSessionNeighbors.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDeviceFirmwareSets + +> FirmwareSetResponse GetDeviceFirmwareSets(ctx, id).Execute() + +Get Device's associated Firmware Set + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.GetDeviceFirmwareSets(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.GetDeviceFirmwareSets``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDeviceFirmwareSets`: FirmwareSetResponse + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.GetDeviceFirmwareSets`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDeviceFirmwareSetsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**FirmwareSetResponse**](FirmwareSetResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDeviceHealthRollup + +> DeviceHealthRollup GetDeviceHealthRollup(ctx, id).Execute() + +Get Device's Health Status + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.GetDeviceHealthRollup(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.GetDeviceHealthRollup``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDeviceHealthRollup`: DeviceHealthRollup + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.GetDeviceHealthRollup`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDeviceHealthRollupRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**DeviceHealthRollup**](DeviceHealthRollup.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PerformAction + +> PerformAction(ctx, id).DeviceActionInput(deviceActionInput).Execute() + +Perform an action + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + deviceActionInput := *openapiclient.NewDeviceActionInput(openapiclient.DeviceActionInput_type("power_on")) // DeviceActionInput | Action to perform + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DevicesApi.PerformAction(context.Background(), id).DeviceActionInput(deviceActionInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.PerformAction``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPerformActionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **deviceActionInput** | [**DeviceActionInput**](DeviceActionInput.md) | Action to perform | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateDevice + +> Device UpdateDevice(ctx, id).DeviceUpdateInput(deviceUpdateInput).Include(include).Exclude(exclude).Execute() + +Update the device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + deviceUpdateInput := *openapiclient.NewDeviceUpdateInput() // DeviceUpdateInput | Device to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DevicesApi.UpdateDevice(context.Background(), id).DeviceUpdateInput(deviceUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DevicesApi.UpdateDevice``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateDevice`: Device + fmt.Fprintf(os.Stdout, "Response from `DevicesApi.UpdateDevice`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateDeviceRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **deviceUpdateInput** | [**DeviceUpdateInput**](DeviceUpdateInput.md) | Device to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Device**](Device.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Disk.md b/services/metalv1/docs/Disk.md new file mode 100644 index 00000000..a463b027 --- /dev/null +++ b/services/metalv1/docs/Disk.md @@ -0,0 +1,108 @@ +# Disk + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Device** | Pointer to **string** | | [optional] +**WipeTable** | Pointer to **bool** | | [optional] +**Partitions** | Pointer to [**[]Partition**](Partition.md) | | [optional] + +## Methods + +### NewDisk + +`func NewDisk() *Disk` + +NewDisk instantiates a new Disk object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDiskWithDefaults + +`func NewDiskWithDefaults() *Disk` + +NewDiskWithDefaults instantiates a new Disk object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDevice + +`func (o *Disk) GetDevice() string` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *Disk) GetDeviceOk() (*string, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *Disk) SetDevice(v string)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *Disk) HasDevice() bool` + +HasDevice returns a boolean if a field has been set. + +### GetWipeTable + +`func (o *Disk) GetWipeTable() bool` + +GetWipeTable returns the WipeTable field if non-nil, zero value otherwise. + +### GetWipeTableOk + +`func (o *Disk) GetWipeTableOk() (*bool, bool)` + +GetWipeTableOk returns a tuple with the WipeTable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWipeTable + +`func (o *Disk) SetWipeTable(v bool)` + +SetWipeTable sets WipeTable field to given value. + +### HasWipeTable + +`func (o *Disk) HasWipeTable() bool` + +HasWipeTable returns a boolean if a field has been set. + +### GetPartitions + +`func (o *Disk) GetPartitions() []Partition` + +GetPartitions returns the Partitions field if non-nil, zero value otherwise. + +### GetPartitionsOk + +`func (o *Disk) GetPartitionsOk() (*[]Partition, bool)` + +GetPartitionsOk returns a tuple with the Partitions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartitions + +`func (o *Disk) SetPartitions(v []Partition)` + +SetPartitions sets Partitions field to given value. + +### HasPartitions + +`func (o *Disk) HasPartitions() bool` + +HasPartitions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Email.md b/services/metalv1/docs/Email.md new file mode 100644 index 00000000..4ef99afe --- /dev/null +++ b/services/metalv1/docs/Email.md @@ -0,0 +1,160 @@ +# Email + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to **string** | | [optional] +**Default** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Verified** | Pointer to **bool** | | [optional] + +## Methods + +### NewEmail + +`func NewEmail() *Email` + +NewEmail instantiates a new Email object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailWithDefaults + +`func NewEmailWithDefaults() *Email` + +NewEmailWithDefaults instantiates a new Email object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *Email) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Email) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Email) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *Email) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetDefault + +`func (o *Email) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *Email) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *Email) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *Email) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + +### GetHref + +`func (o *Email) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Email) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Email) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Email) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Email) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Email) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Email) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Email) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetVerified + +`func (o *Email) GetVerified() bool` + +GetVerified returns the Verified field if non-nil, zero value otherwise. + +### GetVerifiedOk + +`func (o *Email) GetVerifiedOk() (*bool, bool)` + +GetVerifiedOk returns a tuple with the Verified field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVerified + +`func (o *Email) SetVerified(v bool)` + +SetVerified sets Verified field to given value. + +### HasVerified + +`func (o *Email) HasVerified() bool` + +HasVerified returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/EmailInput.md b/services/metalv1/docs/EmailInput.md new file mode 100644 index 00000000..ba556e9e --- /dev/null +++ b/services/metalv1/docs/EmailInput.md @@ -0,0 +1,77 @@ +# EmailInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Default** | Pointer to **bool** | | [optional] + +## Methods + +### NewEmailInput + +`func NewEmailInput(address string, ) *EmailInput` + +NewEmailInput instantiates a new EmailInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEmailInputWithDefaults + +`func NewEmailInputWithDefaults() *EmailInput` + +NewEmailInputWithDefaults instantiates a new EmailInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *EmailInput) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *EmailInput) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *EmailInput) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetDefault + +`func (o *EmailInput) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *EmailInput) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *EmailInput) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *EmailInput) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/EmailsApi.md b/services/metalv1/docs/EmailsApi.md new file mode 100644 index 00000000..52f9db01 --- /dev/null +++ b/services/metalv1/docs/EmailsApi.md @@ -0,0 +1,288 @@ +# \EmailsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateEmail**](EmailsApi.md#CreateEmail) | **Post** /emails | Create an email +[**DeleteEmail**](EmailsApi.md#DeleteEmail) | **Delete** /emails/{id} | Delete the email +[**FindEmailById**](EmailsApi.md#FindEmailById) | **Get** /emails/{id} | Retrieve an email +[**UpdateEmail**](EmailsApi.md#UpdateEmail) | **Put** /emails/{id} | Update the email + + + +## CreateEmail + +> Email CreateEmail(ctx).CreateEmailInput(createEmailInput).Execute() + +Create an email + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + createEmailInput := *openapiclient.NewCreateEmailInput("Address_example") // CreateEmailInput | Email to create + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EmailsApi.CreateEmail(context.Background()).CreateEmailInput(createEmailInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EmailsApi.CreateEmail``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateEmail`: Email + fmt.Fprintf(os.Stdout, "Response from `EmailsApi.CreateEmail`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateEmailRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createEmailInput** | [**CreateEmailInput**](CreateEmailInput.md) | Email to create | + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteEmail + +> DeleteEmail(ctx, id).Execute() + +Delete the email + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Email UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.EmailsApi.DeleteEmail(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EmailsApi.DeleteEmail``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Email UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteEmailRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindEmailById + +> Email FindEmailById(ctx, id).Execute() + +Retrieve an email + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Email UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EmailsApi.FindEmailById(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EmailsApi.FindEmailById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindEmailById`: Email + fmt.Fprintf(os.Stdout, "Response from `EmailsApi.FindEmailById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Email UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindEmailByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateEmail + +> Email UpdateEmail(ctx, id).UpdateEmailInput(updateEmailInput).Execute() + +Update the email + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Email UUID + updateEmailInput := *openapiclient.NewUpdateEmailInput() // UpdateEmailInput | email to update + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EmailsApi.UpdateEmail(context.Background(), id).UpdateEmailInput(updateEmailInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EmailsApi.UpdateEmail``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateEmail`: Email + fmt.Fprintf(os.Stdout, "Response from `EmailsApi.UpdateEmail`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Email UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateEmailRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **updateEmailInput** | [**UpdateEmailInput**](UpdateEmailInput.md) | email to update | + +### Return type + +[**Email**](Email.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Entitlement.md b/services/metalv1/docs/Entitlement.md new file mode 100644 index 00000000..a40af05c --- /dev/null +++ b/services/metalv1/docs/Entitlement.md @@ -0,0 +1,327 @@ +# Entitlement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**FeatureAccess** | Pointer to **map[string]interface{}** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | **string** | | +**InstanceQuota** | Pointer to **map[string]interface{}** | | [optional] +**IpQuota** | Pointer to **map[string]interface{}** | | [optional] +**Name** | Pointer to **string** | | [optional] +**ProjectQuota** | Pointer to **int32** | | [optional] [default to 0] +**Slug** | **string** | | +**VolumeLimits** | Pointer to **map[string]interface{}** | | [optional] +**VolumeQuota** | Pointer to **map[string]interface{}** | | [optional] +**Weight** | **int32** | | + +## Methods + +### NewEntitlement + +`func NewEntitlement(id string, slug string, weight int32, ) *Entitlement` + +NewEntitlement instantiates a new Entitlement object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEntitlementWithDefaults + +`func NewEntitlementWithDefaults() *Entitlement` + +NewEntitlementWithDefaults instantiates a new Entitlement object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *Entitlement) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Entitlement) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Entitlement) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Entitlement) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatureAccess + +`func (o *Entitlement) GetFeatureAccess() map[string]interface{}` + +GetFeatureAccess returns the FeatureAccess field if non-nil, zero value otherwise. + +### GetFeatureAccessOk + +`func (o *Entitlement) GetFeatureAccessOk() (*map[string]interface{}, bool)` + +GetFeatureAccessOk returns a tuple with the FeatureAccess field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureAccess + +`func (o *Entitlement) SetFeatureAccess(v map[string]interface{})` + +SetFeatureAccess sets FeatureAccess field to given value. + +### HasFeatureAccess + +`func (o *Entitlement) HasFeatureAccess() bool` + +HasFeatureAccess returns a boolean if a field has been set. + +### GetHref + +`func (o *Entitlement) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Entitlement) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Entitlement) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Entitlement) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Entitlement) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Entitlement) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Entitlement) SetId(v string)` + +SetId sets Id field to given value. + + +### GetInstanceQuota + +`func (o *Entitlement) GetInstanceQuota() map[string]interface{}` + +GetInstanceQuota returns the InstanceQuota field if non-nil, zero value otherwise. + +### GetInstanceQuotaOk + +`func (o *Entitlement) GetInstanceQuotaOk() (*map[string]interface{}, bool)` + +GetInstanceQuotaOk returns a tuple with the InstanceQuota field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceQuota + +`func (o *Entitlement) SetInstanceQuota(v map[string]interface{})` + +SetInstanceQuota sets InstanceQuota field to given value. + +### HasInstanceQuota + +`func (o *Entitlement) HasInstanceQuota() bool` + +HasInstanceQuota returns a boolean if a field has been set. + +### GetIpQuota + +`func (o *Entitlement) GetIpQuota() map[string]interface{}` + +GetIpQuota returns the IpQuota field if non-nil, zero value otherwise. + +### GetIpQuotaOk + +`func (o *Entitlement) GetIpQuotaOk() (*map[string]interface{}, bool)` + +GetIpQuotaOk returns a tuple with the IpQuota field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpQuota + +`func (o *Entitlement) SetIpQuota(v map[string]interface{})` + +SetIpQuota sets IpQuota field to given value. + +### HasIpQuota + +`func (o *Entitlement) HasIpQuota() bool` + +HasIpQuota returns a boolean if a field has been set. + +### GetName + +`func (o *Entitlement) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Entitlement) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Entitlement) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Entitlement) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetProjectQuota + +`func (o *Entitlement) GetProjectQuota() int32` + +GetProjectQuota returns the ProjectQuota field if non-nil, zero value otherwise. + +### GetProjectQuotaOk + +`func (o *Entitlement) GetProjectQuotaOk() (*int32, bool)` + +GetProjectQuotaOk returns a tuple with the ProjectQuota field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectQuota + +`func (o *Entitlement) SetProjectQuota(v int32)` + +SetProjectQuota sets ProjectQuota field to given value. + +### HasProjectQuota + +`func (o *Entitlement) HasProjectQuota() bool` + +HasProjectQuota returns a boolean if a field has been set. + +### GetSlug + +`func (o *Entitlement) GetSlug() string` + +GetSlug returns the Slug field if non-nil, zero value otherwise. + +### GetSlugOk + +`func (o *Entitlement) GetSlugOk() (*string, bool)` + +GetSlugOk returns a tuple with the Slug field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSlug + +`func (o *Entitlement) SetSlug(v string)` + +SetSlug sets Slug field to given value. + + +### GetVolumeLimits + +`func (o *Entitlement) GetVolumeLimits() map[string]interface{}` + +GetVolumeLimits returns the VolumeLimits field if non-nil, zero value otherwise. + +### GetVolumeLimitsOk + +`func (o *Entitlement) GetVolumeLimitsOk() (*map[string]interface{}, bool)` + +GetVolumeLimitsOk returns a tuple with the VolumeLimits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumeLimits + +`func (o *Entitlement) SetVolumeLimits(v map[string]interface{})` + +SetVolumeLimits sets VolumeLimits field to given value. + +### HasVolumeLimits + +`func (o *Entitlement) HasVolumeLimits() bool` + +HasVolumeLimits returns a boolean if a field has been set. + +### GetVolumeQuota + +`func (o *Entitlement) GetVolumeQuota() map[string]interface{}` + +GetVolumeQuota returns the VolumeQuota field if non-nil, zero value otherwise. + +### GetVolumeQuotaOk + +`func (o *Entitlement) GetVolumeQuotaOk() (*map[string]interface{}, bool)` + +GetVolumeQuotaOk returns a tuple with the VolumeQuota field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumeQuota + +`func (o *Entitlement) SetVolumeQuota(v map[string]interface{})` + +SetVolumeQuota sets VolumeQuota field to given value. + +### HasVolumeQuota + +`func (o *Entitlement) HasVolumeQuota() bool` + +HasVolumeQuota returns a boolean if a field has been set. + +### GetWeight + +`func (o *Entitlement) GetWeight() int32` + +GetWeight returns the Weight field if non-nil, zero value otherwise. + +### GetWeightOk + +`func (o *Entitlement) GetWeightOk() (*int32, bool)` + +GetWeightOk returns a tuple with the Weight field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeight + +`func (o *Entitlement) SetWeight(v int32)` + +SetWeight sets Weight field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Error.md b/services/metalv1/docs/Error.md new file mode 100644 index 00000000..86a05a98 --- /dev/null +++ b/services/metalv1/docs/Error.md @@ -0,0 +1,82 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error** | Pointer to **string** | A description of the error that caused the request to fail. | [optional] +**Errors** | Pointer to **[]string** | A list of errors that contributed to the request failing. | [optional] + +## Methods + +### NewError + +`func NewError() *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetError + +`func (o *Error) GetError() string` + +GetError returns the Error field if non-nil, zero value otherwise. + +### GetErrorOk + +`func (o *Error) GetErrorOk() (*string, bool)` + +GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetError + +`func (o *Error) SetError(v string)` + +SetError sets Error field to given value. + +### HasError + +`func (o *Error) HasError() bool` + +HasError returns a boolean if a field has been set. + +### GetErrors + +`func (o *Error) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *Error) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *Error) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *Error) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Event.md b/services/metalv1/docs/Event.md new file mode 100644 index 00000000..d4820830 --- /dev/null +++ b/services/metalv1/docs/Event.md @@ -0,0 +1,290 @@ +# Event + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Body** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Interpolated** | Pointer to **string** | | [optional] +**Relationships** | Pointer to [**[]Href**](Href.md) | | [optional] +**State** | Pointer to **string** | | [optional] +**Type** | Pointer to **string** | | [optional] +**ModifiedBy** | Pointer to **map[string]interface{}** | | [optional] +**Ip** | Pointer to **string** | | [optional] + +## Methods + +### NewEvent + +`func NewEvent() *Event` + +NewEvent instantiates a new Event object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEventWithDefaults + +`func NewEventWithDefaults() *Event` + +NewEventWithDefaults instantiates a new Event object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBody + +`func (o *Event) GetBody() string` + +GetBody returns the Body field if non-nil, zero value otherwise. + +### GetBodyOk + +`func (o *Event) GetBodyOk() (*string, bool)` + +GetBodyOk returns a tuple with the Body field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBody + +`func (o *Event) SetBody(v string)` + +SetBody sets Body field to given value. + +### HasBody + +`func (o *Event) HasBody() bool` + +HasBody returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Event) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Event) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Event) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Event) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetHref + +`func (o *Event) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Event) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Event) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Event) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Event) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Event) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Event) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Event) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInterpolated + +`func (o *Event) GetInterpolated() string` + +GetInterpolated returns the Interpolated field if non-nil, zero value otherwise. + +### GetInterpolatedOk + +`func (o *Event) GetInterpolatedOk() (*string, bool)` + +GetInterpolatedOk returns a tuple with the Interpolated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInterpolated + +`func (o *Event) SetInterpolated(v string)` + +SetInterpolated sets Interpolated field to given value. + +### HasInterpolated + +`func (o *Event) HasInterpolated() bool` + +HasInterpolated returns a boolean if a field has been set. + +### GetRelationships + +`func (o *Event) GetRelationships() []Href` + +GetRelationships returns the Relationships field if non-nil, zero value otherwise. + +### GetRelationshipsOk + +`func (o *Event) GetRelationshipsOk() (*[]Href, bool)` + +GetRelationshipsOk returns a tuple with the Relationships field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelationships + +`func (o *Event) SetRelationships(v []Href)` + +SetRelationships sets Relationships field to given value. + +### HasRelationships + +`func (o *Event) HasRelationships() bool` + +HasRelationships returns a boolean if a field has been set. + +### GetState + +`func (o *Event) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Event) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Event) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *Event) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetType + +`func (o *Event) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Event) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Event) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Event) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetModifiedBy + +`func (o *Event) GetModifiedBy() map[string]interface{}` + +GetModifiedBy returns the ModifiedBy field if non-nil, zero value otherwise. + +### GetModifiedByOk + +`func (o *Event) GetModifiedByOk() (*map[string]interface{}, bool)` + +GetModifiedByOk returns a tuple with the ModifiedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedBy + +`func (o *Event) SetModifiedBy(v map[string]interface{})` + +SetModifiedBy sets ModifiedBy field to given value. + +### HasModifiedBy + +`func (o *Event) HasModifiedBy() bool` + +HasModifiedBy returns a boolean if a field has been set. + +### GetIp + +`func (o *Event) GetIp() string` + +GetIp returns the Ip field if non-nil, zero value otherwise. + +### GetIpOk + +`func (o *Event) GetIpOk() (*string, bool)` + +GetIpOk returns a tuple with the Ip field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIp + +`func (o *Event) SetIp(v string)` + +SetIp sets Ip field to given value. + +### HasIp + +`func (o *Event) HasIp() bool` + +HasIp returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/EventList.md b/services/metalv1/docs/EventList.md new file mode 100644 index 00000000..2a718546 --- /dev/null +++ b/services/metalv1/docs/EventList.md @@ -0,0 +1,82 @@ +# EventList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Events** | Pointer to [**[]Event**](Event.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewEventList + +`func NewEventList() *EventList` + +NewEventList instantiates a new EventList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEventListWithDefaults + +`func NewEventListWithDefaults() *EventList` + +NewEventListWithDefaults instantiates a new EventList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvents + +`func (o *EventList) GetEvents() []Event` + +GetEvents returns the Events field if non-nil, zero value otherwise. + +### GetEventsOk + +`func (o *EventList) GetEventsOk() (*[]Event, bool)` + +GetEventsOk returns a tuple with the Events field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvents + +`func (o *EventList) SetEvents(v []Event)` + +SetEvents sets Events field to given value. + +### HasEvents + +`func (o *EventList) HasEvents() bool` + +HasEvents returns a boolean if a field has been set. + +### GetMeta + +`func (o *EventList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *EventList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *EventList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *EventList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/EventsApi.md b/services/metalv1/docs/EventsApi.md new file mode 100644 index 00000000..f768036f --- /dev/null +++ b/services/metalv1/docs/EventsApi.md @@ -0,0 +1,717 @@ +# \EventsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindDeviceEvents**](EventsApi.md#FindDeviceEvents) | **Get** /devices/{id}/events | Retrieve device's events +[**FindEventById**](EventsApi.md#FindEventById) | **Get** /events/{id} | Retrieve an event +[**FindEvents**](EventsApi.md#FindEvents) | **Get** /events | Retrieve current user's events +[**FindInterconnectionEvents**](EventsApi.md#FindInterconnectionEvents) | **Get** /connections/{connection_id}/events | Retrieve interconnection events +[**FindInterconnectionPortEvents**](EventsApi.md#FindInterconnectionPortEvents) | **Get** /connections/{connection_id}/ports/{id}/events | Retrieve interconnection port events +[**FindOrganizationEvents**](EventsApi.md#FindOrganizationEvents) | **Get** /organizations/{id}/events | Retrieve organization's events +[**FindProjectEvents**](EventsApi.md#FindProjectEvents) | **Get** /projects/{id}/events | Retrieve project's events +[**FindVirtualCircuitEvents**](EventsApi.md#FindVirtualCircuitEvents) | **Get** /virtual-circuits/{id}/events | Retrieve virtual circuit events +[**FindVrfRouteEvents**](EventsApi.md#FindVrfRouteEvents) | **Get** /routes/{id}/events | Retrieve VRF route events + + + +## FindDeviceEvents + +> EventList FindDeviceEvents(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve device's events + + +FindDeviceEvents is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindDeviceEvents(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindDeviceEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceEvents`: EventList + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindDeviceEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindEventById + +> Event FindEventById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve an event + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Event UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindEventById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindEventById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindEventById`: Event + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindEventById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Event UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindEventByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindEvents + +> EventList FindEvents(ctx).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve current user's events + + +FindEvents is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindEvents(context.Background()).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindEvents`: EventList + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindEvents`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindInterconnectionEvents + +> EventList FindInterconnectionEvents(ctx, connectionId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve interconnection events + + +FindInterconnectionEvents is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindInterconnectionEvents(context.Background(), connectionId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindInterconnectionEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindInterconnectionEvents`: EventList + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindInterconnectionEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | Interconnection UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindInterconnectionEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindInterconnectionPortEvents + +> Event FindInterconnectionPortEvents(ctx, connectionId, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve interconnection port events + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection UUID + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindInterconnectionPortEvents(context.Background(), connectionId, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindInterconnectionPortEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindInterconnectionPortEvents`: Event + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindInterconnectionPortEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | Interconnection UUID | +**id** | **string** | Interconnection Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindInterconnectionPortEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationEvents + +> EventList FindOrganizationEvents(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve organization's events + + +FindOrganizationEvents is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindOrganizationEvents(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindOrganizationEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationEvents`: EventList + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindOrganizationEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectEvents + +> EventList FindProjectEvents(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve project's events + + +FindProjectEvents is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindProjectEvents(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindProjectEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectEvents`: EventList + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindProjectEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**EventList**](EventList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVirtualCircuitEvents + +> Event FindVirtualCircuitEvents(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve virtual circuit events + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Circuit UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindVirtualCircuitEvents(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindVirtualCircuitEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVirtualCircuitEvents`: Event + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindVirtualCircuitEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Circuit UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVirtualCircuitEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfRouteEvents + +> Event FindVrfRouteEvents(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve VRF route events + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF Route UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventsApi.FindVrfRouteEvents(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.FindVrfRouteEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfRouteEvents`: Event + fmt.Fprintf(os.Stdout, "Response from `EventsApi.FindVrfRouteEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF Route UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfRouteEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**Event**](Event.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/FabricServiceToken.md b/services/metalv1/docs/FabricServiceToken.md new file mode 100644 index 00000000..85d7a27e --- /dev/null +++ b/services/metalv1/docs/FabricServiceToken.md @@ -0,0 +1,186 @@ +# FabricServiceToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ExpiresAt** | Pointer to **time.Time** | The expiration date and time of the Fabric service token. Once a service token is expired, it is no longer redeemable. | [optional] +**Id** | Pointer to **string** | The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or Virtual Device to Equinix Metal. | [optional] +**MaxAllowedSpeed** | Pointer to **int32** | The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs (Fabric Billed), this will default to 10Gbps. | [optional] +**Role** | Pointer to [**FabricServiceTokenRole**](FabricServiceTokenRole.md) | | [optional] +**ServiceTokenType** | Pointer to [**FabricServiceTokenServiceTokenType**](FabricServiceTokenServiceTokenType.md) | | [optional] +**State** | Pointer to [**FabricServiceTokenState**](FabricServiceTokenState.md) | | [optional] + +## Methods + +### NewFabricServiceToken + +`func NewFabricServiceToken() *FabricServiceToken` + +NewFabricServiceToken instantiates a new FabricServiceToken object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFabricServiceTokenWithDefaults + +`func NewFabricServiceTokenWithDefaults() *FabricServiceToken` + +NewFabricServiceTokenWithDefaults instantiates a new FabricServiceToken object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetExpiresAt + +`func (o *FabricServiceToken) GetExpiresAt() time.Time` + +GetExpiresAt returns the ExpiresAt field if non-nil, zero value otherwise. + +### GetExpiresAtOk + +`func (o *FabricServiceToken) GetExpiresAtOk() (*time.Time, bool)` + +GetExpiresAtOk returns a tuple with the ExpiresAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresAt + +`func (o *FabricServiceToken) SetExpiresAt(v time.Time)` + +SetExpiresAt sets ExpiresAt field to given value. + +### HasExpiresAt + +`func (o *FabricServiceToken) HasExpiresAt() bool` + +HasExpiresAt returns a boolean if a field has been set. + +### GetId + +`func (o *FabricServiceToken) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *FabricServiceToken) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *FabricServiceToken) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *FabricServiceToken) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMaxAllowedSpeed + +`func (o *FabricServiceToken) GetMaxAllowedSpeed() int32` + +GetMaxAllowedSpeed returns the MaxAllowedSpeed field if non-nil, zero value otherwise. + +### GetMaxAllowedSpeedOk + +`func (o *FabricServiceToken) GetMaxAllowedSpeedOk() (*int32, bool)` + +GetMaxAllowedSpeedOk returns a tuple with the MaxAllowedSpeed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxAllowedSpeed + +`func (o *FabricServiceToken) SetMaxAllowedSpeed(v int32)` + +SetMaxAllowedSpeed sets MaxAllowedSpeed field to given value. + +### HasMaxAllowedSpeed + +`func (o *FabricServiceToken) HasMaxAllowedSpeed() bool` + +HasMaxAllowedSpeed returns a boolean if a field has been set. + +### GetRole + +`func (o *FabricServiceToken) GetRole() FabricServiceTokenRole` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *FabricServiceToken) GetRoleOk() (*FabricServiceTokenRole, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *FabricServiceToken) SetRole(v FabricServiceTokenRole)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *FabricServiceToken) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServiceTokenType + +`func (o *FabricServiceToken) GetServiceTokenType() FabricServiceTokenServiceTokenType` + +GetServiceTokenType returns the ServiceTokenType field if non-nil, zero value otherwise. + +### GetServiceTokenTypeOk + +`func (o *FabricServiceToken) GetServiceTokenTypeOk() (*FabricServiceTokenServiceTokenType, bool)` + +GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceTokenType + +`func (o *FabricServiceToken) SetServiceTokenType(v FabricServiceTokenServiceTokenType)` + +SetServiceTokenType sets ServiceTokenType field to given value. + +### HasServiceTokenType + +`func (o *FabricServiceToken) HasServiceTokenType() bool` + +HasServiceTokenType returns a boolean if a field has been set. + +### GetState + +`func (o *FabricServiceToken) GetState() FabricServiceTokenState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *FabricServiceToken) GetStateOk() (*FabricServiceTokenState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *FabricServiceToken) SetState(v FabricServiceTokenState)` + +SetState sets State field to given value. + +### HasState + +`func (o *FabricServiceToken) HasState() bool` + +HasState returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FabricServiceTokenRole.md b/services/metalv1/docs/FabricServiceTokenRole.md new file mode 100644 index 00000000..cbbc9df8 --- /dev/null +++ b/services/metalv1/docs/FabricServiceTokenRole.md @@ -0,0 +1,13 @@ +# FabricServiceTokenRole + +## Enum + + +* `PRIMARY` (value: `"primary"`) + +* `SECONDARY` (value: `"secondary"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FabricServiceTokenServiceTokenType.md b/services/metalv1/docs/FabricServiceTokenServiceTokenType.md new file mode 100644 index 00000000..71b5889a --- /dev/null +++ b/services/metalv1/docs/FabricServiceTokenServiceTokenType.md @@ -0,0 +1,13 @@ +# FabricServiceTokenServiceTokenType + +## Enum + + +* `A_SIDE` (value: `"a_side"`) + +* `Z_SIDE` (value: `"z_side"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FabricServiceTokenState.md b/services/metalv1/docs/FabricServiceTokenState.md new file mode 100644 index 00000000..b65e94d3 --- /dev/null +++ b/services/metalv1/docs/FabricServiceTokenState.md @@ -0,0 +1,15 @@ +# FabricServiceTokenState + +## Enum + + +* `INACTIVE` (value: `"inactive"`) + +* `ACTIVE` (value: `"active"`) + +* `EXPIRED` (value: `"expired"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FacilitiesApi.md b/services/metalv1/docs/FacilitiesApi.md new file mode 100644 index 00000000..81bc9909 --- /dev/null +++ b/services/metalv1/docs/FacilitiesApi.md @@ -0,0 +1,227 @@ +# \FacilitiesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindFacilities**](FacilitiesApi.md#FindFacilities) | **Get** /facilities | Retrieve all facilities +[**FindFacilitiesByOrganization**](FacilitiesApi.md#FindFacilitiesByOrganization) | **Get** /organizations/{id}/facilities | Retrieve all facilities visible by the organization +[**FindFacilitiesByProject**](FacilitiesApi.md#FindFacilitiesByProject) | **Get** /projects/{id}/facilities | Retrieve all facilities visible by the project + + + +## FindFacilities + +> FacilityList FindFacilities(ctx).Include(include).Exclude(exclude).Execute() + +Retrieve all facilities + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []openapiclient.FindFacilitiesIncludeParameterInner{openapiclient.findFacilities_include_parameter_inner("address")} // []FindFacilitiesIncludeParameterInner | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []openapiclient.FindFacilitiesIncludeParameterInner{openapiclient.findFacilities_include_parameter_inner("address")} // []FindFacilitiesIncludeParameterInner | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) (default to [address]) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FacilitiesApi.FindFacilities(context.Background()).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FacilitiesApi.FindFacilities``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindFacilities`: FacilityList + fmt.Fprintf(os.Stdout, "Response from `FacilitiesApi.FindFacilities`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindFacilitiesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | [**[]FindFacilitiesIncludeParameterInner**](FindFacilitiesIncludeParameterInner.md) | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | [**[]FindFacilitiesIncludeParameterInner**](FindFacilitiesIncludeParameterInner.md) | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | [default to [address]] + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindFacilitiesByOrganization + +> FacilityList FindFacilitiesByOrganization(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all facilities visible by the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FacilitiesApi.FindFacilitiesByOrganization(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FacilitiesApi.FindFacilitiesByOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindFacilitiesByOrganization`: FacilityList + fmt.Fprintf(os.Stdout, "Response from `FacilitiesApi.FindFacilitiesByOrganization`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindFacilitiesByOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindFacilitiesByProject + +> FacilityList FindFacilitiesByProject(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all facilities visible by the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FacilitiesApi.FindFacilitiesByProject(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FacilitiesApi.FindFacilitiesByProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindFacilitiesByProject`: FacilityList + fmt.Fprintf(os.Stdout, "Response from `FacilitiesApi.FindFacilitiesByProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindFacilitiesByProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**FacilityList**](FacilityList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Facility.md b/services/metalv1/docs/Facility.md new file mode 100644 index 00000000..492a8baf --- /dev/null +++ b/services/metalv1/docs/Facility.md @@ -0,0 +1,212 @@ +# Facility + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to [**Address**](Address.md) | | [optional] +**Code** | Pointer to **string** | | [optional] +**Features** | Pointer to [**[]FacilityFeaturesInner**](FacilityFeaturesInner.md) | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpRanges** | Pointer to **[]string** | IP ranges registered in facility. Can be used for GeoIP location | [optional] +**Metro** | Pointer to [**DeviceMetro**](DeviceMetro.md) | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewFacility + +`func NewFacility() *Facility` + +NewFacility instantiates a new Facility object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFacilityWithDefaults + +`func NewFacilityWithDefaults() *Facility` + +NewFacilityWithDefaults instantiates a new Facility object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *Facility) GetAddress() Address` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Facility) GetAddressOk() (*Address, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Facility) SetAddress(v Address)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *Facility) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetCode + +`func (o *Facility) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *Facility) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *Facility) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *Facility) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetFeatures + +`func (o *Facility) GetFeatures() []FacilityFeaturesInner` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *Facility) GetFeaturesOk() (*[]FacilityFeaturesInner, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *Facility) SetFeatures(v []FacilityFeaturesInner)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *Facility) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetId + +`func (o *Facility) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Facility) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Facility) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Facility) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpRanges + +`func (o *Facility) GetIpRanges() []string` + +GetIpRanges returns the IpRanges field if non-nil, zero value otherwise. + +### GetIpRangesOk + +`func (o *Facility) GetIpRangesOk() (*[]string, bool)` + +GetIpRangesOk returns a tuple with the IpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpRanges + +`func (o *Facility) SetIpRanges(v []string)` + +SetIpRanges sets IpRanges field to given value. + +### HasIpRanges + +`func (o *Facility) HasIpRanges() bool` + +HasIpRanges returns a boolean if a field has been set. + +### GetMetro + +`func (o *Facility) GetMetro() DeviceMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *Facility) GetMetroOk() (*DeviceMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *Facility) SetMetro(v DeviceMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *Facility) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetName + +`func (o *Facility) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Facility) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Facility) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Facility) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FacilityFeaturesInner.md b/services/metalv1/docs/FacilityFeaturesInner.md new file mode 100644 index 00000000..92c9f275 --- /dev/null +++ b/services/metalv1/docs/FacilityFeaturesInner.md @@ -0,0 +1,19 @@ +# FacilityFeaturesInner + +## Enum + + +* `BAREMETAL` (value: `"baremetal"`) + +* `BACKEND_TRANSFER` (value: `"backend_transfer"`) + +* `LAYER_2` (value: `"layer_2"`) + +* `GLOBAL_IPV4` (value: `"global_ipv4"`) + +* `IBX` (value: `"ibx"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FacilityInput.md b/services/metalv1/docs/FacilityInput.md new file mode 100644 index 00000000..cd9d3466 --- /dev/null +++ b/services/metalv1/docs/FacilityInput.md @@ -0,0 +1,51 @@ +# FacilityInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Facility** | **[]string** | The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. | + +## Methods + +### NewFacilityInput + +`func NewFacilityInput(facility []string, ) *FacilityInput` + +NewFacilityInput instantiates a new FacilityInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFacilityInputWithDefaults + +`func NewFacilityInputWithDefaults() *FacilityInput` + +NewFacilityInputWithDefaults instantiates a new FacilityInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFacility + +`func (o *FacilityInput) GetFacility() []string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *FacilityInput) GetFacilityOk() (*[]string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *FacilityInput) SetFacility(v []string)` + +SetFacility sets Facility field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FacilityList.md b/services/metalv1/docs/FacilityList.md new file mode 100644 index 00000000..f3ea95cc --- /dev/null +++ b/services/metalv1/docs/FacilityList.md @@ -0,0 +1,56 @@ +# FacilityList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Facilities** | Pointer to [**[]Facility**](Facility.md) | | [optional] + +## Methods + +### NewFacilityList + +`func NewFacilityList() *FacilityList` + +NewFacilityList instantiates a new FacilityList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFacilityListWithDefaults + +`func NewFacilityListWithDefaults() *FacilityList` + +NewFacilityListWithDefaults instantiates a new FacilityList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFacilities + +`func (o *FacilityList) GetFacilities() []Facility` + +GetFacilities returns the Facilities field if non-nil, zero value otherwise. + +### GetFacilitiesOk + +`func (o *FacilityList) GetFacilitiesOk() (*[]Facility, bool)` + +GetFacilitiesOk returns a tuple with the Facilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacilities + +`func (o *FacilityList) SetFacilities(v []Facility)` + +SetFacilities sets Facilities field to given value. + +### HasFacilities + +`func (o *FacilityList) HasFacilities() bool` + +HasFacilities returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Filesystem.md b/services/metalv1/docs/Filesystem.md new file mode 100644 index 00000000..46b475f3 --- /dev/null +++ b/services/metalv1/docs/Filesystem.md @@ -0,0 +1,56 @@ +# Filesystem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mount** | Pointer to [**Mount**](Mount.md) | | [optional] + +## Methods + +### NewFilesystem + +`func NewFilesystem() *Filesystem` + +NewFilesystem instantiates a new Filesystem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFilesystemWithDefaults + +`func NewFilesystemWithDefaults() *Filesystem` + +NewFilesystemWithDefaults instantiates a new Filesystem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMount + +`func (o *Filesystem) GetMount() Mount` + +GetMount returns the Mount field if non-nil, zero value otherwise. + +### GetMountOk + +`func (o *Filesystem) GetMountOk() (*Mount, bool)` + +GetMountOk returns a tuple with the Mount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMount + +`func (o *Filesystem) SetMount(v Mount)` + +SetMount sets Mount field to given value. + +### HasMount + +`func (o *Filesystem) HasMount() bool` + +HasMount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindFacilitiesIncludeParameterInner.md b/services/metalv1/docs/FindFacilitiesIncludeParameterInner.md new file mode 100644 index 00000000..d76fa665 --- /dev/null +++ b/services/metalv1/docs/FindFacilitiesIncludeParameterInner.md @@ -0,0 +1,13 @@ +# FindFacilitiesIncludeParameterInner + +## Enum + + +* `ADDRESS` (value: `"address"`) + +* `LABELS` (value: `"labels"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindIPAddressById200Response.md b/services/metalv1/docs/FindIPAddressById200Response.md new file mode 100644 index 00000000..94b9c3f9 --- /dev/null +++ b/services/metalv1/docs/FindIPAddressById200Response.md @@ -0,0 +1,904 @@ +# FindIPAddressById200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to **string** | | [optional] +**AddressFamily** | Pointer to **int32** | | [optional] +**AssignedTo** | Pointer to [**Href**](Href.md) | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**GlobalIp** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**ParentBlock** | Pointer to [**ParentBlock**](ParentBlock.md) | | [optional] +**Public** | Pointer to **bool** | | [optional] +**State** | Pointer to **string** | | [optional] +**NextHop** | Pointer to **string** | Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. | [optional] +**Type** | [**VrfIpReservationType**](VrfIpReservationType.md) | | +**Addon** | Pointer to **bool** | | [optional] +**Assignments** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] +**Available** | Pointer to **string** | | [optional] +**Bill** | Pointer to **bool** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**MetalGateway** | Pointer to [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**ProjectLite** | Pointer to [**Project**](Project.md) | | [optional] +**RequestedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Vrf** | [**Vrf**](Vrf.md) | | + +## Methods + +### NewFindIPAddressById200Response + +`func NewFindIPAddressById200Response(type_ VrfIpReservationType, vrf Vrf, ) *FindIPAddressById200Response` + +NewFindIPAddressById200Response instantiates a new FindIPAddressById200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFindIPAddressById200ResponseWithDefaults + +`func NewFindIPAddressById200ResponseWithDefaults() *FindIPAddressById200Response` + +NewFindIPAddressById200ResponseWithDefaults instantiates a new FindIPAddressById200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *FindIPAddressById200Response) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *FindIPAddressById200Response) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *FindIPAddressById200Response) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *FindIPAddressById200Response) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetAddressFamily + +`func (o *FindIPAddressById200Response) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *FindIPAddressById200Response) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *FindIPAddressById200Response) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *FindIPAddressById200Response) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetAssignedTo + +`func (o *FindIPAddressById200Response) GetAssignedTo() Href` + +GetAssignedTo returns the AssignedTo field if non-nil, zero value otherwise. + +### GetAssignedToOk + +`func (o *FindIPAddressById200Response) GetAssignedToOk() (*Href, bool)` + +GetAssignedToOk returns a tuple with the AssignedTo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignedTo + +`func (o *FindIPAddressById200Response) SetAssignedTo(v Href)` + +SetAssignedTo sets AssignedTo field to given value. + +### HasAssignedTo + +`func (o *FindIPAddressById200Response) HasAssignedTo() bool` + +HasAssignedTo returns a boolean if a field has been set. + +### GetCidr + +`func (o *FindIPAddressById200Response) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *FindIPAddressById200Response) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *FindIPAddressById200Response) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *FindIPAddressById200Response) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *FindIPAddressById200Response) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *FindIPAddressById200Response) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *FindIPAddressById200Response) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *FindIPAddressById200Response) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetEnabled + +`func (o *FindIPAddressById200Response) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *FindIPAddressById200Response) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *FindIPAddressById200Response) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *FindIPAddressById200Response) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetGateway + +`func (o *FindIPAddressById200Response) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *FindIPAddressById200Response) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *FindIPAddressById200Response) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *FindIPAddressById200Response) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetGlobalIp + +`func (o *FindIPAddressById200Response) GetGlobalIp() bool` + +GetGlobalIp returns the GlobalIp field if non-nil, zero value otherwise. + +### GetGlobalIpOk + +`func (o *FindIPAddressById200Response) GetGlobalIpOk() (*bool, bool)` + +GetGlobalIpOk returns a tuple with the GlobalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalIp + +`func (o *FindIPAddressById200Response) SetGlobalIp(v bool)` + +SetGlobalIp sets GlobalIp field to given value. + +### HasGlobalIp + +`func (o *FindIPAddressById200Response) HasGlobalIp() bool` + +HasGlobalIp returns a boolean if a field has been set. + +### GetHref + +`func (o *FindIPAddressById200Response) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *FindIPAddressById200Response) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *FindIPAddressById200Response) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *FindIPAddressById200Response) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *FindIPAddressById200Response) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *FindIPAddressById200Response) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *FindIPAddressById200Response) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *FindIPAddressById200Response) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetManageable + +`func (o *FindIPAddressById200Response) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *FindIPAddressById200Response) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *FindIPAddressById200Response) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *FindIPAddressById200Response) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetManagement + +`func (o *FindIPAddressById200Response) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *FindIPAddressById200Response) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *FindIPAddressById200Response) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *FindIPAddressById200Response) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetMetro + +`func (o *FindIPAddressById200Response) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *FindIPAddressById200Response) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *FindIPAddressById200Response) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *FindIPAddressById200Response) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetmask + +`func (o *FindIPAddressById200Response) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *FindIPAddressById200Response) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *FindIPAddressById200Response) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *FindIPAddressById200Response) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *FindIPAddressById200Response) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *FindIPAddressById200Response) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *FindIPAddressById200Response) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *FindIPAddressById200Response) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetParentBlock + +`func (o *FindIPAddressById200Response) GetParentBlock() ParentBlock` + +GetParentBlock returns the ParentBlock field if non-nil, zero value otherwise. + +### GetParentBlockOk + +`func (o *FindIPAddressById200Response) GetParentBlockOk() (*ParentBlock, bool)` + +GetParentBlockOk returns a tuple with the ParentBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentBlock + +`func (o *FindIPAddressById200Response) SetParentBlock(v ParentBlock)` + +SetParentBlock sets ParentBlock field to given value. + +### HasParentBlock + +`func (o *FindIPAddressById200Response) HasParentBlock() bool` + +HasParentBlock returns a boolean if a field has been set. + +### GetPublic + +`func (o *FindIPAddressById200Response) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *FindIPAddressById200Response) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *FindIPAddressById200Response) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *FindIPAddressById200Response) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetState + +`func (o *FindIPAddressById200Response) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *FindIPAddressById200Response) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *FindIPAddressById200Response) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *FindIPAddressById200Response) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetNextHop + +`func (o *FindIPAddressById200Response) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *FindIPAddressById200Response) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *FindIPAddressById200Response) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + +### HasNextHop + +`func (o *FindIPAddressById200Response) HasNextHop() bool` + +HasNextHop returns a boolean if a field has been set. + +### GetType + +`func (o *FindIPAddressById200Response) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FindIPAddressById200Response) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *FindIPAddressById200Response) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + + +### GetAddon + +`func (o *FindIPAddressById200Response) GetAddon() bool` + +GetAddon returns the Addon field if non-nil, zero value otherwise. + +### GetAddonOk + +`func (o *FindIPAddressById200Response) GetAddonOk() (*bool, bool)` + +GetAddonOk returns a tuple with the Addon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddon + +`func (o *FindIPAddressById200Response) SetAddon(v bool)` + +SetAddon sets Addon field to given value. + +### HasAddon + +`func (o *FindIPAddressById200Response) HasAddon() bool` + +HasAddon returns a boolean if a field has been set. + +### GetAssignments + +`func (o *FindIPAddressById200Response) GetAssignments() []IPAssignment` + +GetAssignments returns the Assignments field if non-nil, zero value otherwise. + +### GetAssignmentsOk + +`func (o *FindIPAddressById200Response) GetAssignmentsOk() (*[]IPAssignment, bool)` + +GetAssignmentsOk returns a tuple with the Assignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignments + +`func (o *FindIPAddressById200Response) SetAssignments(v []IPAssignment)` + +SetAssignments sets Assignments field to given value. + +### HasAssignments + +`func (o *FindIPAddressById200Response) HasAssignments() bool` + +HasAssignments returns a boolean if a field has been set. + +### GetAvailable + +`func (o *FindIPAddressById200Response) GetAvailable() string` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *FindIPAddressById200Response) GetAvailableOk() (*string, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *FindIPAddressById200Response) SetAvailable(v string)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *FindIPAddressById200Response) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetBill + +`func (o *FindIPAddressById200Response) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *FindIPAddressById200Response) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *FindIPAddressById200Response) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *FindIPAddressById200Response) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *FindIPAddressById200Response) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *FindIPAddressById200Response) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *FindIPAddressById200Response) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *FindIPAddressById200Response) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDetails + +`func (o *FindIPAddressById200Response) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *FindIPAddressById200Response) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *FindIPAddressById200Response) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *FindIPAddressById200Response) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *FindIPAddressById200Response) GetFacility() IPReservationFacility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *FindIPAddressById200Response) GetFacilityOk() (*IPReservationFacility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *FindIPAddressById200Response) SetFacility(v IPReservationFacility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *FindIPAddressById200Response) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *FindIPAddressById200Response) GetMetalGateway() MetalGatewayLite` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *FindIPAddressById200Response) GetMetalGatewayOk() (*MetalGatewayLite, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *FindIPAddressById200Response) SetMetalGateway(v MetalGatewayLite)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *FindIPAddressById200Response) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetProject + +`func (o *FindIPAddressById200Response) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *FindIPAddressById200Response) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *FindIPAddressById200Response) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *FindIPAddressById200Response) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *FindIPAddressById200Response) GetProjectLite() Project` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *FindIPAddressById200Response) GetProjectLiteOk() (*Project, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *FindIPAddressById200Response) SetProjectLite(v Project)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *FindIPAddressById200Response) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetRequestedBy + +`func (o *FindIPAddressById200Response) GetRequestedBy() Href` + +GetRequestedBy returns the RequestedBy field if non-nil, zero value otherwise. + +### GetRequestedByOk + +`func (o *FindIPAddressById200Response) GetRequestedByOk() (*Href, bool)` + +GetRequestedByOk returns a tuple with the RequestedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedBy + +`func (o *FindIPAddressById200Response) SetRequestedBy(v Href)` + +SetRequestedBy sets RequestedBy field to given value. + +### HasRequestedBy + +`func (o *FindIPAddressById200Response) HasRequestedBy() bool` + +HasRequestedBy returns a boolean if a field has been set. + +### GetTags + +`func (o *FindIPAddressById200Response) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *FindIPAddressById200Response) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *FindIPAddressById200Response) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *FindIPAddressById200Response) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *FindIPAddressById200Response) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *FindIPAddressById200Response) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *FindIPAddressById200Response) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *FindIPAddressById200Response) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetVrf + +`func (o *FindIPAddressById200Response) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *FindIPAddressById200Response) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *FindIPAddressById200Response) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindIPAvailabilitiesCidrParameter.md b/services/metalv1/docs/FindIPAvailabilitiesCidrParameter.md new file mode 100644 index 00000000..a32060b2 --- /dev/null +++ b/services/metalv1/docs/FindIPAvailabilitiesCidrParameter.md @@ -0,0 +1,227 @@ +# FindIPAvailabilitiesCidrParameter + +## Enum + + +* `_20` (value: `"20"`) + +* `_21` (value: `"21"`) + +* `_22` (value: `"22"`) + +* `_23` (value: `"23"`) + +* `_24` (value: `"24"`) + +* `_25` (value: `"25"`) + +* `_26` (value: `"26"`) + +* `_27` (value: `"27"`) + +* `_28` (value: `"28"`) + +* `_29` (value: `"29"`) + +* `_30` (value: `"30"`) + +* `_31` (value: `"31"`) + +* `_32` (value: `"32"`) + +* `_33` (value: `"33"`) + +* `_34` (value: `"34"`) + +* `_35` (value: `"35"`) + +* `_36` (value: `"36"`) + +* `_37` (value: `"37"`) + +* `_38` (value: `"38"`) + +* `_39` (value: `"39"`) + +* `_40` (value: `"40"`) + +* `_41` (value: `"41"`) + +* `_42` (value: `"42"`) + +* `_43` (value: `"43"`) + +* `_44` (value: `"44"`) + +* `_45` (value: `"45"`) + +* `_46` (value: `"46"`) + +* `_47` (value: `"47"`) + +* `_48` (value: `"48"`) + +* `_49` (value: `"49"`) + +* `_50` (value: `"50"`) + +* `_51` (value: `"51"`) + +* `_52` (value: `"52"`) + +* `_53` (value: `"53"`) + +* `_54` (value: `"54"`) + +* `_55` (value: `"55"`) + +* `_56` (value: `"56"`) + +* `_57` (value: `"57"`) + +* `_58` (value: `"58"`) + +* `_59` (value: `"59"`) + +* `_60` (value: `"60"`) + +* `_61` (value: `"61"`) + +* `_62` (value: `"62"`) + +* `_63` (value: `"63"`) + +* `_64` (value: `"64"`) + +* `_65` (value: `"65"`) + +* `_66` (value: `"66"`) + +* `_67` (value: `"67"`) + +* `_68` (value: `"68"`) + +* `_69` (value: `"69"`) + +* `_70` (value: `"70"`) + +* `_71` (value: `"71"`) + +* `_72` (value: `"72"`) + +* `_73` (value: `"73"`) + +* `_74` (value: `"74"`) + +* `_75` (value: `"75"`) + +* `_76` (value: `"76"`) + +* `_77` (value: `"77"`) + +* `_78` (value: `"78"`) + +* `_79` (value: `"79"`) + +* `_80` (value: `"80"`) + +* `_81` (value: `"81"`) + +* `_82` (value: `"82"`) + +* `_83` (value: `"83"`) + +* `_84` (value: `"84"`) + +* `_85` (value: `"85"`) + +* `_86` (value: `"86"`) + +* `_87` (value: `"87"`) + +* `_88` (value: `"88"`) + +* `_89` (value: `"89"`) + +* `_90` (value: `"90"`) + +* `_91` (value: `"91"`) + +* `_92` (value: `"92"`) + +* `_93` (value: `"93"`) + +* `_94` (value: `"94"`) + +* `_95` (value: `"95"`) + +* `_96` (value: `"96"`) + +* `_97` (value: `"97"`) + +* `_98` (value: `"98"`) + +* `_99` (value: `"99"`) + +* `_100` (value: `"100"`) + +* `_101` (value: `"101"`) + +* `_102` (value: `"102"`) + +* `_103` (value: `"103"`) + +* `_104` (value: `"104"`) + +* `_105` (value: `"105"`) + +* `_106` (value: `"106"`) + +* `_107` (value: `"107"`) + +* `_108` (value: `"108"`) + +* `_109` (value: `"109"`) + +* `_110` (value: `"110"`) + +* `_111` (value: `"111"`) + +* `_112` (value: `"112"`) + +* `_113` (value: `"113"`) + +* `_114` (value: `"114"`) + +* `_115` (value: `"115"`) + +* `_116` (value: `"116"`) + +* `_117` (value: `"117"`) + +* `_118` (value: `"118"`) + +* `_119` (value: `"119"`) + +* `_120` (value: `"120"`) + +* `_121` (value: `"121"`) + +* `_122` (value: `"122"`) + +* `_123` (value: `"123"`) + +* `_124` (value: `"124"`) + +* `_125` (value: `"125"`) + +* `_126` (value: `"126"`) + +* `_127` (value: `"127"`) + +* `_128` (value: `"128"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindIPReservationsTypesParameterInner.md b/services/metalv1/docs/FindIPReservationsTypesParameterInner.md new file mode 100644 index 00000000..31aac05a --- /dev/null +++ b/services/metalv1/docs/FindIPReservationsTypesParameterInner.md @@ -0,0 +1,19 @@ +# FindIPReservationsTypesParameterInner + +## Enum + + +* `GLOBAL_IPV4` (value: `"global_ipv4"`) + +* `PRIVATE_IPV4` (value: `"private_ipv4"`) + +* `PUBLIC_IPV4` (value: `"public_ipv4"`) + +* `PUBLIC_IPV6` (value: `"public_ipv6"`) + +* `VRF` (value: `"vrf"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindMetalGatewayById200Response.md b/services/metalv1/docs/FindMetalGatewayById200Response.md new file mode 100644 index 00000000..98ded419 --- /dev/null +++ b/services/metalv1/docs/FindMetalGatewayById200Response.md @@ -0,0 +1,290 @@ +# FindMetalGatewayById200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpReservation** | Pointer to [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**State** | Pointer to [**MetalGatewayState**](MetalGatewayState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**Vrf** | Pointer to [**Vrf**](Vrf.md) | | [optional] + +## Methods + +### NewFindMetalGatewayById200Response + +`func NewFindMetalGatewayById200Response() *FindMetalGatewayById200Response` + +NewFindMetalGatewayById200Response instantiates a new FindMetalGatewayById200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFindMetalGatewayById200ResponseWithDefaults + +`func NewFindMetalGatewayById200ResponseWithDefaults() *FindMetalGatewayById200Response` + +NewFindMetalGatewayById200ResponseWithDefaults instantiates a new FindMetalGatewayById200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *FindMetalGatewayById200Response) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *FindMetalGatewayById200Response) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *FindMetalGatewayById200Response) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *FindMetalGatewayById200Response) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *FindMetalGatewayById200Response) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *FindMetalGatewayById200Response) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *FindMetalGatewayById200Response) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *FindMetalGatewayById200Response) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetHref + +`func (o *FindMetalGatewayById200Response) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *FindMetalGatewayById200Response) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *FindMetalGatewayById200Response) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *FindMetalGatewayById200Response) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *FindMetalGatewayById200Response) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *FindMetalGatewayById200Response) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *FindMetalGatewayById200Response) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *FindMetalGatewayById200Response) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpReservation + +`func (o *FindMetalGatewayById200Response) GetIpReservation() VrfIpReservation` + +GetIpReservation returns the IpReservation field if non-nil, zero value otherwise. + +### GetIpReservationOk + +`func (o *FindMetalGatewayById200Response) GetIpReservationOk() (*VrfIpReservation, bool)` + +GetIpReservationOk returns a tuple with the IpReservation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservation + +`func (o *FindMetalGatewayById200Response) SetIpReservation(v VrfIpReservation)` + +SetIpReservation sets IpReservation field to given value. + +### HasIpReservation + +`func (o *FindMetalGatewayById200Response) HasIpReservation() bool` + +HasIpReservation returns a boolean if a field has been set. + +### GetProject + +`func (o *FindMetalGatewayById200Response) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *FindMetalGatewayById200Response) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *FindMetalGatewayById200Response) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *FindMetalGatewayById200Response) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetState + +`func (o *FindMetalGatewayById200Response) GetState() MetalGatewayState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *FindMetalGatewayById200Response) GetStateOk() (*MetalGatewayState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *FindMetalGatewayById200Response) SetState(v MetalGatewayState)` + +SetState sets State field to given value. + +### HasState + +`func (o *FindMetalGatewayById200Response) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *FindMetalGatewayById200Response) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *FindMetalGatewayById200Response) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *FindMetalGatewayById200Response) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *FindMetalGatewayById200Response) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *FindMetalGatewayById200Response) GetVirtualNetwork() VirtualNetwork` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *FindMetalGatewayById200Response) GetVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *FindMetalGatewayById200Response) SetVirtualNetwork(v VirtualNetwork)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *FindMetalGatewayById200Response) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVrf + +`func (o *FindMetalGatewayById200Response) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *FindMetalGatewayById200Response) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *FindMetalGatewayById200Response) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + +### HasVrf + +`func (o *FindMetalGatewayById200Response) HasVrf() bool` + +HasVrf returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindOrganizationDevicesCategoriesParameterInner.md b/services/metalv1/docs/FindOrganizationDevicesCategoriesParameterInner.md new file mode 100644 index 00000000..7761b88a --- /dev/null +++ b/services/metalv1/docs/FindOrganizationDevicesCategoriesParameterInner.md @@ -0,0 +1,19 @@ +# FindOrganizationDevicesCategoriesParameterInner + +## Enum + + +* `COMPUTE` (value: `"compute"`) + +* `STORAGE` (value: `"storage"`) + +* `VMCE` (value: `"vmce"`) + +* `LEGACY_GEN` (value: `"legacy_gen"`) + +* `CURRENT_GEN` (value: `"current_gen"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindOrganizationsPersonalParameter.md b/services/metalv1/docs/FindOrganizationsPersonalParameter.md new file mode 100644 index 00000000..ffe47def --- /dev/null +++ b/services/metalv1/docs/FindOrganizationsPersonalParameter.md @@ -0,0 +1,15 @@ +# FindOrganizationsPersonalParameter + +## Enum + + +* `INCLUDE` (value: `"include"`) + +* `EXCLUDE` (value: `"exclude"`) + +* `ONLY` (value: `"only"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindPlansTypeParameter.md b/services/metalv1/docs/FindPlansTypeParameter.md new file mode 100644 index 00000000..866a481d --- /dev/null +++ b/services/metalv1/docs/FindPlansTypeParameter.md @@ -0,0 +1,15 @@ +# FindPlansTypeParameter + +## Enum + + +* `STANDARD` (value: `"standard"`) + +* `WORKLOAD_OPTIMIZED` (value: `"workload_optimized"`) + +* `CUSTOM` (value: `"custom"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindProjectHardwareReservationsProvisionableParameter.md b/services/metalv1/docs/FindProjectHardwareReservationsProvisionableParameter.md new file mode 100644 index 00000000..b7394a2e --- /dev/null +++ b/services/metalv1/docs/FindProjectHardwareReservationsProvisionableParameter.md @@ -0,0 +1,11 @@ +# FindProjectHardwareReservationsProvisionableParameter + +## Enum + + +* `ONLY` (value: `"only"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindProjectHardwareReservationsStateParameter.md b/services/metalv1/docs/FindProjectHardwareReservationsStateParameter.md new file mode 100644 index 00000000..4808e571 --- /dev/null +++ b/services/metalv1/docs/FindProjectHardwareReservationsStateParameter.md @@ -0,0 +1,15 @@ +# FindProjectHardwareReservationsStateParameter + +## Enum + + +* `ACTIVE` (value: `"active"`) + +* `SPARE` (value: `"spare"`) + +* `NEED_OF_SERVICE` (value: `"need_of_service"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindTrafficBucketParameter.md b/services/metalv1/docs/FindTrafficBucketParameter.md new file mode 100644 index 00000000..0e40a001 --- /dev/null +++ b/services/metalv1/docs/FindTrafficBucketParameter.md @@ -0,0 +1,13 @@ +# FindTrafficBucketParameter + +## Enum + + +* `INTERNAL` (value: `"internal"`) + +* `EXTERNAL` (value: `"external"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindTrafficDirectionParameter.md b/services/metalv1/docs/FindTrafficDirectionParameter.md new file mode 100644 index 00000000..1b2ce194 --- /dev/null +++ b/services/metalv1/docs/FindTrafficDirectionParameter.md @@ -0,0 +1,13 @@ +# FindTrafficDirectionParameter + +## Enum + + +* `INBOUND` (value: `"inbound"`) + +* `OUTBOUND` (value: `"outbound"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindTrafficIntervalParameter.md b/services/metalv1/docs/FindTrafficIntervalParameter.md new file mode 100644 index 00000000..6c9218ec --- /dev/null +++ b/services/metalv1/docs/FindTrafficIntervalParameter.md @@ -0,0 +1,29 @@ +# FindTrafficIntervalParameter + +## Enum + + +* `MINUTE` (value: `"minute"`) + +* `HOUR` (value: `"hour"`) + +* `DAY` (value: `"day"`) + +* `WEEK` (value: `"week"`) + +* `MONTH` (value: `"month"`) + +* `YEAR` (value: `"year"`) + +* `HOUR_OF_DAY` (value: `"hour_of_day"`) + +* `DAY_OF_WEEK` (value: `"day_of_week"`) + +* `DAY_OF_MONTH` (value: `"day_of_month"`) + +* `MONTH_OF_YEAR` (value: `"month_of_year"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FindTrafficTimeframeParameter.md b/services/metalv1/docs/FindTrafficTimeframeParameter.md new file mode 100644 index 00000000..a703d690 --- /dev/null +++ b/services/metalv1/docs/FindTrafficTimeframeParameter.md @@ -0,0 +1,72 @@ +# FindTrafficTimeframeParameter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EndedAt** | **time.Time** | | +**StartedAt** | **time.Time** | | + +## Methods + +### NewFindTrafficTimeframeParameter + +`func NewFindTrafficTimeframeParameter(endedAt time.Time, startedAt time.Time, ) *FindTrafficTimeframeParameter` + +NewFindTrafficTimeframeParameter instantiates a new FindTrafficTimeframeParameter object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFindTrafficTimeframeParameterWithDefaults + +`func NewFindTrafficTimeframeParameterWithDefaults() *FindTrafficTimeframeParameter` + +NewFindTrafficTimeframeParameterWithDefaults instantiates a new FindTrafficTimeframeParameter object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEndedAt + +`func (o *FindTrafficTimeframeParameter) GetEndedAt() time.Time` + +GetEndedAt returns the EndedAt field if non-nil, zero value otherwise. + +### GetEndedAtOk + +`func (o *FindTrafficTimeframeParameter) GetEndedAtOk() (*time.Time, bool)` + +GetEndedAtOk returns a tuple with the EndedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndedAt + +`func (o *FindTrafficTimeframeParameter) SetEndedAt(v time.Time)` + +SetEndedAt sets EndedAt field to given value. + + +### GetStartedAt + +`func (o *FindTrafficTimeframeParameter) GetStartedAt() time.Time` + +GetStartedAt returns the StartedAt field if non-nil, zero value otherwise. + +### GetStartedAtOk + +`func (o *FindTrafficTimeframeParameter) GetStartedAtOk() (*time.Time, bool)` + +GetStartedAtOk returns a tuple with the StartedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartedAt + +`func (o *FindTrafficTimeframeParameter) SetStartedAt(v time.Time)` + +SetStartedAt sets StartedAt field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FirmwareSet.md b/services/metalv1/docs/FirmwareSet.md new file mode 100644 index 00000000..c473324d --- /dev/null +++ b/services/metalv1/docs/FirmwareSet.md @@ -0,0 +1,176 @@ +# FirmwareSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | **string** | Firmware Set UUID | [readonly] +**Name** | **string** | Firmware Set Name | [readonly] +**CreatedAt** | Pointer to **time.Time** | Datetime when the block was created. | [optional] [readonly] +**UpdatedAt** | Pointer to **time.Time** | Datetime when the block was updated. | [optional] [readonly] +**Attributes** | Pointer to [**[]Attribute**](Attribute.md) | Represents a list of attributes | [optional] +**ComponentFirmware** | Pointer to [**[]Component**](Component.md) | List of components versions | [optional] + +## Methods + +### NewFirmwareSet + +`func NewFirmwareSet(uuid string, name string, ) *FirmwareSet` + +NewFirmwareSet instantiates a new FirmwareSet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFirmwareSetWithDefaults + +`func NewFirmwareSetWithDefaults() *FirmwareSet` + +NewFirmwareSetWithDefaults instantiates a new FirmwareSet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUuid + +`func (o *FirmwareSet) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *FirmwareSet) GetUuidOk() (*string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUuid + +`func (o *FirmwareSet) SetUuid(v string)` + +SetUuid sets Uuid field to given value. + + +### GetName + +`func (o *FirmwareSet) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *FirmwareSet) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *FirmwareSet) SetName(v string)` + +SetName sets Name field to given value. + + +### GetCreatedAt + +`func (o *FirmwareSet) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *FirmwareSet) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *FirmwareSet) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *FirmwareSet) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *FirmwareSet) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *FirmwareSet) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *FirmwareSet) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *FirmwareSet) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetAttributes + +`func (o *FirmwareSet) GetAttributes() []Attribute` + +GetAttributes returns the Attributes field if non-nil, zero value otherwise. + +### GetAttributesOk + +`func (o *FirmwareSet) GetAttributesOk() (*[]Attribute, bool)` + +GetAttributesOk returns a tuple with the Attributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAttributes + +`func (o *FirmwareSet) SetAttributes(v []Attribute)` + +SetAttributes sets Attributes field to given value. + +### HasAttributes + +`func (o *FirmwareSet) HasAttributes() bool` + +HasAttributes returns a boolean if a field has been set. + +### GetComponentFirmware + +`func (o *FirmwareSet) GetComponentFirmware() []Component` + +GetComponentFirmware returns the ComponentFirmware field if non-nil, zero value otherwise. + +### GetComponentFirmwareOk + +`func (o *FirmwareSet) GetComponentFirmwareOk() (*[]Component, bool)` + +GetComponentFirmwareOk returns a tuple with the ComponentFirmware field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComponentFirmware + +`func (o *FirmwareSet) SetComponentFirmware(v []Component)` + +SetComponentFirmware sets ComponentFirmware field to given value. + +### HasComponentFirmware + +`func (o *FirmwareSet) HasComponentFirmware() bool` + +HasComponentFirmware returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FirmwareSetListResponse.md b/services/metalv1/docs/FirmwareSetListResponse.md new file mode 100644 index 00000000..ae46ada1 --- /dev/null +++ b/services/metalv1/docs/FirmwareSetListResponse.md @@ -0,0 +1,186 @@ +# FirmwareSetListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PageSize** | Pointer to **int32** | Max number of items returned in a page | [optional] +**Page** | Pointer to **int32** | Page returned | [optional] +**PageCount** | Pointer to **int32** | Items returned in current page | [optional] +**TotalPages** | Pointer to **int32** | Total count of pages | [optional] +**TotalRecordCount** | Pointer to **int32** | Total count of items | [optional] +**Records** | Pointer to [**[]FirmwareSet**](FirmwareSet.md) | Represents a list of FirmwareSets | [optional] + +## Methods + +### NewFirmwareSetListResponse + +`func NewFirmwareSetListResponse() *FirmwareSetListResponse` + +NewFirmwareSetListResponse instantiates a new FirmwareSetListResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFirmwareSetListResponseWithDefaults + +`func NewFirmwareSetListResponseWithDefaults() *FirmwareSetListResponse` + +NewFirmwareSetListResponseWithDefaults instantiates a new FirmwareSetListResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPageSize + +`func (o *FirmwareSetListResponse) GetPageSize() int32` + +GetPageSize returns the PageSize field if non-nil, zero value otherwise. + +### GetPageSizeOk + +`func (o *FirmwareSetListResponse) GetPageSizeOk() (*int32, bool)` + +GetPageSizeOk returns a tuple with the PageSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageSize + +`func (o *FirmwareSetListResponse) SetPageSize(v int32)` + +SetPageSize sets PageSize field to given value. + +### HasPageSize + +`func (o *FirmwareSetListResponse) HasPageSize() bool` + +HasPageSize returns a boolean if a field has been set. + +### GetPage + +`func (o *FirmwareSetListResponse) GetPage() int32` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *FirmwareSetListResponse) GetPageOk() (*int32, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *FirmwareSetListResponse) SetPage(v int32)` + +SetPage sets Page field to given value. + +### HasPage + +`func (o *FirmwareSetListResponse) HasPage() bool` + +HasPage returns a boolean if a field has been set. + +### GetPageCount + +`func (o *FirmwareSetListResponse) GetPageCount() int32` + +GetPageCount returns the PageCount field if non-nil, zero value otherwise. + +### GetPageCountOk + +`func (o *FirmwareSetListResponse) GetPageCountOk() (*int32, bool)` + +GetPageCountOk returns a tuple with the PageCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageCount + +`func (o *FirmwareSetListResponse) SetPageCount(v int32)` + +SetPageCount sets PageCount field to given value. + +### HasPageCount + +`func (o *FirmwareSetListResponse) HasPageCount() bool` + +HasPageCount returns a boolean if a field has been set. + +### GetTotalPages + +`func (o *FirmwareSetListResponse) GetTotalPages() int32` + +GetTotalPages returns the TotalPages field if non-nil, zero value otherwise. + +### GetTotalPagesOk + +`func (o *FirmwareSetListResponse) GetTotalPagesOk() (*int32, bool)` + +GetTotalPagesOk returns a tuple with the TotalPages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalPages + +`func (o *FirmwareSetListResponse) SetTotalPages(v int32)` + +SetTotalPages sets TotalPages field to given value. + +### HasTotalPages + +`func (o *FirmwareSetListResponse) HasTotalPages() bool` + +HasTotalPages returns a boolean if a field has been set. + +### GetTotalRecordCount + +`func (o *FirmwareSetListResponse) GetTotalRecordCount() int32` + +GetTotalRecordCount returns the TotalRecordCount field if non-nil, zero value otherwise. + +### GetTotalRecordCountOk + +`func (o *FirmwareSetListResponse) GetTotalRecordCountOk() (*int32, bool)` + +GetTotalRecordCountOk returns a tuple with the TotalRecordCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalRecordCount + +`func (o *FirmwareSetListResponse) SetTotalRecordCount(v int32)` + +SetTotalRecordCount sets TotalRecordCount field to given value. + +### HasTotalRecordCount + +`func (o *FirmwareSetListResponse) HasTotalRecordCount() bool` + +HasTotalRecordCount returns a boolean if a field has been set. + +### GetRecords + +`func (o *FirmwareSetListResponse) GetRecords() []FirmwareSet` + +GetRecords returns the Records field if non-nil, zero value otherwise. + +### GetRecordsOk + +`func (o *FirmwareSetListResponse) GetRecordsOk() (*[]FirmwareSet, bool)` + +GetRecordsOk returns a tuple with the Records field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecords + +`func (o *FirmwareSetListResponse) SetRecords(v []FirmwareSet)` + +SetRecords sets Records field to given value. + +### HasRecords + +`func (o *FirmwareSetListResponse) HasRecords() bool` + +HasRecords returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FirmwareSetResponse.md b/services/metalv1/docs/FirmwareSetResponse.md new file mode 100644 index 00000000..7b590dce --- /dev/null +++ b/services/metalv1/docs/FirmwareSetResponse.md @@ -0,0 +1,56 @@ +# FirmwareSetResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Record** | Pointer to [**FirmwareSet**](FirmwareSet.md) | | [optional] + +## Methods + +### NewFirmwareSetResponse + +`func NewFirmwareSetResponse() *FirmwareSetResponse` + +NewFirmwareSetResponse instantiates a new FirmwareSetResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewFirmwareSetResponseWithDefaults + +`func NewFirmwareSetResponseWithDefaults() *FirmwareSetResponse` + +NewFirmwareSetResponseWithDefaults instantiates a new FirmwareSetResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecord + +`func (o *FirmwareSetResponse) GetRecord() FirmwareSet` + +GetRecord returns the Record field if non-nil, zero value otherwise. + +### GetRecordOk + +`func (o *FirmwareSetResponse) GetRecordOk() (*FirmwareSet, bool)` + +GetRecordOk returns a tuple with the Record field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecord + +`func (o *FirmwareSetResponse) SetRecord(v FirmwareSet)` + +SetRecord sets Record field to given value. + +### HasRecord + +`func (o *FirmwareSetResponse) HasRecord() bool` + +HasRecord returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/FirmwareSetsApi.md b/services/metalv1/docs/FirmwareSetsApi.md new file mode 100644 index 00000000..7aff6786 --- /dev/null +++ b/services/metalv1/docs/FirmwareSetsApi.md @@ -0,0 +1,158 @@ +# \FirmwareSetsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetOrganizationFirmwareSets**](FirmwareSetsApi.md#GetOrganizationFirmwareSets) | **Get** /organizations/{id}/firmware-sets | Get Organization's Firmware Sets +[**GetProjectFirmwareSets**](FirmwareSetsApi.md#GetProjectFirmwareSets) | **Get** /projects/{id}/firmware-sets | Get Project's Firmware Sets + + + +## GetOrganizationFirmwareSets + +> FirmwareSetListResponse GetOrganizationFirmwareSets(ctx, id).Page(page).PerPage(perPage).Execute() + +Get Organization's Firmware Sets + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + page := int32(56) // int32 | page number to return (optional) + perPage := int32(56) // int32 | items returned per page. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FirmwareSetsApi.GetOrganizationFirmwareSets(context.Background(), id).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FirmwareSetsApi.GetOrganizationFirmwareSets``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOrganizationFirmwareSets`: FirmwareSetListResponse + fmt.Fprintf(os.Stdout, "Response from `FirmwareSetsApi.GetOrganizationFirmwareSets`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOrganizationFirmwareSetsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **page** | **int32** | page number to return | + **perPage** | **int32** | items returned per page. | + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetProjectFirmwareSets + +> FirmwareSetListResponse GetProjectFirmwareSets(ctx, id).Page(page).PerPage(perPage).Execute() + +Get Project's Firmware Sets + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + page := int32(56) // int32 | page number to return (optional) + perPage := int32(56) // int32 | items returned per page. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FirmwareSetsApi.GetProjectFirmwareSets(context.Background(), id).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FirmwareSetsApi.GetProjectFirmwareSets``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetProjectFirmwareSets`: FirmwareSetListResponse + fmt.Fprintf(os.Stdout, "Response from `FirmwareSetsApi.GetProjectFirmwareSets`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetProjectFirmwareSetsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **page** | **int32** | page number to return | + **perPage** | **int32** | items returned per page. | + +### Return type + +[**FirmwareSetListResponse**](FirmwareSetListResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/GlobalBgpRange.md b/services/metalv1/docs/GlobalBgpRange.md new file mode 100644 index 00000000..a2ef6597 --- /dev/null +++ b/services/metalv1/docs/GlobalBgpRange.md @@ -0,0 +1,160 @@ +# GlobalBgpRange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to **int32** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Range** | Pointer to **string** | | [optional] + +## Methods + +### NewGlobalBgpRange + +`func NewGlobalBgpRange() *GlobalBgpRange` + +NewGlobalBgpRange instantiates a new GlobalBgpRange object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGlobalBgpRangeWithDefaults + +`func NewGlobalBgpRangeWithDefaults() *GlobalBgpRange` + +NewGlobalBgpRangeWithDefaults instantiates a new GlobalBgpRange object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *GlobalBgpRange) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *GlobalBgpRange) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *GlobalBgpRange) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *GlobalBgpRange) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetHref + +`func (o *GlobalBgpRange) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *GlobalBgpRange) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *GlobalBgpRange) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *GlobalBgpRange) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *GlobalBgpRange) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *GlobalBgpRange) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *GlobalBgpRange) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *GlobalBgpRange) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProject + +`func (o *GlobalBgpRange) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *GlobalBgpRange) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *GlobalBgpRange) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *GlobalBgpRange) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRange + +`func (o *GlobalBgpRange) GetRange() string` + +GetRange returns the Range field if non-nil, zero value otherwise. + +### GetRangeOk + +`func (o *GlobalBgpRange) GetRangeOk() (*string, bool)` + +GetRangeOk returns a tuple with the Range field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRange + +`func (o *GlobalBgpRange) SetRange(v string)` + +SetRange sets Range field to given value. + +### HasRange + +`func (o *GlobalBgpRange) HasRange() bool` + +HasRange returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/GlobalBgpRangeList.md b/services/metalv1/docs/GlobalBgpRangeList.md new file mode 100644 index 00000000..089070e1 --- /dev/null +++ b/services/metalv1/docs/GlobalBgpRangeList.md @@ -0,0 +1,56 @@ +# GlobalBgpRangeList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GlobalBgpRanges** | Pointer to [**[]GlobalBgpRange**](GlobalBgpRange.md) | | [optional] + +## Methods + +### NewGlobalBgpRangeList + +`func NewGlobalBgpRangeList() *GlobalBgpRangeList` + +NewGlobalBgpRangeList instantiates a new GlobalBgpRangeList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGlobalBgpRangeListWithDefaults + +`func NewGlobalBgpRangeListWithDefaults() *GlobalBgpRangeList` + +NewGlobalBgpRangeListWithDefaults instantiates a new GlobalBgpRangeList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGlobalBgpRanges + +`func (o *GlobalBgpRangeList) GetGlobalBgpRanges() []GlobalBgpRange` + +GetGlobalBgpRanges returns the GlobalBgpRanges field if non-nil, zero value otherwise. + +### GetGlobalBgpRangesOk + +`func (o *GlobalBgpRangeList) GetGlobalBgpRangesOk() (*[]GlobalBgpRange, bool)` + +GetGlobalBgpRangesOk returns a tuple with the GlobalBgpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalBgpRanges + +`func (o *GlobalBgpRangeList) SetGlobalBgpRanges(v []GlobalBgpRange)` + +SetGlobalBgpRanges sets GlobalBgpRanges field to given value. + +### HasGlobalBgpRanges + +`func (o *GlobalBgpRangeList) HasGlobalBgpRanges() bool` + +HasGlobalBgpRanges returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/HardwareReservation.md b/services/metalv1/docs/HardwareReservation.md new file mode 100644 index 00000000..d79352be --- /dev/null +++ b/services/metalv1/docs/HardwareReservation.md @@ -0,0 +1,394 @@ +# HardwareReservation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CustomRate** | Pointer to **float32** | Amount that will be charged for every billing_cycle. | [optional] +**Device** | Pointer to [**Device**](Device.md) | | [optional] +**Facility** | Pointer to [**Facility**](Facility.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**NeedOfService** | Pointer to **bool** | Whether this Device requires assistance from Equinix Metal. | [optional] +**Plan** | Pointer to [**Plan**](Plan.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**Provisionable** | Pointer to **bool** | Whether the reserved server is provisionable or not. Spare devices can't be provisioned unless they are activated first. | [optional] +**ShortId** | Pointer to **string** | Short version of the ID. | [optional] +**Spare** | Pointer to **bool** | Whether the Hardware Reservation is a spare. Spare Hardware Reservations are used when a Hardware Reservations requires service from Equinix Metal | [optional] +**SwitchUuid** | Pointer to **string** | Switch short id. This can be used to determine if two devices are connected to the same switch, for example. | [optional] +**TerminationTime** | Pointer to **time.Time** | Expiration date for the reservation. | [optional] + +## Methods + +### NewHardwareReservation + +`func NewHardwareReservation() *HardwareReservation` + +NewHardwareReservation instantiates a new HardwareReservation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHardwareReservationWithDefaults + +`func NewHardwareReservationWithDefaults() *HardwareReservation` + +NewHardwareReservationWithDefaults instantiates a new HardwareReservation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *HardwareReservation) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *HardwareReservation) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *HardwareReservation) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *HardwareReservation) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomRate + +`func (o *HardwareReservation) GetCustomRate() float32` + +GetCustomRate returns the CustomRate field if non-nil, zero value otherwise. + +### GetCustomRateOk + +`func (o *HardwareReservation) GetCustomRateOk() (*float32, bool)` + +GetCustomRateOk returns a tuple with the CustomRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomRate + +`func (o *HardwareReservation) SetCustomRate(v float32)` + +SetCustomRate sets CustomRate field to given value. + +### HasCustomRate + +`func (o *HardwareReservation) HasCustomRate() bool` + +HasCustomRate returns a boolean if a field has been set. + +### GetDevice + +`func (o *HardwareReservation) GetDevice() Device` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *HardwareReservation) GetDeviceOk() (*Device, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *HardwareReservation) SetDevice(v Device)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *HardwareReservation) HasDevice() bool` + +HasDevice returns a boolean if a field has been set. + +### GetFacility + +`func (o *HardwareReservation) GetFacility() Facility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *HardwareReservation) GetFacilityOk() (*Facility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *HardwareReservation) SetFacility(v Facility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *HardwareReservation) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetHref + +`func (o *HardwareReservation) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *HardwareReservation) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *HardwareReservation) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *HardwareReservation) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *HardwareReservation) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *HardwareReservation) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *HardwareReservation) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *HardwareReservation) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetNeedOfService + +`func (o *HardwareReservation) GetNeedOfService() bool` + +GetNeedOfService returns the NeedOfService field if non-nil, zero value otherwise. + +### GetNeedOfServiceOk + +`func (o *HardwareReservation) GetNeedOfServiceOk() (*bool, bool)` + +GetNeedOfServiceOk returns a tuple with the NeedOfService field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNeedOfService + +`func (o *HardwareReservation) SetNeedOfService(v bool)` + +SetNeedOfService sets NeedOfService field to given value. + +### HasNeedOfService + +`func (o *HardwareReservation) HasNeedOfService() bool` + +HasNeedOfService returns a boolean if a field has been set. + +### GetPlan + +`func (o *HardwareReservation) GetPlan() Plan` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *HardwareReservation) GetPlanOk() (*Plan, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *HardwareReservation) SetPlan(v Plan)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *HardwareReservation) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetProject + +`func (o *HardwareReservation) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *HardwareReservation) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *HardwareReservation) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *HardwareReservation) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProvisionable + +`func (o *HardwareReservation) GetProvisionable() bool` + +GetProvisionable returns the Provisionable field if non-nil, zero value otherwise. + +### GetProvisionableOk + +`func (o *HardwareReservation) GetProvisionableOk() (*bool, bool)` + +GetProvisionableOk returns a tuple with the Provisionable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvisionable + +`func (o *HardwareReservation) SetProvisionable(v bool)` + +SetProvisionable sets Provisionable field to given value. + +### HasProvisionable + +`func (o *HardwareReservation) HasProvisionable() bool` + +HasProvisionable returns a boolean if a field has been set. + +### GetShortId + +`func (o *HardwareReservation) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *HardwareReservation) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *HardwareReservation) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + +### HasShortId + +`func (o *HardwareReservation) HasShortId() bool` + +HasShortId returns a boolean if a field has been set. + +### GetSpare + +`func (o *HardwareReservation) GetSpare() bool` + +GetSpare returns the Spare field if non-nil, zero value otherwise. + +### GetSpareOk + +`func (o *HardwareReservation) GetSpareOk() (*bool, bool)` + +GetSpareOk returns a tuple with the Spare field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpare + +`func (o *HardwareReservation) SetSpare(v bool)` + +SetSpare sets Spare field to given value. + +### HasSpare + +`func (o *HardwareReservation) HasSpare() bool` + +HasSpare returns a boolean if a field has been set. + +### GetSwitchUuid + +`func (o *HardwareReservation) GetSwitchUuid() string` + +GetSwitchUuid returns the SwitchUuid field if non-nil, zero value otherwise. + +### GetSwitchUuidOk + +`func (o *HardwareReservation) GetSwitchUuidOk() (*string, bool)` + +GetSwitchUuidOk returns a tuple with the SwitchUuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSwitchUuid + +`func (o *HardwareReservation) SetSwitchUuid(v string)` + +SetSwitchUuid sets SwitchUuid field to given value. + +### HasSwitchUuid + +`func (o *HardwareReservation) HasSwitchUuid() bool` + +HasSwitchUuid returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *HardwareReservation) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *HardwareReservation) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *HardwareReservation) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *HardwareReservation) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/HardwareReservationList.md b/services/metalv1/docs/HardwareReservationList.md new file mode 100644 index 00000000..2a0525cd --- /dev/null +++ b/services/metalv1/docs/HardwareReservationList.md @@ -0,0 +1,82 @@ +# HardwareReservationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HardwareReservations** | Pointer to [**[]HardwareReservation**](HardwareReservation.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewHardwareReservationList + +`func NewHardwareReservationList() *HardwareReservationList` + +NewHardwareReservationList instantiates a new HardwareReservationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHardwareReservationListWithDefaults + +`func NewHardwareReservationListWithDefaults() *HardwareReservationList` + +NewHardwareReservationListWithDefaults instantiates a new HardwareReservationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHardwareReservations + +`func (o *HardwareReservationList) GetHardwareReservations() []HardwareReservation` + +GetHardwareReservations returns the HardwareReservations field if non-nil, zero value otherwise. + +### GetHardwareReservationsOk + +`func (o *HardwareReservationList) GetHardwareReservationsOk() (*[]HardwareReservation, bool)` + +GetHardwareReservationsOk returns a tuple with the HardwareReservations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservations + +`func (o *HardwareReservationList) SetHardwareReservations(v []HardwareReservation)` + +SetHardwareReservations sets HardwareReservations field to given value. + +### HasHardwareReservations + +`func (o *HardwareReservationList) HasHardwareReservations() bool` + +HasHardwareReservations returns a boolean if a field has been set. + +### GetMeta + +`func (o *HardwareReservationList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *HardwareReservationList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *HardwareReservationList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *HardwareReservationList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/HardwareReservationsApi.md b/services/metalv1/docs/HardwareReservationsApi.md new file mode 100644 index 00000000..fb7f0b99 --- /dev/null +++ b/services/metalv1/docs/HardwareReservationsApi.md @@ -0,0 +1,323 @@ +# \HardwareReservationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActivateHardwareReservation**](HardwareReservationsApi.md#ActivateHardwareReservation) | **Post** /hardware-reservations/{id}/activate | Activate a spare hardware reservation +[**FindHardwareReservationById**](HardwareReservationsApi.md#FindHardwareReservationById) | **Get** /hardware-reservations/{id} | Retrieve a hardware reservation +[**FindProjectHardwareReservations**](HardwareReservationsApi.md#FindProjectHardwareReservations) | **Get** /projects/{id}/hardware-reservations | Retrieve all hardware reservations for a given project +[**MoveHardwareReservation**](HardwareReservationsApi.md#MoveHardwareReservation) | **Post** /hardware-reservations/{id}/move | Move a hardware reservation + + + +## ActivateHardwareReservation + +> HardwareReservation ActivateHardwareReservation(ctx, id).Include(include).Exclude(exclude).ActivateHardwareReservationRequest(activateHardwareReservationRequest).Execute() + +Activate a spare hardware reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Hardware Reservation UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + activateHardwareReservationRequest := *openapiclient.NewActivateHardwareReservationRequest() // ActivateHardwareReservationRequest | Note to attach to the reservation (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HardwareReservationsApi.ActivateHardwareReservation(context.Background(), id).Include(include).Exclude(exclude).ActivateHardwareReservationRequest(activateHardwareReservationRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HardwareReservationsApi.ActivateHardwareReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActivateHardwareReservation`: HardwareReservation + fmt.Fprintf(os.Stdout, "Response from `HardwareReservationsApi.ActivateHardwareReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Hardware Reservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActivateHardwareReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **activateHardwareReservationRequest** | [**ActivateHardwareReservationRequest**](ActivateHardwareReservationRequest.md) | Note to attach to the reservation | + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindHardwareReservationById + +> HardwareReservation FindHardwareReservationById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a hardware reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | HardwareReservation UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HardwareReservationsApi.FindHardwareReservationById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HardwareReservationsApi.FindHardwareReservationById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindHardwareReservationById`: HardwareReservation + fmt.Fprintf(os.Stdout, "Response from `HardwareReservationsApi.FindHardwareReservationById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | HardwareReservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindHardwareReservationByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectHardwareReservations + +> HardwareReservationList FindProjectHardwareReservations(ctx, id).Query(query).State(state).Provisionable(provisionable).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all hardware reservations for a given project + + +FindProjectHardwareReservations is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + query := "query_example" // string | Search by facility code, plan name, project name, reservation short ID or device hostname (optional) + state := openapiclient.findProjectHardwareReservations_state_parameter("active") // FindProjectHardwareReservationsStateParameter | Filter by hardware reservation state (optional) + provisionable := openapiclient.findProjectHardwareReservations_provisionable_parameter("only") // FindProjectHardwareReservationsProvisionableParameter | Filter hardware reservation that is provisionable (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HardwareReservationsApi.FindProjectHardwareReservations(context.Background(), id).Query(query).State(state).Provisionable(provisionable).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HardwareReservationsApi.FindProjectHardwareReservations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectHardwareReservations`: HardwareReservationList + fmt.Fprintf(os.Stdout, "Response from `HardwareReservationsApi.FindProjectHardwareReservations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectHardwareReservationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **query** | **string** | Search by facility code, plan name, project name, reservation short ID or device hostname | + **state** | [**FindProjectHardwareReservationsStateParameter**](FindProjectHardwareReservationsStateParameter.md) | Filter by hardware reservation state | + **provisionable** | [**FindProjectHardwareReservationsProvisionableParameter**](FindProjectHardwareReservationsProvisionableParameter.md) | Filter hardware reservation that is provisionable | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**HardwareReservationList**](HardwareReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## MoveHardwareReservation + +> HardwareReservation MoveHardwareReservation(ctx, id).MoveHardwareReservationRequest(moveHardwareReservationRequest).Include(include).Exclude(exclude).Execute() + +Move a hardware reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Hardware Reservation UUID + moveHardwareReservationRequest := *openapiclient.NewMoveHardwareReservationRequest() // MoveHardwareReservationRequest | Destination Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HardwareReservationsApi.MoveHardwareReservation(context.Background(), id).MoveHardwareReservationRequest(moveHardwareReservationRequest).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HardwareReservationsApi.MoveHardwareReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `MoveHardwareReservation`: HardwareReservation + fmt.Fprintf(os.Stdout, "Response from `HardwareReservationsApi.MoveHardwareReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Hardware Reservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiMoveHardwareReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **moveHardwareReservationRequest** | [**MoveHardwareReservationRequest**](MoveHardwareReservationRequest.md) | Destination Project UUID | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**HardwareReservation**](HardwareReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Href.md b/services/metalv1/docs/Href.md new file mode 100644 index 00000000..1a0fd1c0 --- /dev/null +++ b/services/metalv1/docs/Href.md @@ -0,0 +1,51 @@ +# Href + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | **string** | | + +## Methods + +### NewHref + +`func NewHref(href string, ) *Href` + +NewHref instantiates a new Href object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHrefWithDefaults + +`func NewHrefWithDefaults() *Href` + +NewHrefWithDefaults instantiates a new Href object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *Href) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Href) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Href) SetHref(v string)` + +SetHref sets Href field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAddress.md b/services/metalv1/docs/IPAddress.md new file mode 100644 index 00000000..7c50e0be --- /dev/null +++ b/services/metalv1/docs/IPAddress.md @@ -0,0 +1,134 @@ +# IPAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to [**IPAddressAddressFamily**](IPAddressAddressFamily.md) | | [optional] +**Cidr** | Pointer to **int32** | Cidr Size for the IP Block created. Valid values depends on the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 for IPv6 addresses) | [optional] +**IpReservations** | Pointer to **[]string** | UUIDs of any IP reservations to use when assigning IPs | [optional] +**Public** | Pointer to **bool** | Address Type for IP Address | [optional] [default to true] + +## Methods + +### NewIPAddress + +`func NewIPAddress() *IPAddress` + +NewIPAddress instantiates a new IPAddress object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAddressWithDefaults + +`func NewIPAddressWithDefaults() *IPAddress` + +NewIPAddressWithDefaults instantiates a new IPAddress object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *IPAddress) GetAddressFamily() IPAddressAddressFamily` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *IPAddress) GetAddressFamilyOk() (*IPAddressAddressFamily, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *IPAddress) SetAddressFamily(v IPAddressAddressFamily)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *IPAddress) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetCidr + +`func (o *IPAddress) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *IPAddress) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *IPAddress) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *IPAddress) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetIpReservations + +`func (o *IPAddress) GetIpReservations() []string` + +GetIpReservations returns the IpReservations field if non-nil, zero value otherwise. + +### GetIpReservationsOk + +`func (o *IPAddress) GetIpReservationsOk() (*[]string, bool)` + +GetIpReservationsOk returns a tuple with the IpReservations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservations + +`func (o *IPAddress) SetIpReservations(v []string)` + +SetIpReservations sets IpReservations field to given value. + +### HasIpReservations + +`func (o *IPAddress) HasIpReservations() bool` + +HasIpReservations returns a boolean if a field has been set. + +### GetPublic + +`func (o *IPAddress) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *IPAddress) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *IPAddress) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *IPAddress) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAddressAddressFamily.md b/services/metalv1/docs/IPAddressAddressFamily.md new file mode 100644 index 00000000..c65b164a --- /dev/null +++ b/services/metalv1/docs/IPAddressAddressFamily.md @@ -0,0 +1,13 @@ +# IPAddressAddressFamily + +## Enum + + +* `_4` (value: `4`) + +* `_6` (value: `6`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAddressesApi.md b/services/metalv1/docs/IPAddressesApi.md new file mode 100644 index 00000000..1109a63f --- /dev/null +++ b/services/metalv1/docs/IPAddressesApi.md @@ -0,0 +1,527 @@ +# \IPAddressesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteIPAddress**](IPAddressesApi.md#DeleteIPAddress) | **Delete** /ips/{id} | Unassign an ip address +[**FindIPAddressById**](IPAddressesApi.md#FindIPAddressById) | **Get** /ips/{id} | Retrieve an ip address +[**FindIPAddressCustomdata**](IPAddressesApi.md#FindIPAddressCustomdata) | **Get** /ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation or IP Assignment +[**FindIPAvailabilities**](IPAddressesApi.md#FindIPAvailabilities) | **Get** /ips/{id}/available | Retrieve all available subnets of a particular reservation +[**FindIPReservations**](IPAddressesApi.md#FindIPReservations) | **Get** /projects/{id}/ips | Retrieve all ip reservations +[**RequestIPReservation**](IPAddressesApi.md#RequestIPReservation) | **Post** /projects/{id}/ips | Requesting IP reservations +[**UpdateIPAddress**](IPAddressesApi.md#UpdateIPAddress) | **Patch** /ips/{id} | Update an ip address + + + +## DeleteIPAddress + +> DeleteIPAddress(ctx, id).Execute() + +Unassign an ip address + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | IP Address UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.IPAddressesApi.DeleteIPAddress(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.DeleteIPAddress``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | IP Address UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteIPAddressRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPAddressById + +> FindIPAddressById200Response FindIPAddressById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve an ip address + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | IP Address UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.IPAddressesApi.FindIPAddressById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.FindIPAddressById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindIPAddressById`: FindIPAddressById200Response + fmt.Fprintf(os.Stdout, "Response from `IPAddressesApi.FindIPAddressById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | IP Address UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPAddressByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**FindIPAddressById200Response**](FindIPAddressById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPAddressCustomdata + +> FindIPAddressCustomdata(ctx, id).Execute() + +Retrieve the custom metadata of an IP Reservation or IP Assignment + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Ip Reservation UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.IPAddressesApi.FindIPAddressCustomdata(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.FindIPAddressCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Ip Reservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPAddressCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPAvailabilities + +> IPAvailabilitiesList FindIPAvailabilities(ctx, id).Cidr(cidr).Execute() + +Retrieve all available subnets of a particular reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | IP Reservation UUID + cidr := openapiclient.findIPAvailabilities_cidr_parameter("20") // FindIPAvailabilitiesCidrParameter | Size of subnets in bits + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.IPAddressesApi.FindIPAvailabilities(context.Background(), id).Cidr(cidr).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.FindIPAvailabilities``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindIPAvailabilities`: IPAvailabilitiesList + fmt.Fprintf(os.Stdout, "Response from `IPAddressesApi.FindIPAvailabilities`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | IP Reservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPAvailabilitiesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **cidr** | [**FindIPAvailabilitiesCidrParameter**](FindIPAvailabilitiesCidrParameter.md) | Size of subnets in bits | + +### Return type + +[**IPAvailabilitiesList**](IPAvailabilitiesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPReservations + +> IPReservationList FindIPReservations(ctx, id).Types(types).Include(include).Exclude(exclude).PerPage(perPage).Execute() + +Retrieve all ip reservations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + types := []openapiclient.FindIPReservationsTypesParameterInner{openapiclient.findIPReservations_types_parameter_inner("global_ipv4")} // []FindIPReservationsTypesParameterInner | Filter project IP reservations by reservation type (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 250) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.IPAddressesApi.FindIPReservations(context.Background(), id).Types(types).Include(include).Exclude(exclude).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.FindIPReservations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindIPReservations`: IPReservationList + fmt.Fprintf(os.Stdout, "Response from `IPAddressesApi.FindIPReservations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPReservationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **types** | [**[]FindIPReservationsTypesParameterInner**](FindIPReservationsTypesParameterInner.md) | Filter project IP reservations by reservation type | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **perPage** | **int32** | Items returned per page | [default to 250] + +### Return type + +[**IPReservationList**](IPReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RequestIPReservation + +> RequestIPReservation201Response RequestIPReservation(ctx, id).RequestIPReservationRequest(requestIPReservationRequest).Include(include).Exclude(exclude).Execute() + +Requesting IP reservations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + requestIPReservationRequest := openapiclient.requestIPReservation_request{IPReservationRequestInput: openapiclient.NewIPReservationRequestInput(int32(123), "Type_example")} // RequestIPReservationRequest | IP Reservation Request to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.IPAddressesApi.RequestIPReservation(context.Background(), id).RequestIPReservationRequest(requestIPReservationRequest).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.RequestIPReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RequestIPReservation`: RequestIPReservation201Response + fmt.Fprintf(os.Stdout, "Response from `IPAddressesApi.RequestIPReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestIPReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **requestIPReservationRequest** | [**RequestIPReservationRequest**](RequestIPReservationRequest.md) | IP Reservation Request to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**RequestIPReservation201Response**](RequestIPReservation201Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateIPAddress + +> FindIPAddressById200Response UpdateIPAddress(ctx, id).Include(include).Exclude(exclude).IPAssignmentUpdateInput(iPAssignmentUpdateInput).Execute() + +Update an ip address + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | IP Address UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + iPAssignmentUpdateInput := *openapiclient.NewIPAssignmentUpdateInput() // IPAssignmentUpdateInput | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.IPAddressesApi.UpdateIPAddress(context.Background(), id).Include(include).Exclude(exclude).IPAssignmentUpdateInput(iPAssignmentUpdateInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IPAddressesApi.UpdateIPAddress``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateIPAddress`: FindIPAddressById200Response + fmt.Fprintf(os.Stdout, "Response from `IPAddressesApi.UpdateIPAddress`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | IP Address UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateIPAddressRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **iPAssignmentUpdateInput** | [**IPAssignmentUpdateInput**](IPAssignmentUpdateInput.md) | | + +### Return type + +[**FindIPAddressById200Response**](FindIPAddressById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/IPAssignment.md b/services/metalv1/docs/IPAssignment.md new file mode 100644 index 00000000..d0d49768 --- /dev/null +++ b/services/metalv1/docs/IPAssignment.md @@ -0,0 +1,550 @@ +# IPAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to **string** | | [optional] +**AddressFamily** | Pointer to **int32** | | [optional] +**AssignedTo** | Pointer to [**Href**](Href.md) | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**GlobalIp** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**Metro** | Pointer to [**IPAssignmentMetro**](IPAssignmentMetro.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**ParentBlock** | Pointer to [**ParentBlock**](ParentBlock.md) | | [optional] +**Public** | Pointer to **bool** | | [optional] +**State** | Pointer to [**IPAssignmentState**](IPAssignmentState.md) | | [optional] +**NextHop** | Pointer to **string** | Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. | [optional] +**Type** | Pointer to [**IPAssignmentType**](IPAssignmentType.md) | | [optional] + +## Methods + +### NewIPAssignment + +`func NewIPAssignment() *IPAssignment` + +NewIPAssignment instantiates a new IPAssignment object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAssignmentWithDefaults + +`func NewIPAssignmentWithDefaults() *IPAssignment` + +NewIPAssignmentWithDefaults instantiates a new IPAssignment object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *IPAssignment) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *IPAssignment) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *IPAssignment) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *IPAssignment) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetAddressFamily + +`func (o *IPAssignment) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *IPAssignment) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *IPAssignment) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *IPAssignment) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetAssignedTo + +`func (o *IPAssignment) GetAssignedTo() Href` + +GetAssignedTo returns the AssignedTo field if non-nil, zero value otherwise. + +### GetAssignedToOk + +`func (o *IPAssignment) GetAssignedToOk() (*Href, bool)` + +GetAssignedToOk returns a tuple with the AssignedTo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignedTo + +`func (o *IPAssignment) SetAssignedTo(v Href)` + +SetAssignedTo sets AssignedTo field to given value. + +### HasAssignedTo + +`func (o *IPAssignment) HasAssignedTo() bool` + +HasAssignedTo returns a boolean if a field has been set. + +### GetCidr + +`func (o *IPAssignment) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *IPAssignment) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *IPAssignment) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *IPAssignment) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *IPAssignment) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *IPAssignment) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *IPAssignment) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *IPAssignment) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetEnabled + +`func (o *IPAssignment) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *IPAssignment) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *IPAssignment) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *IPAssignment) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetGateway + +`func (o *IPAssignment) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *IPAssignment) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *IPAssignment) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *IPAssignment) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetGlobalIp + +`func (o *IPAssignment) GetGlobalIp() bool` + +GetGlobalIp returns the GlobalIp field if non-nil, zero value otherwise. + +### GetGlobalIpOk + +`func (o *IPAssignment) GetGlobalIpOk() (*bool, bool)` + +GetGlobalIpOk returns a tuple with the GlobalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalIp + +`func (o *IPAssignment) SetGlobalIp(v bool)` + +SetGlobalIp sets GlobalIp field to given value. + +### HasGlobalIp + +`func (o *IPAssignment) HasGlobalIp() bool` + +HasGlobalIp returns a boolean if a field has been set. + +### GetHref + +`func (o *IPAssignment) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *IPAssignment) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *IPAssignment) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *IPAssignment) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *IPAssignment) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPAssignment) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPAssignment) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPAssignment) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetManageable + +`func (o *IPAssignment) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *IPAssignment) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *IPAssignment) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *IPAssignment) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetManagement + +`func (o *IPAssignment) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *IPAssignment) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *IPAssignment) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *IPAssignment) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetMetro + +`func (o *IPAssignment) GetMetro() IPAssignmentMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *IPAssignment) GetMetroOk() (*IPAssignmentMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *IPAssignment) SetMetro(v IPAssignmentMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *IPAssignment) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetmask + +`func (o *IPAssignment) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *IPAssignment) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *IPAssignment) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *IPAssignment) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *IPAssignment) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *IPAssignment) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *IPAssignment) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *IPAssignment) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetParentBlock + +`func (o *IPAssignment) GetParentBlock() ParentBlock` + +GetParentBlock returns the ParentBlock field if non-nil, zero value otherwise. + +### GetParentBlockOk + +`func (o *IPAssignment) GetParentBlockOk() (*ParentBlock, bool)` + +GetParentBlockOk returns a tuple with the ParentBlock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParentBlock + +`func (o *IPAssignment) SetParentBlock(v ParentBlock)` + +SetParentBlock sets ParentBlock field to given value. + +### HasParentBlock + +`func (o *IPAssignment) HasParentBlock() bool` + +HasParentBlock returns a boolean if a field has been set. + +### GetPublic + +`func (o *IPAssignment) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *IPAssignment) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *IPAssignment) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *IPAssignment) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetState + +`func (o *IPAssignment) GetState() IPAssignmentState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *IPAssignment) GetStateOk() (*IPAssignmentState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *IPAssignment) SetState(v IPAssignmentState)` + +SetState sets State field to given value. + +### HasState + +`func (o *IPAssignment) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetNextHop + +`func (o *IPAssignment) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *IPAssignment) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *IPAssignment) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + +### HasNextHop + +`func (o *IPAssignment) HasNextHop() bool` + +HasNextHop returns a boolean if a field has been set. + +### GetType + +`func (o *IPAssignment) GetType() IPAssignmentType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *IPAssignment) GetTypeOk() (*IPAssignmentType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *IPAssignment) SetType(v IPAssignmentType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *IPAssignment) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentInput.md b/services/metalv1/docs/IPAssignmentInput.md new file mode 100644 index 00000000..fb680259 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentInput.md @@ -0,0 +1,77 @@ +# IPAssignmentInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | +**Customdata** | Pointer to **map[string]interface{}** | | [optional] + +## Methods + +### NewIPAssignmentInput + +`func NewIPAssignmentInput(address string, ) *IPAssignmentInput` + +NewIPAssignmentInput instantiates a new IPAssignmentInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAssignmentInputWithDefaults + +`func NewIPAssignmentInputWithDefaults() *IPAssignmentInput` + +NewIPAssignmentInputWithDefaults instantiates a new IPAssignmentInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *IPAssignmentInput) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *IPAssignmentInput) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *IPAssignmentInput) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetCustomdata + +`func (o *IPAssignmentInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *IPAssignmentInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *IPAssignmentInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *IPAssignmentInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentList.md b/services/metalv1/docs/IPAssignmentList.md new file mode 100644 index 00000000..98b4cd03 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentList.md @@ -0,0 +1,56 @@ +# IPAssignmentList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpAddresses** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] + +## Methods + +### NewIPAssignmentList + +`func NewIPAssignmentList() *IPAssignmentList` + +NewIPAssignmentList instantiates a new IPAssignmentList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAssignmentListWithDefaults + +`func NewIPAssignmentListWithDefaults() *IPAssignmentList` + +NewIPAssignmentListWithDefaults instantiates a new IPAssignmentList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpAddresses + +`func (o *IPAssignmentList) GetIpAddresses() []IPAssignment` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *IPAssignmentList) GetIpAddressesOk() (*[]IPAssignment, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *IPAssignmentList) SetIpAddresses(v []IPAssignment)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *IPAssignmentList) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentMetro.md b/services/metalv1/docs/IPAssignmentMetro.md new file mode 100644 index 00000000..4f6e3c91 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentMetro.md @@ -0,0 +1,134 @@ +# IPAssignmentMetro + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewIPAssignmentMetro + +`func NewIPAssignmentMetro() *IPAssignmentMetro` + +NewIPAssignmentMetro instantiates a new IPAssignmentMetro object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAssignmentMetroWithDefaults + +`func NewIPAssignmentMetroWithDefaults() *IPAssignmentMetro` + +NewIPAssignmentMetroWithDefaults instantiates a new IPAssignmentMetro object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *IPAssignmentMetro) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *IPAssignmentMetro) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *IPAssignmentMetro) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *IPAssignmentMetro) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *IPAssignmentMetro) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *IPAssignmentMetro) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *IPAssignmentMetro) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *IPAssignmentMetro) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetId + +`func (o *IPAssignmentMetro) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPAssignmentMetro) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPAssignmentMetro) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPAssignmentMetro) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *IPAssignmentMetro) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *IPAssignmentMetro) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *IPAssignmentMetro) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *IPAssignmentMetro) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentState.md b/services/metalv1/docs/IPAssignmentState.md new file mode 100644 index 00000000..b0d3d136 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentState.md @@ -0,0 +1,15 @@ +# IPAssignmentState + +## Enum + + +* `PENDING` (value: `"pending"`) + +* `ACTIVE` (value: `"active"`) + +* `DELETING` (value: `"deleting"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentType.md b/services/metalv1/docs/IPAssignmentType.md new file mode 100644 index 00000000..273b2b64 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentType.md @@ -0,0 +1,11 @@ +# IPAssignmentType + +## Enum + + +* `IP_ASSIGNMENT` (value: `"IPAssignment"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAssignmentUpdateInput.md b/services/metalv1/docs/IPAssignmentUpdateInput.md new file mode 100644 index 00000000..fe56e495 --- /dev/null +++ b/services/metalv1/docs/IPAssignmentUpdateInput.md @@ -0,0 +1,108 @@ +# IPAssignmentUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Details** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewIPAssignmentUpdateInput + +`func NewIPAssignmentUpdateInput() *IPAssignmentUpdateInput` + +NewIPAssignmentUpdateInput instantiates a new IPAssignmentUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAssignmentUpdateInputWithDefaults + +`func NewIPAssignmentUpdateInputWithDefaults() *IPAssignmentUpdateInput` + +NewIPAssignmentUpdateInputWithDefaults instantiates a new IPAssignmentUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDetails + +`func (o *IPAssignmentUpdateInput) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *IPAssignmentUpdateInput) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *IPAssignmentUpdateInput) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *IPAssignmentUpdateInput) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *IPAssignmentUpdateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *IPAssignmentUpdateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *IPAssignmentUpdateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *IPAssignmentUpdateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetTags + +`func (o *IPAssignmentUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *IPAssignmentUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *IPAssignmentUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *IPAssignmentUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPAvailabilitiesList.md b/services/metalv1/docs/IPAvailabilitiesList.md new file mode 100644 index 00000000..fc311bd1 --- /dev/null +++ b/services/metalv1/docs/IPAvailabilitiesList.md @@ -0,0 +1,56 @@ +# IPAvailabilitiesList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Available** | Pointer to **[]string** | | [optional] + +## Methods + +### NewIPAvailabilitiesList + +`func NewIPAvailabilitiesList() *IPAvailabilitiesList` + +NewIPAvailabilitiesList instantiates a new IPAvailabilitiesList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPAvailabilitiesListWithDefaults + +`func NewIPAvailabilitiesListWithDefaults() *IPAvailabilitiesList` + +NewIPAvailabilitiesListWithDefaults instantiates a new IPAvailabilitiesList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvailable + +`func (o *IPAvailabilitiesList) GetAvailable() []string` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *IPAvailabilitiesList) GetAvailableOk() (*[]string, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *IPAvailabilitiesList) SetAvailable(v []string)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *IPAvailabilitiesList) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservation.md b/services/metalv1/docs/IPReservation.md new file mode 100644 index 00000000..9aed26e1 --- /dev/null +++ b/services/metalv1/docs/IPReservation.md @@ -0,0 +1,779 @@ +# IPReservation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addon** | Pointer to **bool** | | [optional] +**Address** | Pointer to **string** | | [optional] +**AddressFamily** | Pointer to **int32** | | [optional] +**Assignments** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] +**Available** | Pointer to **string** | | [optional] +**Bill** | Pointer to **bool** | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**GlobalIp** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**MetalGateway** | Pointer to [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**Metro** | Pointer to [**IPReservationMetro**](IPReservationMetro.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**ProjectLite** | Pointer to [**Href**](Href.md) | | [optional] +**RequestedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Public** | Pointer to **bool** | | [optional] +**State** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**IPReservationType**](IPReservationType.md) | | + +## Methods + +### NewIPReservation + +`func NewIPReservation(type_ IPReservationType, ) *IPReservation` + +NewIPReservation instantiates a new IPReservation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationWithDefaults + +`func NewIPReservationWithDefaults() *IPReservation` + +NewIPReservationWithDefaults instantiates a new IPReservation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddon + +`func (o *IPReservation) GetAddon() bool` + +GetAddon returns the Addon field if non-nil, zero value otherwise. + +### GetAddonOk + +`func (o *IPReservation) GetAddonOk() (*bool, bool)` + +GetAddonOk returns a tuple with the Addon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddon + +`func (o *IPReservation) SetAddon(v bool)` + +SetAddon sets Addon field to given value. + +### HasAddon + +`func (o *IPReservation) HasAddon() bool` + +HasAddon returns a boolean if a field has been set. + +### GetAddress + +`func (o *IPReservation) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *IPReservation) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *IPReservation) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *IPReservation) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetAddressFamily + +`func (o *IPReservation) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *IPReservation) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *IPReservation) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *IPReservation) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetAssignments + +`func (o *IPReservation) GetAssignments() []IPAssignment` + +GetAssignments returns the Assignments field if non-nil, zero value otherwise. + +### GetAssignmentsOk + +`func (o *IPReservation) GetAssignmentsOk() (*[]IPAssignment, bool)` + +GetAssignmentsOk returns a tuple with the Assignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignments + +`func (o *IPReservation) SetAssignments(v []IPAssignment)` + +SetAssignments sets Assignments field to given value. + +### HasAssignments + +`func (o *IPReservation) HasAssignments() bool` + +HasAssignments returns a boolean if a field has been set. + +### GetAvailable + +`func (o *IPReservation) GetAvailable() string` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *IPReservation) GetAvailableOk() (*string, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *IPReservation) SetAvailable(v string)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *IPReservation) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetBill + +`func (o *IPReservation) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *IPReservation) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *IPReservation) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *IPReservation) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetCidr + +`func (o *IPReservation) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *IPReservation) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *IPReservation) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *IPReservation) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *IPReservation) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *IPReservation) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *IPReservation) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *IPReservation) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *IPReservation) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *IPReservation) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *IPReservation) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *IPReservation) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetEnabled + +`func (o *IPReservation) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *IPReservation) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *IPReservation) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *IPReservation) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetDetails + +`func (o *IPReservation) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *IPReservation) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *IPReservation) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *IPReservation) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *IPReservation) GetFacility() IPReservationFacility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *IPReservation) GetFacilityOk() (*IPReservationFacility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *IPReservation) SetFacility(v IPReservationFacility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *IPReservation) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetGateway + +`func (o *IPReservation) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *IPReservation) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *IPReservation) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *IPReservation) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetGlobalIp + +`func (o *IPReservation) GetGlobalIp() bool` + +GetGlobalIp returns the GlobalIp field if non-nil, zero value otherwise. + +### GetGlobalIpOk + +`func (o *IPReservation) GetGlobalIpOk() (*bool, bool)` + +GetGlobalIpOk returns a tuple with the GlobalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalIp + +`func (o *IPReservation) SetGlobalIp(v bool)` + +SetGlobalIp sets GlobalIp field to given value. + +### HasGlobalIp + +`func (o *IPReservation) HasGlobalIp() bool` + +HasGlobalIp returns a boolean if a field has been set. + +### GetHref + +`func (o *IPReservation) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *IPReservation) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *IPReservation) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *IPReservation) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *IPReservation) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPReservation) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPReservation) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPReservation) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetManageable + +`func (o *IPReservation) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *IPReservation) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *IPReservation) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *IPReservation) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetManagement + +`func (o *IPReservation) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *IPReservation) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *IPReservation) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *IPReservation) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *IPReservation) GetMetalGateway() MetalGatewayLite` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *IPReservation) GetMetalGatewayOk() (*MetalGatewayLite, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *IPReservation) SetMetalGateway(v MetalGatewayLite)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *IPReservation) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetMetro + +`func (o *IPReservation) GetMetro() IPReservationMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *IPReservation) GetMetroOk() (*IPReservationMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *IPReservation) SetMetro(v IPReservationMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *IPReservation) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetmask + +`func (o *IPReservation) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *IPReservation) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *IPReservation) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *IPReservation) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *IPReservation) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *IPReservation) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *IPReservation) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *IPReservation) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetProject + +`func (o *IPReservation) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *IPReservation) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *IPReservation) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *IPReservation) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *IPReservation) GetProjectLite() Href` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *IPReservation) GetProjectLiteOk() (*Href, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *IPReservation) SetProjectLite(v Href)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *IPReservation) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetRequestedBy + +`func (o *IPReservation) GetRequestedBy() Href` + +GetRequestedBy returns the RequestedBy field if non-nil, zero value otherwise. + +### GetRequestedByOk + +`func (o *IPReservation) GetRequestedByOk() (*Href, bool)` + +GetRequestedByOk returns a tuple with the RequestedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedBy + +`func (o *IPReservation) SetRequestedBy(v Href)` + +SetRequestedBy sets RequestedBy field to given value. + +### HasRequestedBy + +`func (o *IPReservation) HasRequestedBy() bool` + +HasRequestedBy returns a boolean if a field has been set. + +### GetPublic + +`func (o *IPReservation) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *IPReservation) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *IPReservation) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *IPReservation) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetState + +`func (o *IPReservation) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *IPReservation) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *IPReservation) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *IPReservation) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTags + +`func (o *IPReservation) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *IPReservation) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *IPReservation) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *IPReservation) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *IPReservation) GetType() IPReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *IPReservation) GetTypeOk() (*IPReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *IPReservation) SetType(v IPReservationType)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationFacility.md b/services/metalv1/docs/IPReservationFacility.md new file mode 100644 index 00000000..51dce021 --- /dev/null +++ b/services/metalv1/docs/IPReservationFacility.md @@ -0,0 +1,212 @@ +# IPReservationFacility + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to [**Address**](Address.md) | | [optional] +**Code** | Pointer to **string** | | [optional] +**Features** | Pointer to [**[]FacilityFeaturesInner**](FacilityFeaturesInner.md) | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpRanges** | Pointer to **[]string** | IP ranges registered in facility. Can be used for GeoIP location | [optional] +**Metro** | Pointer to [**DeviceMetro**](DeviceMetro.md) | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewIPReservationFacility + +`func NewIPReservationFacility() *IPReservationFacility` + +NewIPReservationFacility instantiates a new IPReservationFacility object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationFacilityWithDefaults + +`func NewIPReservationFacilityWithDefaults() *IPReservationFacility` + +NewIPReservationFacilityWithDefaults instantiates a new IPReservationFacility object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *IPReservationFacility) GetAddress() Address` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *IPReservationFacility) GetAddressOk() (*Address, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *IPReservationFacility) SetAddress(v Address)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *IPReservationFacility) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetCode + +`func (o *IPReservationFacility) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *IPReservationFacility) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *IPReservationFacility) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *IPReservationFacility) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetFeatures + +`func (o *IPReservationFacility) GetFeatures() []FacilityFeaturesInner` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *IPReservationFacility) GetFeaturesOk() (*[]FacilityFeaturesInner, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *IPReservationFacility) SetFeatures(v []FacilityFeaturesInner)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *IPReservationFacility) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetId + +`func (o *IPReservationFacility) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPReservationFacility) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPReservationFacility) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPReservationFacility) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpRanges + +`func (o *IPReservationFacility) GetIpRanges() []string` + +GetIpRanges returns the IpRanges field if non-nil, zero value otherwise. + +### GetIpRangesOk + +`func (o *IPReservationFacility) GetIpRangesOk() (*[]string, bool)` + +GetIpRangesOk returns a tuple with the IpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpRanges + +`func (o *IPReservationFacility) SetIpRanges(v []string)` + +SetIpRanges sets IpRanges field to given value. + +### HasIpRanges + +`func (o *IPReservationFacility) HasIpRanges() bool` + +HasIpRanges returns a boolean if a field has been set. + +### GetMetro + +`func (o *IPReservationFacility) GetMetro() DeviceMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *IPReservationFacility) GetMetroOk() (*DeviceMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *IPReservationFacility) SetMetro(v DeviceMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *IPReservationFacility) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetName + +`func (o *IPReservationFacility) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *IPReservationFacility) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *IPReservationFacility) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *IPReservationFacility) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationList.md b/services/metalv1/docs/IPReservationList.md new file mode 100644 index 00000000..be10614a --- /dev/null +++ b/services/metalv1/docs/IPReservationList.md @@ -0,0 +1,82 @@ +# IPReservationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpAddresses** | Pointer to [**[]IPReservationListIpAddressesInner**](IPReservationListIpAddressesInner.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewIPReservationList + +`func NewIPReservationList() *IPReservationList` + +NewIPReservationList instantiates a new IPReservationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationListWithDefaults + +`func NewIPReservationListWithDefaults() *IPReservationList` + +NewIPReservationListWithDefaults instantiates a new IPReservationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpAddresses + +`func (o *IPReservationList) GetIpAddresses() []IPReservationListIpAddressesInner` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *IPReservationList) GetIpAddressesOk() (*[]IPReservationListIpAddressesInner, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *IPReservationList) SetIpAddresses(v []IPReservationListIpAddressesInner)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *IPReservationList) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetMeta + +`func (o *IPReservationList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *IPReservationList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *IPReservationList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *IPReservationList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationListIpAddressesInner.md b/services/metalv1/docs/IPReservationListIpAddressesInner.md new file mode 100644 index 00000000..f0ebb1c0 --- /dev/null +++ b/services/metalv1/docs/IPReservationListIpAddressesInner.md @@ -0,0 +1,826 @@ +# IPReservationListIpAddressesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addon** | Pointer to **bool** | | [optional] +**Address** | Pointer to **string** | | [optional] +**AddressFamily** | Pointer to **int32** | | [optional] +**Assignments** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] +**Available** | Pointer to **string** | | [optional] +**Bill** | Pointer to **bool** | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**GlobalIp** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**MetalGateway** | Pointer to [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**ProjectLite** | Pointer to [**Project**](Project.md) | | [optional] +**RequestedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Public** | Pointer to **bool** | | [optional] +**State** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VrfIpReservationType**](VrfIpReservationType.md) | | +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Vrf** | [**Vrf**](Vrf.md) | | + +## Methods + +### NewIPReservationListIpAddressesInner + +`func NewIPReservationListIpAddressesInner(type_ VrfIpReservationType, vrf Vrf, ) *IPReservationListIpAddressesInner` + +NewIPReservationListIpAddressesInner instantiates a new IPReservationListIpAddressesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationListIpAddressesInnerWithDefaults + +`func NewIPReservationListIpAddressesInnerWithDefaults() *IPReservationListIpAddressesInner` + +NewIPReservationListIpAddressesInnerWithDefaults instantiates a new IPReservationListIpAddressesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddon + +`func (o *IPReservationListIpAddressesInner) GetAddon() bool` + +GetAddon returns the Addon field if non-nil, zero value otherwise. + +### GetAddonOk + +`func (o *IPReservationListIpAddressesInner) GetAddonOk() (*bool, bool)` + +GetAddonOk returns a tuple with the Addon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddon + +`func (o *IPReservationListIpAddressesInner) SetAddon(v bool)` + +SetAddon sets Addon field to given value. + +### HasAddon + +`func (o *IPReservationListIpAddressesInner) HasAddon() bool` + +HasAddon returns a boolean if a field has been set. + +### GetAddress + +`func (o *IPReservationListIpAddressesInner) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *IPReservationListIpAddressesInner) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *IPReservationListIpAddressesInner) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *IPReservationListIpAddressesInner) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetAddressFamily + +`func (o *IPReservationListIpAddressesInner) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *IPReservationListIpAddressesInner) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *IPReservationListIpAddressesInner) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *IPReservationListIpAddressesInner) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetAssignments + +`func (o *IPReservationListIpAddressesInner) GetAssignments() []IPAssignment` + +GetAssignments returns the Assignments field if non-nil, zero value otherwise. + +### GetAssignmentsOk + +`func (o *IPReservationListIpAddressesInner) GetAssignmentsOk() (*[]IPAssignment, bool)` + +GetAssignmentsOk returns a tuple with the Assignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignments + +`func (o *IPReservationListIpAddressesInner) SetAssignments(v []IPAssignment)` + +SetAssignments sets Assignments field to given value. + +### HasAssignments + +`func (o *IPReservationListIpAddressesInner) HasAssignments() bool` + +HasAssignments returns a boolean if a field has been set. + +### GetAvailable + +`func (o *IPReservationListIpAddressesInner) GetAvailable() string` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *IPReservationListIpAddressesInner) GetAvailableOk() (*string, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *IPReservationListIpAddressesInner) SetAvailable(v string)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *IPReservationListIpAddressesInner) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetBill + +`func (o *IPReservationListIpAddressesInner) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *IPReservationListIpAddressesInner) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *IPReservationListIpAddressesInner) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *IPReservationListIpAddressesInner) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetCidr + +`func (o *IPReservationListIpAddressesInner) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *IPReservationListIpAddressesInner) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *IPReservationListIpAddressesInner) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *IPReservationListIpAddressesInner) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *IPReservationListIpAddressesInner) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *IPReservationListIpAddressesInner) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *IPReservationListIpAddressesInner) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *IPReservationListIpAddressesInner) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *IPReservationListIpAddressesInner) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *IPReservationListIpAddressesInner) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *IPReservationListIpAddressesInner) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *IPReservationListIpAddressesInner) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetEnabled + +`func (o *IPReservationListIpAddressesInner) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *IPReservationListIpAddressesInner) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *IPReservationListIpAddressesInner) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *IPReservationListIpAddressesInner) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetDetails + +`func (o *IPReservationListIpAddressesInner) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *IPReservationListIpAddressesInner) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *IPReservationListIpAddressesInner) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *IPReservationListIpAddressesInner) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *IPReservationListIpAddressesInner) GetFacility() IPReservationFacility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *IPReservationListIpAddressesInner) GetFacilityOk() (*IPReservationFacility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *IPReservationListIpAddressesInner) SetFacility(v IPReservationFacility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *IPReservationListIpAddressesInner) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetGateway + +`func (o *IPReservationListIpAddressesInner) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *IPReservationListIpAddressesInner) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *IPReservationListIpAddressesInner) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *IPReservationListIpAddressesInner) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetGlobalIp + +`func (o *IPReservationListIpAddressesInner) GetGlobalIp() bool` + +GetGlobalIp returns the GlobalIp field if non-nil, zero value otherwise. + +### GetGlobalIpOk + +`func (o *IPReservationListIpAddressesInner) GetGlobalIpOk() (*bool, bool)` + +GetGlobalIpOk returns a tuple with the GlobalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalIp + +`func (o *IPReservationListIpAddressesInner) SetGlobalIp(v bool)` + +SetGlobalIp sets GlobalIp field to given value. + +### HasGlobalIp + +`func (o *IPReservationListIpAddressesInner) HasGlobalIp() bool` + +HasGlobalIp returns a boolean if a field has been set. + +### GetHref + +`func (o *IPReservationListIpAddressesInner) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *IPReservationListIpAddressesInner) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *IPReservationListIpAddressesInner) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *IPReservationListIpAddressesInner) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *IPReservationListIpAddressesInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPReservationListIpAddressesInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPReservationListIpAddressesInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPReservationListIpAddressesInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetManageable + +`func (o *IPReservationListIpAddressesInner) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *IPReservationListIpAddressesInner) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *IPReservationListIpAddressesInner) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *IPReservationListIpAddressesInner) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetManagement + +`func (o *IPReservationListIpAddressesInner) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *IPReservationListIpAddressesInner) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *IPReservationListIpAddressesInner) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *IPReservationListIpAddressesInner) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *IPReservationListIpAddressesInner) GetMetalGateway() MetalGatewayLite` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *IPReservationListIpAddressesInner) GetMetalGatewayOk() (*MetalGatewayLite, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *IPReservationListIpAddressesInner) SetMetalGateway(v MetalGatewayLite)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *IPReservationListIpAddressesInner) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetMetro + +`func (o *IPReservationListIpAddressesInner) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *IPReservationListIpAddressesInner) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *IPReservationListIpAddressesInner) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *IPReservationListIpAddressesInner) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetmask + +`func (o *IPReservationListIpAddressesInner) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *IPReservationListIpAddressesInner) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *IPReservationListIpAddressesInner) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *IPReservationListIpAddressesInner) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *IPReservationListIpAddressesInner) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *IPReservationListIpAddressesInner) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *IPReservationListIpAddressesInner) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *IPReservationListIpAddressesInner) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetProject + +`func (o *IPReservationListIpAddressesInner) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *IPReservationListIpAddressesInner) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *IPReservationListIpAddressesInner) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *IPReservationListIpAddressesInner) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *IPReservationListIpAddressesInner) GetProjectLite() Project` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *IPReservationListIpAddressesInner) GetProjectLiteOk() (*Project, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *IPReservationListIpAddressesInner) SetProjectLite(v Project)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *IPReservationListIpAddressesInner) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetRequestedBy + +`func (o *IPReservationListIpAddressesInner) GetRequestedBy() Href` + +GetRequestedBy returns the RequestedBy field if non-nil, zero value otherwise. + +### GetRequestedByOk + +`func (o *IPReservationListIpAddressesInner) GetRequestedByOk() (*Href, bool)` + +GetRequestedByOk returns a tuple with the RequestedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedBy + +`func (o *IPReservationListIpAddressesInner) SetRequestedBy(v Href)` + +SetRequestedBy sets RequestedBy field to given value. + +### HasRequestedBy + +`func (o *IPReservationListIpAddressesInner) HasRequestedBy() bool` + +HasRequestedBy returns a boolean if a field has been set. + +### GetPublic + +`func (o *IPReservationListIpAddressesInner) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *IPReservationListIpAddressesInner) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *IPReservationListIpAddressesInner) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *IPReservationListIpAddressesInner) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetState + +`func (o *IPReservationListIpAddressesInner) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *IPReservationListIpAddressesInner) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *IPReservationListIpAddressesInner) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *IPReservationListIpAddressesInner) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTags + +`func (o *IPReservationListIpAddressesInner) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *IPReservationListIpAddressesInner) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *IPReservationListIpAddressesInner) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *IPReservationListIpAddressesInner) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *IPReservationListIpAddressesInner) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *IPReservationListIpAddressesInner) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *IPReservationListIpAddressesInner) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + + +### GetCreatedBy + +`func (o *IPReservationListIpAddressesInner) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *IPReservationListIpAddressesInner) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *IPReservationListIpAddressesInner) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *IPReservationListIpAddressesInner) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetVrf + +`func (o *IPReservationListIpAddressesInner) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *IPReservationListIpAddressesInner) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *IPReservationListIpAddressesInner) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationMetro.md b/services/metalv1/docs/IPReservationMetro.md new file mode 100644 index 00000000..8881c310 --- /dev/null +++ b/services/metalv1/docs/IPReservationMetro.md @@ -0,0 +1,134 @@ +# IPReservationMetro + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewIPReservationMetro + +`func NewIPReservationMetro() *IPReservationMetro` + +NewIPReservationMetro instantiates a new IPReservationMetro object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationMetroWithDefaults + +`func NewIPReservationMetroWithDefaults() *IPReservationMetro` + +NewIPReservationMetroWithDefaults instantiates a new IPReservationMetro object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *IPReservationMetro) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *IPReservationMetro) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *IPReservationMetro) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *IPReservationMetro) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *IPReservationMetro) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *IPReservationMetro) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *IPReservationMetro) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *IPReservationMetro) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetId + +`func (o *IPReservationMetro) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *IPReservationMetro) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *IPReservationMetro) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *IPReservationMetro) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *IPReservationMetro) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *IPReservationMetro) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *IPReservationMetro) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *IPReservationMetro) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationRequestInput.md b/services/metalv1/docs/IPReservationRequestInput.md new file mode 100644 index 00000000..5ddefdd2 --- /dev/null +++ b/services/metalv1/docs/IPReservationRequestInput.md @@ -0,0 +1,254 @@ +# IPReservationRequestInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Comments** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to **string** | | [optional] +**FailOnApprovalRequired** | Pointer to **bool** | | [optional] +**Metro** | Pointer to **string** | The code of the metro you are requesting the IP reservation in. | [optional] +**Quantity** | **int32** | | +**Tags** | Pointer to **[]string** | | [optional] +**Type** | **string** | | + +## Methods + +### NewIPReservationRequestInput + +`func NewIPReservationRequestInput(quantity int32, type_ string, ) *IPReservationRequestInput` + +NewIPReservationRequestInput instantiates a new IPReservationRequestInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewIPReservationRequestInputWithDefaults + +`func NewIPReservationRequestInputWithDefaults() *IPReservationRequestInput` + +NewIPReservationRequestInputWithDefaults instantiates a new IPReservationRequestInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetComments + +`func (o *IPReservationRequestInput) GetComments() string` + +GetComments returns the Comments field if non-nil, zero value otherwise. + +### GetCommentsOk + +`func (o *IPReservationRequestInput) GetCommentsOk() (*string, bool)` + +GetCommentsOk returns a tuple with the Comments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComments + +`func (o *IPReservationRequestInput) SetComments(v string)` + +SetComments sets Comments field to given value. + +### HasComments + +`func (o *IPReservationRequestInput) HasComments() bool` + +HasComments returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *IPReservationRequestInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *IPReservationRequestInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *IPReservationRequestInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *IPReservationRequestInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDetails + +`func (o *IPReservationRequestInput) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *IPReservationRequestInput) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *IPReservationRequestInput) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *IPReservationRequestInput) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *IPReservationRequestInput) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *IPReservationRequestInput) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *IPReservationRequestInput) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *IPReservationRequestInput) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetFailOnApprovalRequired + +`func (o *IPReservationRequestInput) GetFailOnApprovalRequired() bool` + +GetFailOnApprovalRequired returns the FailOnApprovalRequired field if non-nil, zero value otherwise. + +### GetFailOnApprovalRequiredOk + +`func (o *IPReservationRequestInput) GetFailOnApprovalRequiredOk() (*bool, bool)` + +GetFailOnApprovalRequiredOk returns a tuple with the FailOnApprovalRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailOnApprovalRequired + +`func (o *IPReservationRequestInput) SetFailOnApprovalRequired(v bool)` + +SetFailOnApprovalRequired sets FailOnApprovalRequired field to given value. + +### HasFailOnApprovalRequired + +`func (o *IPReservationRequestInput) HasFailOnApprovalRequired() bool` + +HasFailOnApprovalRequired returns a boolean if a field has been set. + +### GetMetro + +`func (o *IPReservationRequestInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *IPReservationRequestInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *IPReservationRequestInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *IPReservationRequestInput) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetQuantity + +`func (o *IPReservationRequestInput) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *IPReservationRequestInput) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *IPReservationRequestInput) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + + +### GetTags + +`func (o *IPReservationRequestInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *IPReservationRequestInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *IPReservationRequestInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *IPReservationRequestInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *IPReservationRequestInput) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *IPReservationRequestInput) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *IPReservationRequestInput) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IPReservationType.md b/services/metalv1/docs/IPReservationType.md new file mode 100644 index 00000000..e56dc48b --- /dev/null +++ b/services/metalv1/docs/IPReservationType.md @@ -0,0 +1,17 @@ +# IPReservationType + +## Enum + + +* `GLOBAL_IPV4` (value: `"global_ipv4"`) + +* `PUBLIC_IPV4` (value: `"public_ipv4"`) + +* `PRIVATE_IPV4` (value: `"private_ipv4"`) + +* `PUBLIC_IPV6` (value: `"public_ipv6"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/IncidentsApi.md b/services/metalv1/docs/IncidentsApi.md new file mode 100644 index 00000000..742bf44c --- /dev/null +++ b/services/metalv1/docs/IncidentsApi.md @@ -0,0 +1,75 @@ +# \IncidentsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindIncidents**](IncidentsApi.md#FindIncidents) | **Get** /incidents | Retrieve the number of incidents + + + +## FindIncidents + +> FindIncidents(ctx).Include(include).Exclude(exclude).Execute() + +Retrieve the number of incidents + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.IncidentsApi.FindIncidents(context.Background()).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `IncidentsApi.FindIncidents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIncidentsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/InstancesBatchCreateInput.md b/services/metalv1/docs/InstancesBatchCreateInput.md new file mode 100644 index 00000000..8c32043b --- /dev/null +++ b/services/metalv1/docs/InstancesBatchCreateInput.md @@ -0,0 +1,56 @@ +# InstancesBatchCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Batches** | Pointer to [**[]InstancesBatchCreateInputBatchesInner**](InstancesBatchCreateInputBatchesInner.md) | | [optional] + +## Methods + +### NewInstancesBatchCreateInput + +`func NewInstancesBatchCreateInput() *InstancesBatchCreateInput` + +NewInstancesBatchCreateInput instantiates a new InstancesBatchCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInstancesBatchCreateInputWithDefaults + +`func NewInstancesBatchCreateInputWithDefaults() *InstancesBatchCreateInput` + +NewInstancesBatchCreateInputWithDefaults instantiates a new InstancesBatchCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBatches + +`func (o *InstancesBatchCreateInput) GetBatches() []InstancesBatchCreateInputBatchesInner` + +GetBatches returns the Batches field if non-nil, zero value otherwise. + +### GetBatchesOk + +`func (o *InstancesBatchCreateInput) GetBatchesOk() (*[]InstancesBatchCreateInputBatchesInner, bool)` + +GetBatchesOk returns a tuple with the Batches field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBatches + +`func (o *InstancesBatchCreateInput) SetBatches(v []InstancesBatchCreateInputBatchesInner)` + +SetBatches sets Batches field to given value. + +### HasBatches + +`func (o *InstancesBatchCreateInput) HasBatches() bool` + +HasBatches returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md b/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md new file mode 100644 index 00000000..0692ae94 --- /dev/null +++ b/services/metalv1/docs/InstancesBatchCreateInputBatchesInner.md @@ -0,0 +1,764 @@ +# InstancesBatchCreateInputBatchesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Hostnames** | Pointer to **[]string** | | [optional] +**Quantity** | Pointer to **int32** | The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. | [optional] +**Metro** | **string** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | +**AlwaysPxe** | Pointer to **bool** | When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. | [optional] [default to false] +**BillingCycle** | Pointer to [**DeviceCreateInputBillingCycle**](DeviceCreateInputBillingCycle.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | Customdata is an arbitrary JSON value that can be accessed via the metadata service. | [optional] [default to {}] +**Description** | Pointer to **string** | Any description of the device or how it will be used. This may be used to inform other API consumers with project access. | [optional] +**Features** | Pointer to **[]string** | The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. | [optional] +**HardwareReservationId** | Pointer to **string** | The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. | [optional] [default to ""] +**Hostname** | Pointer to **string** | The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. | [optional] +**IpAddresses** | Pointer to [**[]IPAddress**](IPAddress.md) | The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. | [optional] [default to [{address_family=4, public=true}, {address_family=4, public=false}, {address_family=6, public=true}]] +**IpxeScriptUrl** | Pointer to **string** | When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] [default to false] +**NetworkFrozen** | Pointer to **bool** | If true, this instance can not be converted to a different network type. | [optional] +**NoSshKeys** | Pointer to **bool** | Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified | [optional] [default to false] +**OperatingSystem** | **string** | The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. | +**Plan** | **string** | The slug of the device plan to provision. | +**PrivateIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. | [optional] [default to 28] +**ProjectSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. | [optional] [default to 31] +**SpotInstance** | Pointer to **bool** | Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. | [optional] +**SpotPriceMax** | Pointer to **float32** | The maximum amount to bid for a spot instance. | [optional] +**SshKeys** | Pointer to [**[]SSHKeyInput**](SSHKeyInput.md) | A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. | [optional] +**Storage** | Pointer to [**Storage**](Storage.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. | [optional] +**UserSshKeys** | Pointer to **[]string** | A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. | [optional] +**Userdata** | Pointer to **string** | The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. | [optional] +**Facility** | **[]string** | The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. | + +## Methods + +### NewInstancesBatchCreateInputBatchesInner + +`func NewInstancesBatchCreateInputBatchesInner(metro string, operatingSystem string, plan string, facility []string, ) *InstancesBatchCreateInputBatchesInner` + +NewInstancesBatchCreateInputBatchesInner instantiates a new InstancesBatchCreateInputBatchesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInstancesBatchCreateInputBatchesInnerWithDefaults + +`func NewInstancesBatchCreateInputBatchesInnerWithDefaults() *InstancesBatchCreateInputBatchesInner` + +NewInstancesBatchCreateInputBatchesInnerWithDefaults instantiates a new InstancesBatchCreateInputBatchesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHostnames + +`func (o *InstancesBatchCreateInputBatchesInner) GetHostnames() []string` + +GetHostnames returns the Hostnames field if non-nil, zero value otherwise. + +### GetHostnamesOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetHostnamesOk() (*[]string, bool)` + +GetHostnamesOk returns a tuple with the Hostnames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostnames + +`func (o *InstancesBatchCreateInputBatchesInner) SetHostnames(v []string)` + +SetHostnames sets Hostnames field to given value. + +### HasHostnames + +`func (o *InstancesBatchCreateInputBatchesInner) HasHostnames() bool` + +HasHostnames returns a boolean if a field has been set. + +### GetQuantity + +`func (o *InstancesBatchCreateInputBatchesInner) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *InstancesBatchCreateInputBatchesInner) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *InstancesBatchCreateInputBatchesInner) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetMetro + +`func (o *InstancesBatchCreateInputBatchesInner) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *InstancesBatchCreateInputBatchesInner) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetAlwaysPxe + +`func (o *InstancesBatchCreateInputBatchesInner) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *InstancesBatchCreateInputBatchesInner) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *InstancesBatchCreateInputBatchesInner) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *InstancesBatchCreateInputBatchesInner) GetBillingCycle() DeviceCreateInputBillingCycle` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *InstancesBatchCreateInputBatchesInner) SetBillingCycle(v DeviceCreateInputBillingCycle)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *InstancesBatchCreateInputBatchesInner) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *InstancesBatchCreateInputBatchesInner) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *InstancesBatchCreateInputBatchesInner) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *InstancesBatchCreateInputBatchesInner) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *InstancesBatchCreateInputBatchesInner) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *InstancesBatchCreateInputBatchesInner) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *InstancesBatchCreateInputBatchesInner) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *InstancesBatchCreateInputBatchesInner) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *InstancesBatchCreateInputBatchesInner) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *InstancesBatchCreateInputBatchesInner) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHardwareReservationId + +`func (o *InstancesBatchCreateInputBatchesInner) GetHardwareReservationId() string` + +GetHardwareReservationId returns the HardwareReservationId field if non-nil, zero value otherwise. + +### GetHardwareReservationIdOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetHardwareReservationIdOk() (*string, bool)` + +GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHardwareReservationId + +`func (o *InstancesBatchCreateInputBatchesInner) SetHardwareReservationId(v string)` + +SetHardwareReservationId sets HardwareReservationId field to given value. + +### HasHardwareReservationId + +`func (o *InstancesBatchCreateInputBatchesInner) HasHardwareReservationId() bool` + +HasHardwareReservationId returns a boolean if a field has been set. + +### GetHostname + +`func (o *InstancesBatchCreateInputBatchesInner) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *InstancesBatchCreateInputBatchesInner) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *InstancesBatchCreateInputBatchesInner) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetIpAddresses + +`func (o *InstancesBatchCreateInputBatchesInner) GetIpAddresses() []IPAddress` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetIpAddressesOk() (*[]IPAddress, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *InstancesBatchCreateInputBatchesInner) SetIpAddresses(v []IPAddress)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *InstancesBatchCreateInputBatchesInner) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + +### GetIpxeScriptUrl + +`func (o *InstancesBatchCreateInputBatchesInner) GetIpxeScriptUrl() string` + +GetIpxeScriptUrl returns the IpxeScriptUrl field if non-nil, zero value otherwise. + +### GetIpxeScriptUrlOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetIpxeScriptUrlOk() (*string, bool)` + +GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpxeScriptUrl + +`func (o *InstancesBatchCreateInputBatchesInner) SetIpxeScriptUrl(v string)` + +SetIpxeScriptUrl sets IpxeScriptUrl field to given value. + +### HasIpxeScriptUrl + +`func (o *InstancesBatchCreateInputBatchesInner) HasIpxeScriptUrl() bool` + +HasIpxeScriptUrl returns a boolean if a field has been set. + +### GetLocked + +`func (o *InstancesBatchCreateInputBatchesInner) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *InstancesBatchCreateInputBatchesInner) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *InstancesBatchCreateInputBatchesInner) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNetworkFrozen + +`func (o *InstancesBatchCreateInputBatchesInner) GetNetworkFrozen() bool` + +GetNetworkFrozen returns the NetworkFrozen field if non-nil, zero value otherwise. + +### GetNetworkFrozenOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetNetworkFrozenOk() (*bool, bool)` + +GetNetworkFrozenOk returns a tuple with the NetworkFrozen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkFrozen + +`func (o *InstancesBatchCreateInputBatchesInner) SetNetworkFrozen(v bool)` + +SetNetworkFrozen sets NetworkFrozen field to given value. + +### HasNetworkFrozen + +`func (o *InstancesBatchCreateInputBatchesInner) HasNetworkFrozen() bool` + +HasNetworkFrozen returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *InstancesBatchCreateInputBatchesInner) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *InstancesBatchCreateInputBatchesInner) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + + +### GetPlan + +`func (o *InstancesBatchCreateInputBatchesInner) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *InstancesBatchCreateInputBatchesInner) SetPlan(v string)` + +SetPlan sets Plan field to given value. + + +### GetPrivateIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *InstancesBatchCreateInputBatchesInner) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetSpotInstance + +`func (o *InstancesBatchCreateInputBatchesInner) GetSpotInstance() bool` + +GetSpotInstance returns the SpotInstance field if non-nil, zero value otherwise. + +### GetSpotInstanceOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetSpotInstanceOk() (*bool, bool)` + +GetSpotInstanceOk returns a tuple with the SpotInstance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotInstance + +`func (o *InstancesBatchCreateInputBatchesInner) SetSpotInstance(v bool)` + +SetSpotInstance sets SpotInstance field to given value. + +### HasSpotInstance + +`func (o *InstancesBatchCreateInputBatchesInner) HasSpotInstance() bool` + +HasSpotInstance returns a boolean if a field has been set. + +### GetSpotPriceMax + +`func (o *InstancesBatchCreateInputBatchesInner) GetSpotPriceMax() float32` + +GetSpotPriceMax returns the SpotPriceMax field if non-nil, zero value otherwise. + +### GetSpotPriceMaxOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetSpotPriceMaxOk() (*float32, bool)` + +GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotPriceMax + +`func (o *InstancesBatchCreateInputBatchesInner) SetSpotPriceMax(v float32)` + +SetSpotPriceMax sets SpotPriceMax field to given value. + +### HasSpotPriceMax + +`func (o *InstancesBatchCreateInputBatchesInner) HasSpotPriceMax() bool` + +HasSpotPriceMax returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) GetSshKeys() []SSHKeyInput` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetSshKeysOk() (*[]SSHKeyInput, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) SetSshKeys(v []SSHKeyInput)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetStorage + +`func (o *InstancesBatchCreateInputBatchesInner) GetStorage() Storage` + +GetStorage returns the Storage field if non-nil, zero value otherwise. + +### GetStorageOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetStorageOk() (*Storage, bool)` + +GetStorageOk returns a tuple with the Storage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStorage + +`func (o *InstancesBatchCreateInputBatchesInner) SetStorage(v Storage)` + +SetStorage sets Storage field to given value. + +### HasStorage + +`func (o *InstancesBatchCreateInputBatchesInner) HasStorage() bool` + +HasStorage returns a boolean if a field has been set. + +### GetTags + +`func (o *InstancesBatchCreateInputBatchesInner) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *InstancesBatchCreateInputBatchesInner) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *InstancesBatchCreateInputBatchesInner) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *InstancesBatchCreateInputBatchesInner) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *InstancesBatchCreateInputBatchesInner) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *InstancesBatchCreateInputBatchesInner) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *InstancesBatchCreateInputBatchesInner) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *InstancesBatchCreateInputBatchesInner) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *InstancesBatchCreateInputBatchesInner) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *InstancesBatchCreateInputBatchesInner) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + +### GetFacility + +`func (o *InstancesBatchCreateInputBatchesInner) GetFacility() []string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *InstancesBatchCreateInputBatchesInner) GetFacilityOk() (*[]string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *InstancesBatchCreateInputBatchesInner) SetFacility(v []string)` + +SetFacility sets Facility field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Interconnection.md b/services/metalv1/docs/Interconnection.md new file mode 100644 index 00000000..21328c43 --- /dev/null +++ b/services/metalv1/docs/Interconnection.md @@ -0,0 +1,524 @@ +# Interconnection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactEmail** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**Href**](Href.md) | | [optional] +**Id** | Pointer to **string** | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] +**Mode** | Pointer to [**InterconnectionMode**](InterconnectionMode.md) | | [optional] +**Name** | Pointer to **string** | | [optional] +**Organization** | Pointer to [**Href**](Href.md) | | [optional] +**Ports** | Pointer to [**[]InterconnectionPort**](InterconnectionPort.md) | For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). | [optional] +**Redundancy** | Pointer to [**InterconnectionRedundancy**](InterconnectionRedundancy.md) | | [optional] +**ServiceTokens** | Pointer to [**[]FabricServiceToken**](FabricServiceToken.md) | For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. | [optional] +**Speed** | Pointer to **int32** | For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). | [optional] +**Status** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Token** | Pointer to **string** | This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. | [optional] +**Type** | Pointer to [**InterconnectionType**](InterconnectionType.md) | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**RequestedBy** | Pointer to [**Href**](Href.md) | | [optional] + +## Methods + +### NewInterconnection + +`func NewInterconnection() *Interconnection` + +NewInterconnection instantiates a new Interconnection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterconnectionWithDefaults + +`func NewInterconnectionWithDefaults() *Interconnection` + +NewInterconnectionWithDefaults instantiates a new Interconnection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContactEmail + +`func (o *Interconnection) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *Interconnection) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *Interconnection) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *Interconnection) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *Interconnection) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Interconnection) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Interconnection) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Interconnection) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFacility + +`func (o *Interconnection) GetFacility() Href` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *Interconnection) GetFacilityOk() (*Href, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *Interconnection) SetFacility(v Href)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *Interconnection) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetId + +`func (o *Interconnection) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Interconnection) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Interconnection) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Interconnection) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMetro + +`func (o *Interconnection) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *Interconnection) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *Interconnection) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *Interconnection) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetMode + +`func (o *Interconnection) GetMode() InterconnectionMode` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *Interconnection) GetModeOk() (*InterconnectionMode, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *Interconnection) SetMode(v InterconnectionMode)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *Interconnection) HasMode() bool` + +HasMode returns a boolean if a field has been set. + +### GetName + +`func (o *Interconnection) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Interconnection) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Interconnection) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Interconnection) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOrganization + +`func (o *Interconnection) GetOrganization() Href` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *Interconnection) GetOrganizationOk() (*Href, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *Interconnection) SetOrganization(v Href)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *Interconnection) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetPorts + +`func (o *Interconnection) GetPorts() []InterconnectionPort` + +GetPorts returns the Ports field if non-nil, zero value otherwise. + +### GetPortsOk + +`func (o *Interconnection) GetPortsOk() (*[]InterconnectionPort, bool)` + +GetPortsOk returns a tuple with the Ports field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPorts + +`func (o *Interconnection) SetPorts(v []InterconnectionPort)` + +SetPorts sets Ports field to given value. + +### HasPorts + +`func (o *Interconnection) HasPorts() bool` + +HasPorts returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *Interconnection) GetRedundancy() InterconnectionRedundancy` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *Interconnection) GetRedundancyOk() (*InterconnectionRedundancy, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *Interconnection) SetRedundancy(v InterconnectionRedundancy)` + +SetRedundancy sets Redundancy field to given value. + +### HasRedundancy + +`func (o *Interconnection) HasRedundancy() bool` + +HasRedundancy returns a boolean if a field has been set. + +### GetServiceTokens + +`func (o *Interconnection) GetServiceTokens() []FabricServiceToken` + +GetServiceTokens returns the ServiceTokens field if non-nil, zero value otherwise. + +### GetServiceTokensOk + +`func (o *Interconnection) GetServiceTokensOk() (*[]FabricServiceToken, bool)` + +GetServiceTokensOk returns a tuple with the ServiceTokens field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceTokens + +`func (o *Interconnection) SetServiceTokens(v []FabricServiceToken)` + +SetServiceTokens sets ServiceTokens field to given value. + +### HasServiceTokens + +`func (o *Interconnection) HasServiceTokens() bool` + +HasServiceTokens returns a boolean if a field has been set. + +### GetSpeed + +`func (o *Interconnection) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *Interconnection) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *Interconnection) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *Interconnection) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetStatus + +`func (o *Interconnection) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Interconnection) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Interconnection) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Interconnection) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTags + +`func (o *Interconnection) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Interconnection) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Interconnection) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Interconnection) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetToken + +`func (o *Interconnection) GetToken() string` + +GetToken returns the Token field if non-nil, zero value otherwise. + +### GetTokenOk + +`func (o *Interconnection) GetTokenOk() (*string, bool)` + +GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToken + +`func (o *Interconnection) SetToken(v string)` + +SetToken sets Token field to given value. + +### HasToken + +`func (o *Interconnection) HasToken() bool` + +HasToken returns a boolean if a field has been set. + +### GetType + +`func (o *Interconnection) GetType() InterconnectionType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Interconnection) GetTypeOk() (*InterconnectionType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Interconnection) SetType(v InterconnectionType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Interconnection) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Interconnection) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Interconnection) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Interconnection) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Interconnection) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Interconnection) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Interconnection) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Interconnection) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Interconnection) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetRequestedBy + +`func (o *Interconnection) GetRequestedBy() Href` + +GetRequestedBy returns the RequestedBy field if non-nil, zero value otherwise. + +### GetRequestedByOk + +`func (o *Interconnection) GetRequestedByOk() (*Href, bool)` + +GetRequestedByOk returns a tuple with the RequestedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedBy + +`func (o *Interconnection) SetRequestedBy(v Href)` + +SetRequestedBy sets RequestedBy field to given value. + +### HasRequestedBy + +`func (o *Interconnection) HasRequestedBy() bool` + +HasRequestedBy returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionList.md b/services/metalv1/docs/InterconnectionList.md new file mode 100644 index 00000000..ed148379 --- /dev/null +++ b/services/metalv1/docs/InterconnectionList.md @@ -0,0 +1,82 @@ +# InterconnectionList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Interconnections** | Pointer to [**[]Interconnection**](Interconnection.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewInterconnectionList + +`func NewInterconnectionList() *InterconnectionList` + +NewInterconnectionList instantiates a new InterconnectionList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterconnectionListWithDefaults + +`func NewInterconnectionListWithDefaults() *InterconnectionList` + +NewInterconnectionListWithDefaults instantiates a new InterconnectionList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInterconnections + +`func (o *InterconnectionList) GetInterconnections() []Interconnection` + +GetInterconnections returns the Interconnections field if non-nil, zero value otherwise. + +### GetInterconnectionsOk + +`func (o *InterconnectionList) GetInterconnectionsOk() (*[]Interconnection, bool)` + +GetInterconnectionsOk returns a tuple with the Interconnections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInterconnections + +`func (o *InterconnectionList) SetInterconnections(v []Interconnection)` + +SetInterconnections sets Interconnections field to given value. + +### HasInterconnections + +`func (o *InterconnectionList) HasInterconnections() bool` + +HasInterconnections returns a boolean if a field has been set. + +### GetMeta + +`func (o *InterconnectionList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *InterconnectionList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *InterconnectionList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *InterconnectionList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionMode.md b/services/metalv1/docs/InterconnectionMode.md new file mode 100644 index 00000000..786f8c11 --- /dev/null +++ b/services/metalv1/docs/InterconnectionMode.md @@ -0,0 +1,13 @@ +# InterconnectionMode + +## Enum + + +* `STANDARD` (value: `"standard"`) + +* `TUNNEL` (value: `"tunnel"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionPort.md b/services/metalv1/docs/InterconnectionPort.md new file mode 100644 index 00000000..eb21fca7 --- /dev/null +++ b/services/metalv1/docs/InterconnectionPort.md @@ -0,0 +1,290 @@ +# InterconnectionPort + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Organization** | Pointer to [**Href**](Href.md) | | [optional] +**Role** | Pointer to [**InterconnectionPortRole**](InterconnectionPortRole.md) | | [optional] +**Status** | Pointer to [**InterconnectionPortStatus**](InterconnectionPortStatus.md) | | [optional] +**SwitchId** | Pointer to **string** | A switch 'short ID' | [optional] +**VirtualCircuits** | Pointer to [**[]VirtualCircuit**](VirtualCircuit.md) | | [optional] +**Name** | Pointer to **string** | | [optional] +**Speed** | Pointer to **int32** | | [optional] +**LinkStatus** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] + +## Methods + +### NewInterconnectionPort + +`func NewInterconnectionPort() *InterconnectionPort` + +NewInterconnectionPort instantiates a new InterconnectionPort object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterconnectionPortWithDefaults + +`func NewInterconnectionPortWithDefaults() *InterconnectionPort` + +NewInterconnectionPortWithDefaults instantiates a new InterconnectionPort object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *InterconnectionPort) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *InterconnectionPort) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *InterconnectionPort) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *InterconnectionPort) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetOrganization + +`func (o *InterconnectionPort) GetOrganization() Href` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *InterconnectionPort) GetOrganizationOk() (*Href, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *InterconnectionPort) SetOrganization(v Href)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *InterconnectionPort) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetRole + +`func (o *InterconnectionPort) GetRole() InterconnectionPortRole` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *InterconnectionPort) GetRoleOk() (*InterconnectionPortRole, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *InterconnectionPort) SetRole(v InterconnectionPortRole)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *InterconnectionPort) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetStatus + +`func (o *InterconnectionPort) GetStatus() InterconnectionPortStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InterconnectionPort) GetStatusOk() (*InterconnectionPortStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InterconnectionPort) SetStatus(v InterconnectionPortStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *InterconnectionPort) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetSwitchId + +`func (o *InterconnectionPort) GetSwitchId() string` + +GetSwitchId returns the SwitchId field if non-nil, zero value otherwise. + +### GetSwitchIdOk + +`func (o *InterconnectionPort) GetSwitchIdOk() (*string, bool)` + +GetSwitchIdOk returns a tuple with the SwitchId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSwitchId + +`func (o *InterconnectionPort) SetSwitchId(v string)` + +SetSwitchId sets SwitchId field to given value. + +### HasSwitchId + +`func (o *InterconnectionPort) HasSwitchId() bool` + +HasSwitchId returns a boolean if a field has been set. + +### GetVirtualCircuits + +`func (o *InterconnectionPort) GetVirtualCircuits() []VirtualCircuit` + +GetVirtualCircuits returns the VirtualCircuits field if non-nil, zero value otherwise. + +### GetVirtualCircuitsOk + +`func (o *InterconnectionPort) GetVirtualCircuitsOk() (*[]VirtualCircuit, bool)` + +GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualCircuits + +`func (o *InterconnectionPort) SetVirtualCircuits(v []VirtualCircuit)` + +SetVirtualCircuits sets VirtualCircuits field to given value. + +### HasVirtualCircuits + +`func (o *InterconnectionPort) HasVirtualCircuits() bool` + +HasVirtualCircuits returns a boolean if a field has been set. + +### GetName + +`func (o *InterconnectionPort) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InterconnectionPort) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InterconnectionPort) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InterconnectionPort) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetSpeed + +`func (o *InterconnectionPort) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *InterconnectionPort) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *InterconnectionPort) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *InterconnectionPort) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetLinkStatus + +`func (o *InterconnectionPort) GetLinkStatus() string` + +GetLinkStatus returns the LinkStatus field if non-nil, zero value otherwise. + +### GetLinkStatusOk + +`func (o *InterconnectionPort) GetLinkStatusOk() (*string, bool)` + +GetLinkStatusOk returns a tuple with the LinkStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinkStatus + +`func (o *InterconnectionPort) SetLinkStatus(v string)` + +SetLinkStatus sets LinkStatus field to given value. + +### HasLinkStatus + +`func (o *InterconnectionPort) HasLinkStatus() bool` + +HasLinkStatus returns a boolean if a field has been set. + +### GetHref + +`func (o *InterconnectionPort) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *InterconnectionPort) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *InterconnectionPort) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *InterconnectionPort) HasHref() bool` + +HasHref returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionPortList.md b/services/metalv1/docs/InterconnectionPortList.md new file mode 100644 index 00000000..1086821c --- /dev/null +++ b/services/metalv1/docs/InterconnectionPortList.md @@ -0,0 +1,56 @@ +# InterconnectionPortList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ports** | Pointer to [**[]InterconnectionPort**](InterconnectionPort.md) | | [optional] + +## Methods + +### NewInterconnectionPortList + +`func NewInterconnectionPortList() *InterconnectionPortList` + +NewInterconnectionPortList instantiates a new InterconnectionPortList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterconnectionPortListWithDefaults + +`func NewInterconnectionPortListWithDefaults() *InterconnectionPortList` + +NewInterconnectionPortListWithDefaults instantiates a new InterconnectionPortList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPorts + +`func (o *InterconnectionPortList) GetPorts() []InterconnectionPort` + +GetPorts returns the Ports field if non-nil, zero value otherwise. + +### GetPortsOk + +`func (o *InterconnectionPortList) GetPortsOk() (*[]InterconnectionPort, bool)` + +GetPortsOk returns a tuple with the Ports field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPorts + +`func (o *InterconnectionPortList) SetPorts(v []InterconnectionPort)` + +SetPorts sets Ports field to given value. + +### HasPorts + +`func (o *InterconnectionPortList) HasPorts() bool` + +HasPorts returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionPortRole.md b/services/metalv1/docs/InterconnectionPortRole.md new file mode 100644 index 00000000..83ef146c --- /dev/null +++ b/services/metalv1/docs/InterconnectionPortRole.md @@ -0,0 +1,13 @@ +# InterconnectionPortRole + +## Enum + + +* `PRIMARY` (value: `"primary"`) + +* `SECONDARY` (value: `"secondary"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionPortStatus.md b/services/metalv1/docs/InterconnectionPortStatus.md new file mode 100644 index 00000000..2af274c3 --- /dev/null +++ b/services/metalv1/docs/InterconnectionPortStatus.md @@ -0,0 +1,19 @@ +# InterconnectionPortStatus + +## Enum + + +* `REQUESTED` (value: `"requested"`) + +* `ACTIVE` (value: `"active"`) + +* `DELETING` (value: `"deleting"`) + +* `EXPIRED` (value: `"expired"`) + +* `DELETE_FAILED` (value: `"delete_failed"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionRedundancy.md b/services/metalv1/docs/InterconnectionRedundancy.md new file mode 100644 index 00000000..592bcb20 --- /dev/null +++ b/services/metalv1/docs/InterconnectionRedundancy.md @@ -0,0 +1,13 @@ +# InterconnectionRedundancy + +## Enum + + +* `PRIMARY` (value: `"primary"`) + +* `REDUNDANT` (value: `"redundant"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionType.md b/services/metalv1/docs/InterconnectionType.md new file mode 100644 index 00000000..e7e7c59e --- /dev/null +++ b/services/metalv1/docs/InterconnectionType.md @@ -0,0 +1,13 @@ +# InterconnectionType + +## Enum + + +* `SHARED` (value: `"shared"`) + +* `DEDICATED` (value: `"dedicated"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionUpdateInput.md b/services/metalv1/docs/InterconnectionUpdateInput.md new file mode 100644 index 00000000..8c1a59b0 --- /dev/null +++ b/services/metalv1/docs/InterconnectionUpdateInput.md @@ -0,0 +1,186 @@ +# InterconnectionUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactEmail** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Mode** | Pointer to [**InterconnectionMode**](InterconnectionMode.md) | | [optional] +**Name** | Pointer to **string** | | [optional] +**Redundancy** | Pointer to **string** | Updating from 'redundant' to 'primary' will remove a secondary port, while updating from 'primary' to 'redundant' will add one. | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewInterconnectionUpdateInput + +`func NewInterconnectionUpdateInput() *InterconnectionUpdateInput` + +NewInterconnectionUpdateInput instantiates a new InterconnectionUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInterconnectionUpdateInputWithDefaults + +`func NewInterconnectionUpdateInputWithDefaults() *InterconnectionUpdateInput` + +NewInterconnectionUpdateInputWithDefaults instantiates a new InterconnectionUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContactEmail + +`func (o *InterconnectionUpdateInput) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *InterconnectionUpdateInput) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *InterconnectionUpdateInput) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *InterconnectionUpdateInput) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *InterconnectionUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *InterconnectionUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *InterconnectionUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *InterconnectionUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMode + +`func (o *InterconnectionUpdateInput) GetMode() InterconnectionMode` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *InterconnectionUpdateInput) GetModeOk() (*InterconnectionMode, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *InterconnectionUpdateInput) SetMode(v InterconnectionMode)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *InterconnectionUpdateInput) HasMode() bool` + +HasMode returns a boolean if a field has been set. + +### GetName + +`func (o *InterconnectionUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InterconnectionUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InterconnectionUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *InterconnectionUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *InterconnectionUpdateInput) GetRedundancy() string` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *InterconnectionUpdateInput) GetRedundancyOk() (*string, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *InterconnectionUpdateInput) SetRedundancy(v string)` + +SetRedundancy sets Redundancy field to given value. + +### HasRedundancy + +`func (o *InterconnectionUpdateInput) HasRedundancy() bool` + +HasRedundancy returns a boolean if a field has been set. + +### GetTags + +`func (o *InterconnectionUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *InterconnectionUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *InterconnectionUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *InterconnectionUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InterconnectionsApi.md b/services/metalv1/docs/InterconnectionsApi.md new file mode 100644 index 00000000..066c780e --- /dev/null +++ b/services/metalv1/docs/InterconnectionsApi.md @@ -0,0 +1,1145 @@ +# \InterconnectionsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateInterconnectionPortVirtualCircuit**](InterconnectionsApi.md#CreateInterconnectionPortVirtualCircuit) | **Post** /connections/{connection_id}/ports/{port_id}/virtual-circuits | Create a new Virtual Circuit +[**CreateOrganizationInterconnection**](InterconnectionsApi.md#CreateOrganizationInterconnection) | **Post** /organizations/{organization_id}/connections | Request a new interconnection for the organization +[**CreateProjectInterconnection**](InterconnectionsApi.md#CreateProjectInterconnection) | **Post** /projects/{project_id}/connections | Request a new interconnection for the project's organization +[**DeleteInterconnection**](InterconnectionsApi.md#DeleteInterconnection) | **Delete** /connections/{connection_id} | Delete interconnection +[**DeleteVirtualCircuit**](InterconnectionsApi.md#DeleteVirtualCircuit) | **Delete** /virtual-circuits/{id} | Delete a virtual circuit +[**GetInterconnection**](InterconnectionsApi.md#GetInterconnection) | **Get** /connections/{connection_id} | Get interconnection +[**GetInterconnectionPort**](InterconnectionsApi.md#GetInterconnectionPort) | **Get** /connections/{connection_id}/ports/{id} | Get a interconnection port +[**GetVirtualCircuit**](InterconnectionsApi.md#GetVirtualCircuit) | **Get** /virtual-circuits/{id} | Get a virtual circuit +[**ListInterconnectionPortVirtualCircuits**](InterconnectionsApi.md#ListInterconnectionPortVirtualCircuits) | **Get** /connections/{connection_id}/ports/{port_id}/virtual-circuits | List a interconnection port's virtual circuits +[**ListInterconnectionPorts**](InterconnectionsApi.md#ListInterconnectionPorts) | **Get** /connections/{connection_id}/ports | List a interconnection's ports +[**ListInterconnectionVirtualCircuits**](InterconnectionsApi.md#ListInterconnectionVirtualCircuits) | **Get** /connections/{connection_id}/virtual-circuits | List a interconnection's virtual circuits +[**OrganizationListInterconnections**](InterconnectionsApi.md#OrganizationListInterconnections) | **Get** /organizations/{organization_id}/connections | List organization connections +[**ProjectListInterconnections**](InterconnectionsApi.md#ProjectListInterconnections) | **Get** /projects/{project_id}/connections | List project connections +[**UpdateInterconnection**](InterconnectionsApi.md#UpdateInterconnection) | **Put** /connections/{connection_id} | Update interconnection +[**UpdateVirtualCircuit**](InterconnectionsApi.md#UpdateVirtualCircuit) | **Put** /virtual-circuits/{id} | Update a virtual circuit + + + +## CreateInterconnectionPortVirtualCircuit + +> VirtualCircuit CreateInterconnectionPortVirtualCircuit(ctx, connectionId, portId).VirtualCircuitCreateInput(virtualCircuitCreateInput).Execute() + +Create a new Virtual Circuit + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection + portId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection port + virtualCircuitCreateInput := openapiclient.VirtualCircuitCreateInput{VlanVirtualCircuitCreateInput: openapiclient.NewVlanVirtualCircuitCreateInput("ProjectId_example")} // VirtualCircuitCreateInput | Virtual Circuit details + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.CreateInterconnectionPortVirtualCircuit(context.Background(), connectionId, portId).VirtualCircuitCreateInput(virtualCircuitCreateInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.CreateInterconnectionPortVirtualCircuit``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateInterconnectionPortVirtualCircuit`: VirtualCircuit + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.CreateInterconnectionPortVirtualCircuit`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | UUID of the interconnection | +**portId** | **string** | UUID of the interconnection port | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateInterconnectionPortVirtualCircuitRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **virtualCircuitCreateInput** | [**VirtualCircuitCreateInput**](VirtualCircuitCreateInput.md) | Virtual Circuit details | + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateOrganizationInterconnection + +> Interconnection CreateOrganizationInterconnection(ctx, organizationId).CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest).Include(include).Exclude(exclude).Execute() + +Request a new interconnection for the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + organizationId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the organization + createOrganizationInterconnectionRequest := openapiclient.createOrganizationInterconnection_request{DedicatedPortCreateInput: openapiclient.NewDedicatedPortCreateInput("Metro_example", "Name_example", "Redundancy_example", openapiclient.DedicatedPortCreateInput_type("dedicated"))} // CreateOrganizationInterconnectionRequest | Dedicated port or shared interconnection (also known as Fabric VC) creation request + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.CreateOrganizationInterconnection(context.Background(), organizationId).CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.CreateOrganizationInterconnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOrganizationInterconnection`: Interconnection + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.CreateOrganizationInterconnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**organizationId** | **string** | UUID of the organization | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateOrganizationInterconnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createOrganizationInterconnectionRequest** | [**CreateOrganizationInterconnectionRequest**](CreateOrganizationInterconnectionRequest.md) | Dedicated port or shared interconnection (also known as Fabric VC) creation request | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectInterconnection + +> Interconnection CreateProjectInterconnection(ctx, projectId).CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest).Include(include).Exclude(exclude).Execute() + +Request a new interconnection for the project's organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the project + createOrganizationInterconnectionRequest := openapiclient.createOrganizationInterconnection_request{DedicatedPortCreateInput: openapiclient.NewDedicatedPortCreateInput("Metro_example", "Name_example", "Redundancy_example", openapiclient.DedicatedPortCreateInput_type("dedicated"))} // CreateOrganizationInterconnectionRequest | Dedicated port or shared interconnection (also known as Fabric VC) creation request + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.CreateProjectInterconnection(context.Background(), projectId).CreateOrganizationInterconnectionRequest(createOrganizationInterconnectionRequest).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.CreateProjectInterconnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateProjectInterconnection`: Interconnection + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.CreateProjectInterconnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | UUID of the project | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectInterconnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createOrganizationInterconnectionRequest** | [**CreateOrganizationInterconnectionRequest**](CreateOrganizationInterconnectionRequest.md) | Dedicated port or shared interconnection (also known as Fabric VC) creation request | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteInterconnection + +> Interconnection DeleteInterconnection(ctx, connectionId).Include(include).Exclude(exclude).Execute() + +Delete interconnection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.DeleteInterconnection(context.Background(), connectionId).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.DeleteInterconnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteInterconnection`: Interconnection + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.DeleteInterconnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | Interconnection UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteInterconnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteVirtualCircuit + +> VirtualCircuit DeleteVirtualCircuit(ctx, id).Include(include).Exclude(exclude).Execute() + +Delete a virtual circuit + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Circuit UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.DeleteVirtualCircuit(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.DeleteVirtualCircuit``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteVirtualCircuit`: VirtualCircuit + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.DeleteVirtualCircuit`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Circuit UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteVirtualCircuitRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInterconnection + +> Interconnection GetInterconnection(ctx, connectionId).Include(include).Exclude(exclude).Execute() + +Get interconnection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.GetInterconnection(context.Background(), connectionId).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.GetInterconnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInterconnection`: Interconnection + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.GetInterconnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | Interconnection UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInterconnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInterconnectionPort + +> InterconnectionPort GetInterconnectionPort(ctx, connectionId, id).Include(include).Exclude(exclude).Execute() + +Get a interconnection port + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.GetInterconnectionPort(context.Background(), connectionId, id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.GetInterconnectionPort``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInterconnectionPort`: InterconnectionPort + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.GetInterconnectionPort`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | UUID of the interconnection | +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInterconnectionPortRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**InterconnectionPort**](InterconnectionPort.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVirtualCircuit + +> VirtualCircuit GetVirtualCircuit(ctx, id).Include(include).Exclude(exclude).Execute() + +Get a virtual circuit + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Circuit UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.GetVirtualCircuit(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.GetVirtualCircuit``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVirtualCircuit`: VirtualCircuit + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.GetVirtualCircuit`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Circuit UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualCircuitRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListInterconnectionPortVirtualCircuits + +> VirtualCircuitList ListInterconnectionPortVirtualCircuits(ctx, connectionId, portId).Include(include).Exclude(exclude).Execute() + +List a interconnection port's virtual circuits + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection + portId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection port + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.ListInterconnectionPortVirtualCircuits(context.Background(), connectionId, portId).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.ListInterconnectionPortVirtualCircuits``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListInterconnectionPortVirtualCircuits`: VirtualCircuitList + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.ListInterconnectionPortVirtualCircuits`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | UUID of the interconnection | +**portId** | **string** | UUID of the interconnection port | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListInterconnectionPortVirtualCircuitsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualCircuitList**](VirtualCircuitList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListInterconnectionPorts + +> InterconnectionPortList ListInterconnectionPorts(ctx, connectionId).Execute() + +List a interconnection's ports + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.ListInterconnectionPorts(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.ListInterconnectionPorts``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListInterconnectionPorts`: InterconnectionPortList + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.ListInterconnectionPorts`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | UUID of the interconnection | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListInterconnectionPortsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InterconnectionPortList**](InterconnectionPortList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListInterconnectionVirtualCircuits + +> VirtualCircuitList ListInterconnectionVirtualCircuits(ctx, connectionId).Execute() + +List a interconnection's virtual circuits + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the interconnection + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.ListInterconnectionVirtualCircuits(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.ListInterconnectionVirtualCircuits``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListInterconnectionVirtualCircuits`: VirtualCircuitList + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.ListInterconnectionVirtualCircuits`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | UUID of the interconnection | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListInterconnectionVirtualCircuitsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**VirtualCircuitList**](VirtualCircuitList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## OrganizationListInterconnections + +> InterconnectionList OrganizationListInterconnections(ctx, organizationId).Include(include).Exclude(exclude).Execute() + +List organization connections + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + organizationId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the organization + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.OrganizationListInterconnections(context.Background(), organizationId).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.OrganizationListInterconnections``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `OrganizationListInterconnections`: InterconnectionList + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.OrganizationListInterconnections`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**organizationId** | **string** | UUID of the organization | + +### Other Parameters + +Other parameters are passed through a pointer to a apiOrganizationListInterconnectionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**InterconnectionList**](InterconnectionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ProjectListInterconnections + +> InterconnectionList ProjectListInterconnections(ctx, projectId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +List project connections + + +ProjectListInterconnections is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the project + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.ProjectListInterconnections(context.Background(), projectId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.ProjectListInterconnections``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ProjectListInterconnections`: InterconnectionList + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.ProjectListInterconnections`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | UUID of the project | + +### Other Parameters + +Other parameters are passed through a pointer to a apiProjectListInterconnectionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**InterconnectionList**](InterconnectionList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateInterconnection + +> Interconnection UpdateInterconnection(ctx, connectionId).InterconnectionUpdateInput(interconnectionUpdateInput).Include(include).Exclude(exclude).Execute() + +Update interconnection + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + connectionId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Interconnection UUID + interconnectionUpdateInput := *openapiclient.NewInterconnectionUpdateInput() // InterconnectionUpdateInput | Updated interconnection details + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.UpdateInterconnection(context.Background(), connectionId).InterconnectionUpdateInput(interconnectionUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.UpdateInterconnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateInterconnection`: Interconnection + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.UpdateInterconnection`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**connectionId** | **string** | Interconnection UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateInterconnectionRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **interconnectionUpdateInput** | [**InterconnectionUpdateInput**](InterconnectionUpdateInput.md) | Updated interconnection details | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Interconnection**](Interconnection.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateVirtualCircuit + +> VirtualCircuit UpdateVirtualCircuit(ctx, id).VirtualCircuitUpdateInput(virtualCircuitUpdateInput).Include(include).Exclude(exclude).Execute() + +Update a virtual circuit + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Circuit UUID + virtualCircuitUpdateInput := openapiclient.VirtualCircuitUpdateInput{VlanVirtualCircuitUpdateInput: openapiclient.NewVlanVirtualCircuitUpdateInput()} // VirtualCircuitUpdateInput | Updated Virtual Circuit details + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InterconnectionsApi.UpdateVirtualCircuit(context.Background(), id).VirtualCircuitUpdateInput(virtualCircuitUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InterconnectionsApi.UpdateVirtualCircuit``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateVirtualCircuit`: VirtualCircuit + fmt.Fprintf(os.Stdout, "Response from `InterconnectionsApi.UpdateVirtualCircuit`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Circuit UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateVirtualCircuitRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **virtualCircuitUpdateInput** | [**VirtualCircuitUpdateInput**](VirtualCircuitUpdateInput.md) | Updated Virtual Circuit details | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualCircuit**](VirtualCircuit.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Invitation.md b/services/metalv1/docs/Invitation.md new file mode 100644 index 00000000..9de553bb --- /dev/null +++ b/services/metalv1/docs/Invitation.md @@ -0,0 +1,316 @@ +# Invitation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Invitation** | Pointer to [**Href**](Href.md) | | [optional] +**InvitedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Invitee** | Pointer to **string** | | [optional] +**Nonce** | Pointer to **string** | | [optional] +**Organization** | Pointer to [**Href**](Href.md) | | [optional] +**Projects** | Pointer to [**[]Href**](Href.md) | | [optional] +**Roles** | Pointer to [**[]InvitationRolesInner**](InvitationRolesInner.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewInvitation + +`func NewInvitation() *Invitation` + +NewInvitation instantiates a new Invitation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvitationWithDefaults + +`func NewInvitationWithDefaults() *Invitation` + +NewInvitationWithDefaults instantiates a new Invitation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *Invitation) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Invitation) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Invitation) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Invitation) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetHref + +`func (o *Invitation) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Invitation) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Invitation) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Invitation) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Invitation) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Invitation) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Invitation) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Invitation) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInvitation + +`func (o *Invitation) GetInvitation() Href` + +GetInvitation returns the Invitation field if non-nil, zero value otherwise. + +### GetInvitationOk + +`func (o *Invitation) GetInvitationOk() (*Href, bool)` + +GetInvitationOk returns a tuple with the Invitation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitation + +`func (o *Invitation) SetInvitation(v Href)` + +SetInvitation sets Invitation field to given value. + +### HasInvitation + +`func (o *Invitation) HasInvitation() bool` + +HasInvitation returns a boolean if a field has been set. + +### GetInvitedBy + +`func (o *Invitation) GetInvitedBy() Href` + +GetInvitedBy returns the InvitedBy field if non-nil, zero value otherwise. + +### GetInvitedByOk + +`func (o *Invitation) GetInvitedByOk() (*Href, bool)` + +GetInvitedByOk returns a tuple with the InvitedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitedBy + +`func (o *Invitation) SetInvitedBy(v Href)` + +SetInvitedBy sets InvitedBy field to given value. + +### HasInvitedBy + +`func (o *Invitation) HasInvitedBy() bool` + +HasInvitedBy returns a boolean if a field has been set. + +### GetInvitee + +`func (o *Invitation) GetInvitee() string` + +GetInvitee returns the Invitee field if non-nil, zero value otherwise. + +### GetInviteeOk + +`func (o *Invitation) GetInviteeOk() (*string, bool)` + +GetInviteeOk returns a tuple with the Invitee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitee + +`func (o *Invitation) SetInvitee(v string)` + +SetInvitee sets Invitee field to given value. + +### HasInvitee + +`func (o *Invitation) HasInvitee() bool` + +HasInvitee returns a boolean if a field has been set. + +### GetNonce + +`func (o *Invitation) GetNonce() string` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *Invitation) GetNonceOk() (*string, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *Invitation) SetNonce(v string)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *Invitation) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + +### GetOrganization + +`func (o *Invitation) GetOrganization() Href` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *Invitation) GetOrganizationOk() (*Href, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *Invitation) SetOrganization(v Href)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *Invitation) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetProjects + +`func (o *Invitation) GetProjects() []Href` + +GetProjects returns the Projects field if non-nil, zero value otherwise. + +### GetProjectsOk + +`func (o *Invitation) GetProjectsOk() (*[]Href, bool)` + +GetProjectsOk returns a tuple with the Projects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjects + +`func (o *Invitation) SetProjects(v []Href)` + +SetProjects sets Projects field to given value. + +### HasProjects + +`func (o *Invitation) HasProjects() bool` + +HasProjects returns a boolean if a field has been set. + +### GetRoles + +`func (o *Invitation) GetRoles() []InvitationRolesInner` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *Invitation) GetRolesOk() (*[]InvitationRolesInner, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *Invitation) SetRoles(v []InvitationRolesInner)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *Invitation) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Invitation) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Invitation) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Invitation) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Invitation) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvitationInput.md b/services/metalv1/docs/InvitationInput.md new file mode 100644 index 00000000..99915779 --- /dev/null +++ b/services/metalv1/docs/InvitationInput.md @@ -0,0 +1,155 @@ +# InvitationInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Invitee** | **string** | | +**Message** | Pointer to **string** | | [optional] +**OrganizationId** | Pointer to **string** | | [optional] +**ProjectsIds** | Pointer to **[]string** | | [optional] +**Roles** | Pointer to [**[]InvitationRolesInner**](InvitationRolesInner.md) | | [optional] + +## Methods + +### NewInvitationInput + +`func NewInvitationInput(invitee string, ) *InvitationInput` + +NewInvitationInput instantiates a new InvitationInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvitationInputWithDefaults + +`func NewInvitationInputWithDefaults() *InvitationInput` + +NewInvitationInputWithDefaults instantiates a new InvitationInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInvitee + +`func (o *InvitationInput) GetInvitee() string` + +GetInvitee returns the Invitee field if non-nil, zero value otherwise. + +### GetInviteeOk + +`func (o *InvitationInput) GetInviteeOk() (*string, bool)` + +GetInviteeOk returns a tuple with the Invitee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitee + +`func (o *InvitationInput) SetInvitee(v string)` + +SetInvitee sets Invitee field to given value. + + +### GetMessage + +`func (o *InvitationInput) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *InvitationInput) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *InvitationInput) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *InvitationInput) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetOrganizationId + +`func (o *InvitationInput) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *InvitationInput) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *InvitationInput) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *InvitationInput) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetProjectsIds + +`func (o *InvitationInput) GetProjectsIds() []string` + +GetProjectsIds returns the ProjectsIds field if non-nil, zero value otherwise. + +### GetProjectsIdsOk + +`func (o *InvitationInput) GetProjectsIdsOk() (*[]string, bool)` + +GetProjectsIdsOk returns a tuple with the ProjectsIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectsIds + +`func (o *InvitationInput) SetProjectsIds(v []string)` + +SetProjectsIds sets ProjectsIds field to given value. + +### HasProjectsIds + +`func (o *InvitationInput) HasProjectsIds() bool` + +HasProjectsIds returns a boolean if a field has been set. + +### GetRoles + +`func (o *InvitationInput) GetRoles() []InvitationRolesInner` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *InvitationInput) GetRolesOk() (*[]InvitationRolesInner, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *InvitationInput) SetRoles(v []InvitationRolesInner)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *InvitationInput) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvitationList.md b/services/metalv1/docs/InvitationList.md new file mode 100644 index 00000000..5fbfd66a --- /dev/null +++ b/services/metalv1/docs/InvitationList.md @@ -0,0 +1,56 @@ +# InvitationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Invitations** | Pointer to [**[]Membership**](Membership.md) | | [optional] + +## Methods + +### NewInvitationList + +`func NewInvitationList() *InvitationList` + +NewInvitationList instantiates a new InvitationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvitationListWithDefaults + +`func NewInvitationListWithDefaults() *InvitationList` + +NewInvitationListWithDefaults instantiates a new InvitationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInvitations + +`func (o *InvitationList) GetInvitations() []Membership` + +GetInvitations returns the Invitations field if non-nil, zero value otherwise. + +### GetInvitationsOk + +`func (o *InvitationList) GetInvitationsOk() (*[]Membership, bool)` + +GetInvitationsOk returns a tuple with the Invitations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitations + +`func (o *InvitationList) SetInvitations(v []Membership)` + +SetInvitations sets Invitations field to given value. + +### HasInvitations + +`func (o *InvitationList) HasInvitations() bool` + +HasInvitations returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvitationRolesInner.md b/services/metalv1/docs/InvitationRolesInner.md new file mode 100644 index 00000000..1c0ce97d --- /dev/null +++ b/services/metalv1/docs/InvitationRolesInner.md @@ -0,0 +1,17 @@ +# InvitationRolesInner + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `BILLING` (value: `"billing"`) + +* `COLLABORATOR` (value: `"collaborator"`) + +* `LIMITED_COLLABORATOR` (value: `"limited_collaborator"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvitationsApi.md b/services/metalv1/docs/InvitationsApi.md new file mode 100644 index 00000000..b2ff3708 --- /dev/null +++ b/services/metalv1/docs/InvitationsApi.md @@ -0,0 +1,223 @@ +# \InvitationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AcceptInvitation**](InvitationsApi.md#AcceptInvitation) | **Put** /invitations/{id} | Accept an invitation +[**DeclineInvitation**](InvitationsApi.md#DeclineInvitation) | **Delete** /invitations/{id} | Decline an invitation +[**FindInvitationById**](InvitationsApi.md#FindInvitationById) | **Get** /invitations/{id} | View an invitation + + + +## AcceptInvitation + +> Membership AcceptInvitation(ctx, id).Include(include).Execute() + +Accept an invitation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Invitation UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvitationsApi.AcceptInvitation(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitationsApi.AcceptInvitation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AcceptInvitation`: Membership + fmt.Fprintf(os.Stdout, "Response from `InvitationsApi.AcceptInvitation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Invitation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAcceptInvitationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeclineInvitation + +> DeclineInvitation(ctx, id).Execute() + +Decline an invitation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Invitation UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.InvitationsApi.DeclineInvitation(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitationsApi.DeclineInvitation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Invitation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeclineInvitationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindInvitationById + +> Invitation FindInvitationById(ctx, id).Include(include).Execute() + +View an invitation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Invitation UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvitationsApi.FindInvitationById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvitationsApi.FindInvitationById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindInvitationById`: Invitation + fmt.Fprintf(os.Stdout, "Response from `InvitationsApi.FindInvitationById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Invitation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindInvitationByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Invoice.md b/services/metalv1/docs/Invoice.md new file mode 100644 index 00000000..b65114ff --- /dev/null +++ b/services/metalv1/docs/Invoice.md @@ -0,0 +1,394 @@ +# Invoice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**Balance** | Pointer to **float32** | | [optional] +**CreatedOn** | Pointer to **string** | | [optional] +**CreditAmount** | Pointer to **float32** | | [optional] +**CreditsApplied** | Pointer to **float32** | | [optional] +**Currency** | Pointer to **string** | | [optional] +**DueOn** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Items** | Pointer to [**[]LineItem**](LineItem.md) | | [optional] +**Number** | Pointer to **string** | | [optional] +**Project** | Pointer to [**ProjectIdName**](ProjectIdName.md) | | [optional] +**ReferenceNumber** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] +**TargetDate** | Pointer to **string** | | [optional] + +## Methods + +### NewInvoice + +`func NewInvoice() *Invoice` + +NewInvoice instantiates a new Invoice object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceWithDefaults + +`func NewInvoiceWithDefaults() *Invoice` + +NewInvoiceWithDefaults instantiates a new Invoice object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *Invoice) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *Invoice) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *Invoice) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *Invoice) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetBalance + +`func (o *Invoice) GetBalance() float32` + +GetBalance returns the Balance field if non-nil, zero value otherwise. + +### GetBalanceOk + +`func (o *Invoice) GetBalanceOk() (*float32, bool)` + +GetBalanceOk returns a tuple with the Balance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBalance + +`func (o *Invoice) SetBalance(v float32)` + +SetBalance sets Balance field to given value. + +### HasBalance + +`func (o *Invoice) HasBalance() bool` + +HasBalance returns a boolean if a field has been set. + +### GetCreatedOn + +`func (o *Invoice) GetCreatedOn() string` + +GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. + +### GetCreatedOnOk + +`func (o *Invoice) GetCreatedOnOk() (*string, bool)` + +GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedOn + +`func (o *Invoice) SetCreatedOn(v string)` + +SetCreatedOn sets CreatedOn field to given value. + +### HasCreatedOn + +`func (o *Invoice) HasCreatedOn() bool` + +HasCreatedOn returns a boolean if a field has been set. + +### GetCreditAmount + +`func (o *Invoice) GetCreditAmount() float32` + +GetCreditAmount returns the CreditAmount field if non-nil, zero value otherwise. + +### GetCreditAmountOk + +`func (o *Invoice) GetCreditAmountOk() (*float32, bool)` + +GetCreditAmountOk returns a tuple with the CreditAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreditAmount + +`func (o *Invoice) SetCreditAmount(v float32)` + +SetCreditAmount sets CreditAmount field to given value. + +### HasCreditAmount + +`func (o *Invoice) HasCreditAmount() bool` + +HasCreditAmount returns a boolean if a field has been set. + +### GetCreditsApplied + +`func (o *Invoice) GetCreditsApplied() float32` + +GetCreditsApplied returns the CreditsApplied field if non-nil, zero value otherwise. + +### GetCreditsAppliedOk + +`func (o *Invoice) GetCreditsAppliedOk() (*float32, bool)` + +GetCreditsAppliedOk returns a tuple with the CreditsApplied field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreditsApplied + +`func (o *Invoice) SetCreditsApplied(v float32)` + +SetCreditsApplied sets CreditsApplied field to given value. + +### HasCreditsApplied + +`func (o *Invoice) HasCreditsApplied() bool` + +HasCreditsApplied returns a boolean if a field has been set. + +### GetCurrency + +`func (o *Invoice) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Invoice) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Invoice) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *Invoice) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetDueOn + +`func (o *Invoice) GetDueOn() string` + +GetDueOn returns the DueOn field if non-nil, zero value otherwise. + +### GetDueOnOk + +`func (o *Invoice) GetDueOnOk() (*string, bool)` + +GetDueOnOk returns a tuple with the DueOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDueOn + +`func (o *Invoice) SetDueOn(v string)` + +SetDueOn sets DueOn field to given value. + +### HasDueOn + +`func (o *Invoice) HasDueOn() bool` + +HasDueOn returns a boolean if a field has been set. + +### GetId + +`func (o *Invoice) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Invoice) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Invoice) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Invoice) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetItems + +`func (o *Invoice) GetItems() []LineItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *Invoice) GetItemsOk() (*[]LineItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *Invoice) SetItems(v []LineItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *Invoice) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetNumber + +`func (o *Invoice) GetNumber() string` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *Invoice) GetNumberOk() (*string, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *Invoice) SetNumber(v string)` + +SetNumber sets Number field to given value. + +### HasNumber + +`func (o *Invoice) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### GetProject + +`func (o *Invoice) GetProject() ProjectIdName` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *Invoice) GetProjectOk() (*ProjectIdName, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *Invoice) SetProject(v ProjectIdName)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *Invoice) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetReferenceNumber + +`func (o *Invoice) GetReferenceNumber() string` + +GetReferenceNumber returns the ReferenceNumber field if non-nil, zero value otherwise. + +### GetReferenceNumberOk + +`func (o *Invoice) GetReferenceNumberOk() (*string, bool)` + +GetReferenceNumberOk returns a tuple with the ReferenceNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceNumber + +`func (o *Invoice) SetReferenceNumber(v string)` + +SetReferenceNumber sets ReferenceNumber field to given value. + +### HasReferenceNumber + +`func (o *Invoice) HasReferenceNumber() bool` + +HasReferenceNumber returns a boolean if a field has been set. + +### GetStatus + +`func (o *Invoice) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Invoice) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Invoice) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *Invoice) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTargetDate + +`func (o *Invoice) GetTargetDate() string` + +GetTargetDate returns the TargetDate field if non-nil, zero value otherwise. + +### GetTargetDateOk + +`func (o *Invoice) GetTargetDateOk() (*string, bool)` + +GetTargetDateOk returns a tuple with the TargetDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetDate + +`func (o *Invoice) SetTargetDate(v string)` + +SetTargetDate sets TargetDate field to given value. + +### HasTargetDate + +`func (o *Invoice) HasTargetDate() bool` + +HasTargetDate returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvoiceList.md b/services/metalv1/docs/InvoiceList.md new file mode 100644 index 00000000..3a278c80 --- /dev/null +++ b/services/metalv1/docs/InvoiceList.md @@ -0,0 +1,56 @@ +# InvoiceList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Invoices** | Pointer to [**[]Invoice**](Invoice.md) | | [optional] + +## Methods + +### NewInvoiceList + +`func NewInvoiceList() *InvoiceList` + +NewInvoiceList instantiates a new InvoiceList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceListWithDefaults + +`func NewInvoiceListWithDefaults() *InvoiceList` + +NewInvoiceListWithDefaults instantiates a new InvoiceList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInvoices + +`func (o *InvoiceList) GetInvoices() []Invoice` + +GetInvoices returns the Invoices field if non-nil, zero value otherwise. + +### GetInvoicesOk + +`func (o *InvoiceList) GetInvoicesOk() (*[]Invoice, bool)` + +GetInvoicesOk returns a tuple with the Invoices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoices + +`func (o *InvoiceList) SetInvoices(v []Invoice)` + +SetInvoices sets Invoices field to given value. + +### HasInvoices + +`func (o *InvoiceList) HasInvoices() bool` + +HasInvoices returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/InvoicesApi.md b/services/metalv1/docs/InvoicesApi.md new file mode 100644 index 00000000..f1f0713c --- /dev/null +++ b/services/metalv1/docs/InvoicesApi.md @@ -0,0 +1,156 @@ +# \InvoicesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindOrganizationInvoices**](InvoicesApi.md#FindOrganizationInvoices) | **Get** /organizations/{id}/invoices | Retrieve all invoices for an organization +[**GetInvoiceById**](InvoicesApi.md#GetInvoiceById) | **Get** /invoices/{id} | Retrieve an invoice + + + +## FindOrganizationInvoices + +> InvoiceList FindOrganizationInvoices(ctx, id).Page(page).PerPage(perPage).Status(status).Execute() + +Retrieve all invoices for an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + page := int32(56) // int32 | page number (optional) + perPage := int32(56) // int32 | per page (optional) + status := "status_example" // string | filter by status (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvoicesApi.FindOrganizationInvoices(context.Background(), id).Page(page).PerPage(perPage).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoicesApi.FindOrganizationInvoices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationInvoices`: InvoiceList + fmt.Fprintf(os.Stdout, "Response from `InvoicesApi.FindOrganizationInvoices`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationInvoicesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **page** | **int32** | page number | + **perPage** | **int32** | per page | + **status** | **string** | filter by status | + +### Return type + +[**InvoiceList**](InvoiceList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInvoiceById + +> Invoice GetInvoiceById(ctx, id).Execute() + +Retrieve an invoice + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Invoice UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.InvoicesApi.GetInvoiceById(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InvoicesApi.GetInvoiceById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInvoiceById`: Invoice + fmt.Fprintf(os.Stdout, "Response from `InvoicesApi.GetInvoiceById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Invoice UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInvoiceByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Invoice**](Invoice.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/License.md b/services/metalv1/docs/License.md new file mode 100644 index 00000000..fa10b5ef --- /dev/null +++ b/services/metalv1/docs/License.md @@ -0,0 +1,186 @@ +# License + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**LicenseKey** | Pointer to **string** | | [optional] +**LicenseeProduct** | Pointer to [**Href**](Href.md) | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Size** | Pointer to **float32** | | [optional] + +## Methods + +### NewLicense + +`func NewLicense() *License` + +NewLicense instantiates a new License object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLicenseWithDefaults + +`func NewLicenseWithDefaults() *License` + +NewLicenseWithDefaults instantiates a new License object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *License) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *License) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *License) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *License) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetId + +`func (o *License) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *License) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *License) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *License) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLicenseKey + +`func (o *License) GetLicenseKey() string` + +GetLicenseKey returns the LicenseKey field if non-nil, zero value otherwise. + +### GetLicenseKeyOk + +`func (o *License) GetLicenseKeyOk() (*string, bool)` + +GetLicenseKeyOk returns a tuple with the LicenseKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLicenseKey + +`func (o *License) SetLicenseKey(v string)` + +SetLicenseKey sets LicenseKey field to given value. + +### HasLicenseKey + +`func (o *License) HasLicenseKey() bool` + +HasLicenseKey returns a boolean if a field has been set. + +### GetLicenseeProduct + +`func (o *License) GetLicenseeProduct() Href` + +GetLicenseeProduct returns the LicenseeProduct field if non-nil, zero value otherwise. + +### GetLicenseeProductOk + +`func (o *License) GetLicenseeProductOk() (*Href, bool)` + +GetLicenseeProductOk returns a tuple with the LicenseeProduct field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLicenseeProduct + +`func (o *License) SetLicenseeProduct(v Href)` + +SetLicenseeProduct sets LicenseeProduct field to given value. + +### HasLicenseeProduct + +`func (o *License) HasLicenseeProduct() bool` + +HasLicenseeProduct returns a boolean if a field has been set. + +### GetProject + +`func (o *License) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *License) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *License) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *License) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetSize + +`func (o *License) GetSize() float32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *License) GetSizeOk() (*float32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *License) SetSize(v float32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *License) HasSize() bool` + +HasSize returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/LicenseCreateInput.md b/services/metalv1/docs/LicenseCreateInput.md new file mode 100644 index 00000000..48d322be --- /dev/null +++ b/services/metalv1/docs/LicenseCreateInput.md @@ -0,0 +1,108 @@ +# LicenseCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**LicenseeProductId** | Pointer to **string** | | [optional] +**Size** | Pointer to **float32** | | [optional] + +## Methods + +### NewLicenseCreateInput + +`func NewLicenseCreateInput() *LicenseCreateInput` + +NewLicenseCreateInput instantiates a new LicenseCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLicenseCreateInputWithDefaults + +`func NewLicenseCreateInputWithDefaults() *LicenseCreateInput` + +NewLicenseCreateInputWithDefaults instantiates a new LicenseCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *LicenseCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *LicenseCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *LicenseCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *LicenseCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetLicenseeProductId + +`func (o *LicenseCreateInput) GetLicenseeProductId() string` + +GetLicenseeProductId returns the LicenseeProductId field if non-nil, zero value otherwise. + +### GetLicenseeProductIdOk + +`func (o *LicenseCreateInput) GetLicenseeProductIdOk() (*string, bool)` + +GetLicenseeProductIdOk returns a tuple with the LicenseeProductId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLicenseeProductId + +`func (o *LicenseCreateInput) SetLicenseeProductId(v string)` + +SetLicenseeProductId sets LicenseeProductId field to given value. + +### HasLicenseeProductId + +`func (o *LicenseCreateInput) HasLicenseeProductId() bool` + +HasLicenseeProductId returns a boolean if a field has been set. + +### GetSize + +`func (o *LicenseCreateInput) GetSize() float32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *LicenseCreateInput) GetSizeOk() (*float32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *LicenseCreateInput) SetSize(v float32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *LicenseCreateInput) HasSize() bool` + +HasSize returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/LicenseList.md b/services/metalv1/docs/LicenseList.md new file mode 100644 index 00000000..50a6dc41 --- /dev/null +++ b/services/metalv1/docs/LicenseList.md @@ -0,0 +1,56 @@ +# LicenseList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Licenses** | Pointer to [**[]License**](License.md) | | [optional] + +## Methods + +### NewLicenseList + +`func NewLicenseList() *LicenseList` + +NewLicenseList instantiates a new LicenseList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLicenseListWithDefaults + +`func NewLicenseListWithDefaults() *LicenseList` + +NewLicenseListWithDefaults instantiates a new LicenseList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLicenses + +`func (o *LicenseList) GetLicenses() []License` + +GetLicenses returns the Licenses field if non-nil, zero value otherwise. + +### GetLicensesOk + +`func (o *LicenseList) GetLicensesOk() (*[]License, bool)` + +GetLicensesOk returns a tuple with the Licenses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLicenses + +`func (o *LicenseList) SetLicenses(v []License)` + +SetLicenses sets Licenses field to given value. + +### HasLicenses + +`func (o *LicenseList) HasLicenses() bool` + +HasLicenses returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/LicenseUpdateInput.md b/services/metalv1/docs/LicenseUpdateInput.md new file mode 100644 index 00000000..e98865cd --- /dev/null +++ b/services/metalv1/docs/LicenseUpdateInput.md @@ -0,0 +1,82 @@ +# LicenseUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Size** | Pointer to **float32** | | [optional] + +## Methods + +### NewLicenseUpdateInput + +`func NewLicenseUpdateInput() *LicenseUpdateInput` + +NewLicenseUpdateInput instantiates a new LicenseUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLicenseUpdateInputWithDefaults + +`func NewLicenseUpdateInputWithDefaults() *LicenseUpdateInput` + +NewLicenseUpdateInputWithDefaults instantiates a new LicenseUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *LicenseUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *LicenseUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *LicenseUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *LicenseUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetSize + +`func (o *LicenseUpdateInput) GetSize() float32` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *LicenseUpdateInput) GetSizeOk() (*float32, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *LicenseUpdateInput) SetSize(v float32)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *LicenseUpdateInput) HasSize() bool` + +HasSize returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/LicensesApi.md b/services/metalv1/docs/LicensesApi.md new file mode 100644 index 00000000..7d6b5256 --- /dev/null +++ b/services/metalv1/docs/LicensesApi.md @@ -0,0 +1,385 @@ +# \LicensesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateLicense**](LicensesApi.md#CreateLicense) | **Post** /projects/{id}/licenses | Create a License +[**DeleteLicense**](LicensesApi.md#DeleteLicense) | **Delete** /licenses/{id} | Delete the license +[**FindLicenseById**](LicensesApi.md#FindLicenseById) | **Get** /licenses/{id} | Retrieve a license +[**FindProjectLicenses**](LicensesApi.md#FindProjectLicenses) | **Get** /projects/{id}/licenses | Retrieve all licenses +[**UpdateLicense**](LicensesApi.md#UpdateLicense) | **Put** /licenses/{id} | Update the license + + + +## CreateLicense + +> License CreateLicense(ctx, id).LicenseCreateInput(licenseCreateInput).Include(include).Exclude(exclude).Execute() + +Create a License + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + licenseCreateInput := *openapiclient.NewLicenseCreateInput() // LicenseCreateInput | License to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LicensesApi.CreateLicense(context.Background(), id).LicenseCreateInput(licenseCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LicensesApi.CreateLicense``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateLicense`: License + fmt.Fprintf(os.Stdout, "Response from `LicensesApi.CreateLicense`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateLicenseRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **licenseCreateInput** | [**LicenseCreateInput**](LicenseCreateInput.md) | License to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteLicense + +> DeleteLicense(ctx, id).Execute() + +Delete the license + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | License UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.LicensesApi.DeleteLicense(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LicensesApi.DeleteLicense``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | License UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteLicenseRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindLicenseById + +> License FindLicenseById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a license + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | License UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LicensesApi.FindLicenseById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LicensesApi.FindLicenseById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindLicenseById`: License + fmt.Fprintf(os.Stdout, "Response from `LicensesApi.FindLicenseById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | License UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindLicenseByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectLicenses + +> LicenseList FindProjectLicenses(ctx, id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all licenses + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LicensesApi.FindProjectLicenses(context.Background(), id).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LicensesApi.FindProjectLicenses``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectLicenses`: LicenseList + fmt.Fprintf(os.Stdout, "Response from `LicensesApi.FindProjectLicenses`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectLicensesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**LicenseList**](LicenseList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateLicense + +> License UpdateLicense(ctx, id).LicenseUpdateInput(licenseUpdateInput).Include(include).Exclude(exclude).Execute() + +Update the license + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | License UUID + licenseUpdateInput := *openapiclient.NewLicenseUpdateInput() // LicenseUpdateInput | License to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.LicensesApi.UpdateLicense(context.Background(), id).LicenseUpdateInput(licenseUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LicensesApi.UpdateLicense``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateLicense`: License + fmt.Fprintf(os.Stdout, "Response from `LicensesApi.UpdateLicense`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | License UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateLicenseRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **licenseUpdateInput** | [**LicenseUpdateInput**](LicenseUpdateInput.md) | License to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**License**](License.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/LineItem.md b/services/metalv1/docs/LineItem.md new file mode 100644 index 00000000..a20b2c34 --- /dev/null +++ b/services/metalv1/docs/LineItem.md @@ -0,0 +1,212 @@ +# LineItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**Currency** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Plan** | Pointer to [**Plan**](Plan.md) | | [optional] +**Unit** | Pointer to **string** | | [optional] +**UnitPrice** | Pointer to **float32** | | [optional] + +## Methods + +### NewLineItem + +`func NewLineItem() *LineItem` + +NewLineItem instantiates a new LineItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewLineItemWithDefaults + +`func NewLineItemWithDefaults() *LineItem` + +NewLineItemWithDefaults instantiates a new LineItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *LineItem) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *LineItem) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *LineItem) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *LineItem) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetCurrency + +`func (o *LineItem) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *LineItem) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *LineItem) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + +### HasCurrency + +`func (o *LineItem) HasCurrency() bool` + +HasCurrency returns a boolean if a field has been set. + +### GetDescription + +`func (o *LineItem) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *LineItem) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *LineItem) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *LineItem) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetDetails + +`func (o *LineItem) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *LineItem) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *LineItem) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *LineItem) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetPlan + +`func (o *LineItem) GetPlan() Plan` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *LineItem) GetPlanOk() (*Plan, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *LineItem) SetPlan(v Plan)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *LineItem) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetUnit + +`func (o *LineItem) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *LineItem) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *LineItem) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *LineItem) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + +### GetUnitPrice + +`func (o *LineItem) GetUnitPrice() float32` + +GetUnitPrice returns the UnitPrice field if non-nil, zero value otherwise. + +### GetUnitPriceOk + +`func (o *LineItem) GetUnitPriceOk() (*float32, bool)` + +GetUnitPriceOk returns a tuple with the UnitPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitPrice + +`func (o *LineItem) SetUnitPrice(v float32)` + +SetUnitPrice sets UnitPrice field to given value. + +### HasUnitPrice + +`func (o *LineItem) HasUnitPrice() bool` + +HasUnitPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Membership.md b/services/metalv1/docs/Membership.md new file mode 100644 index 00000000..8fd6cc79 --- /dev/null +++ b/services/metalv1/docs/Membership.md @@ -0,0 +1,212 @@ +# Membership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Roles** | Pointer to **[]string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**User** | Pointer to [**Href**](Href.md) | | [optional] + +## Methods + +### NewMembership + +`func NewMembership() *Membership` + +NewMembership instantiates a new Membership object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMembershipWithDefaults + +`func NewMembershipWithDefaults() *Membership` + +NewMembershipWithDefaults instantiates a new Membership object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *Membership) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Membership) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Membership) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Membership) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetHref + +`func (o *Membership) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Membership) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Membership) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Membership) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Membership) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Membership) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Membership) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Membership) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProject + +`func (o *Membership) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *Membership) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *Membership) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *Membership) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRoles + +`func (o *Membership) GetRoles() []string` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *Membership) GetRolesOk() (*[]string, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *Membership) SetRoles(v []string)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *Membership) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Membership) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Membership) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Membership) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Membership) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetUser + +`func (o *Membership) GetUser() Href` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *Membership) GetUserOk() (*Href, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *Membership) SetUser(v Href)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *Membership) HasUser() bool` + +HasUser returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MembershipInput.md b/services/metalv1/docs/MembershipInput.md new file mode 100644 index 00000000..ab4ad4e5 --- /dev/null +++ b/services/metalv1/docs/MembershipInput.md @@ -0,0 +1,56 @@ +# MembershipInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Role** | Pointer to **[]string** | | [optional] + +## Methods + +### NewMembershipInput + +`func NewMembershipInput() *MembershipInput` + +NewMembershipInput instantiates a new MembershipInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMembershipInputWithDefaults + +`func NewMembershipInputWithDefaults() *MembershipInput` + +NewMembershipInputWithDefaults instantiates a new MembershipInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRole + +`func (o *MembershipInput) GetRole() []string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *MembershipInput) GetRoleOk() (*[]string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *MembershipInput) SetRole(v []string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *MembershipInput) HasRole() bool` + +HasRole returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MembershipList.md b/services/metalv1/docs/MembershipList.md new file mode 100644 index 00000000..737d1f62 --- /dev/null +++ b/services/metalv1/docs/MembershipList.md @@ -0,0 +1,56 @@ +# MembershipList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Memberships** | Pointer to [**[]Membership**](Membership.md) | | [optional] + +## Methods + +### NewMembershipList + +`func NewMembershipList() *MembershipList` + +NewMembershipList instantiates a new MembershipList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMembershipListWithDefaults + +`func NewMembershipListWithDefaults() *MembershipList` + +NewMembershipListWithDefaults instantiates a new MembershipList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberships + +`func (o *MembershipList) GetMemberships() []Membership` + +GetMemberships returns the Memberships field if non-nil, zero value otherwise. + +### GetMembershipsOk + +`func (o *MembershipList) GetMembershipsOk() (*[]Membership, bool)` + +GetMembershipsOk returns a tuple with the Memberships field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberships + +`func (o *MembershipList) SetMemberships(v []Membership)` + +SetMemberships sets Memberships field to given value. + +### HasMemberships + +`func (o *MembershipList) HasMemberships() bool` + +HasMemberships returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MembershipsApi.md b/services/metalv1/docs/MembershipsApi.md new file mode 100644 index 00000000..952bee32 --- /dev/null +++ b/services/metalv1/docs/MembershipsApi.md @@ -0,0 +1,225 @@ +# \MembershipsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteMembership**](MembershipsApi.md#DeleteMembership) | **Delete** /memberships/{id} | Delete the membership +[**FindMembershipById**](MembershipsApi.md#FindMembershipById) | **Get** /memberships/{id} | Retrieve a membership +[**UpdateMembership**](MembershipsApi.md#UpdateMembership) | **Put** /memberships/{id} | Update the membership + + + +## DeleteMembership + +> DeleteMembership(ctx, id).Execute() + +Delete the membership + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Membership UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.MembershipsApi.DeleteMembership(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MembershipsApi.DeleteMembership``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Membership UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteMembershipRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindMembershipById + +> Membership FindMembershipById(ctx, id).Include(include).Execute() + +Retrieve a membership + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Membership UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MembershipsApi.FindMembershipById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MembershipsApi.FindMembershipById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindMembershipById`: Membership + fmt.Fprintf(os.Stdout, "Response from `MembershipsApi.FindMembershipById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Membership UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindMembershipByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateMembership + +> Membership UpdateMembership(ctx, id).MembershipInput(membershipInput).Include(include).Execute() + +Update the membership + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Membership UUID + membershipInput := *openapiclient.NewMembershipInput() // MembershipInput | Membership to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MembershipsApi.UpdateMembership(context.Background(), id).MembershipInput(membershipInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MembershipsApi.UpdateMembership``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateMembership`: Membership + fmt.Fprintf(os.Stdout, "Response from `MembershipsApi.UpdateMembership`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Membership UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateMembershipRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **membershipInput** | [**MembershipInput**](MembershipInput.md) | Membership to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Membership**](Membership.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Meta.md b/services/metalv1/docs/Meta.md new file mode 100644 index 00000000..0af996bc --- /dev/null +++ b/services/metalv1/docs/Meta.md @@ -0,0 +1,238 @@ +# Meta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**First** | Pointer to [**Href**](Href.md) | | [optional] +**Last** | Pointer to [**Href**](Href.md) | | [optional] +**Next** | Pointer to [**Href**](Href.md) | | [optional] +**Previous** | Pointer to [**Href**](Href.md) | | [optional] +**Self** | Pointer to [**Href**](Href.md) | | [optional] +**Total** | Pointer to **int32** | | [optional] +**CurrentPage** | Pointer to **int32** | | [optional] +**LastPage** | Pointer to **int32** | | [optional] + +## Methods + +### NewMeta + +`func NewMeta() *Meta` + +NewMeta instantiates a new Meta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetaWithDefaults + +`func NewMetaWithDefaults() *Meta` + +NewMetaWithDefaults instantiates a new Meta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFirst + +`func (o *Meta) GetFirst() Href` + +GetFirst returns the First field if non-nil, zero value otherwise. + +### GetFirstOk + +`func (o *Meta) GetFirstOk() (*Href, bool)` + +GetFirstOk returns a tuple with the First field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirst + +`func (o *Meta) SetFirst(v Href)` + +SetFirst sets First field to given value. + +### HasFirst + +`func (o *Meta) HasFirst() bool` + +HasFirst returns a boolean if a field has been set. + +### GetLast + +`func (o *Meta) GetLast() Href` + +GetLast returns the Last field if non-nil, zero value otherwise. + +### GetLastOk + +`func (o *Meta) GetLastOk() (*Href, bool)` + +GetLastOk returns a tuple with the Last field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLast + +`func (o *Meta) SetLast(v Href)` + +SetLast sets Last field to given value. + +### HasLast + +`func (o *Meta) HasLast() bool` + +HasLast returns a boolean if a field has been set. + +### GetNext + +`func (o *Meta) GetNext() Href` + +GetNext returns the Next field if non-nil, zero value otherwise. + +### GetNextOk + +`func (o *Meta) GetNextOk() (*Href, bool)` + +GetNextOk returns a tuple with the Next field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNext + +`func (o *Meta) SetNext(v Href)` + +SetNext sets Next field to given value. + +### HasNext + +`func (o *Meta) HasNext() bool` + +HasNext returns a boolean if a field has been set. + +### GetPrevious + +`func (o *Meta) GetPrevious() Href` + +GetPrevious returns the Previous field if non-nil, zero value otherwise. + +### GetPreviousOk + +`func (o *Meta) GetPreviousOk() (*Href, bool)` + +GetPreviousOk returns a tuple with the Previous field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrevious + +`func (o *Meta) SetPrevious(v Href)` + +SetPrevious sets Previous field to given value. + +### HasPrevious + +`func (o *Meta) HasPrevious() bool` + +HasPrevious returns a boolean if a field has been set. + +### GetSelf + +`func (o *Meta) GetSelf() Href` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *Meta) GetSelfOk() (*Href, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *Meta) SetSelf(v Href)` + +SetSelf sets Self field to given value. + +### HasSelf + +`func (o *Meta) HasSelf() bool` + +HasSelf returns a boolean if a field has been set. + +### GetTotal + +`func (o *Meta) GetTotal() int32` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *Meta) GetTotalOk() (*int32, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *Meta) SetTotal(v int32)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *Meta) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetCurrentPage + +`func (o *Meta) GetCurrentPage() int32` + +GetCurrentPage returns the CurrentPage field if non-nil, zero value otherwise. + +### GetCurrentPageOk + +`func (o *Meta) GetCurrentPageOk() (*int32, bool)` + +GetCurrentPageOk returns a tuple with the CurrentPage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentPage + +`func (o *Meta) SetCurrentPage(v int32)` + +SetCurrentPage sets CurrentPage field to given value. + +### HasCurrentPage + +`func (o *Meta) HasCurrentPage() bool` + +HasCurrentPage returns a boolean if a field has been set. + +### GetLastPage + +`func (o *Meta) GetLastPage() int32` + +GetLastPage returns the LastPage field if non-nil, zero value otherwise. + +### GetLastPageOk + +`func (o *Meta) GetLastPageOk() (*int32, bool)` + +GetLastPageOk returns a tuple with the LastPage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastPage + +`func (o *Meta) SetLastPage(v int32)` + +SetLastPage sets LastPage field to given value. + +### HasLastPage + +`func (o *Meta) HasLastPage() bool` + +HasLastPage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Metadata.md b/services/metalv1/docs/Metadata.md new file mode 100644 index 00000000..fbd81e01 --- /dev/null +++ b/services/metalv1/docs/Metadata.md @@ -0,0 +1,498 @@ +# Metadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] [default to {}] +**Facility** | Pointer to **string** | The facility code of the instance | [optional] +**Hostname** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Iqn** | Pointer to **string** | | [optional] +**Metro** | Pointer to **string** | The metro code of the instance | [optional] +**Network** | Pointer to [**MetadataNetwork**](MetadataNetwork.md) | | [optional] +**OperatingSystem** | Pointer to **map[string]interface{}** | | [optional] +**Plan** | Pointer to **string** | The plan slug of the instance | [optional] +**PrivateSubnets** | Pointer to **[]string** | An array of the private subnets | [optional] +**Reserved** | Pointer to **bool** | | [optional] +**Specs** | Pointer to **map[string]interface{}** | The specs of the plan version of the instance | [optional] +**SshKeys** | Pointer to **[]string** | | [optional] +**SwitchShortId** | Pointer to **string** | | [optional] +**State** | Pointer to [**DeviceState**](DeviceState.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Volumes** | Pointer to **[]string** | | [optional] + +## Methods + +### NewMetadata + +`func NewMetadata() *Metadata` + +NewMetadata instantiates a new Metadata object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetadataWithDefaults + +`func NewMetadataWithDefaults() *Metadata` + +NewMetadataWithDefaults instantiates a new Metadata object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClass + +`func (o *Metadata) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Metadata) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *Metadata) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *Metadata) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *Metadata) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *Metadata) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *Metadata) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *Metadata) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetFacility + +`func (o *Metadata) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *Metadata) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *Metadata) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *Metadata) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetHostname + +`func (o *Metadata) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *Metadata) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *Metadata) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *Metadata) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetId + +`func (o *Metadata) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Metadata) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Metadata) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Metadata) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIqn + +`func (o *Metadata) GetIqn() string` + +GetIqn returns the Iqn field if non-nil, zero value otherwise. + +### GetIqnOk + +`func (o *Metadata) GetIqnOk() (*string, bool)` + +GetIqnOk returns a tuple with the Iqn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIqn + +`func (o *Metadata) SetIqn(v string)` + +SetIqn sets Iqn field to given value. + +### HasIqn + +`func (o *Metadata) HasIqn() bool` + +HasIqn returns a boolean if a field has been set. + +### GetMetro + +`func (o *Metadata) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *Metadata) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *Metadata) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *Metadata) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetwork + +`func (o *Metadata) GetNetwork() MetadataNetwork` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *Metadata) GetNetworkOk() (*MetadataNetwork, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *Metadata) SetNetwork(v MetadataNetwork)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *Metadata) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *Metadata) GetOperatingSystem() map[string]interface{}` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *Metadata) GetOperatingSystemOk() (*map[string]interface{}, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *Metadata) SetOperatingSystem(v map[string]interface{})` + +SetOperatingSystem sets OperatingSystem field to given value. + +### HasOperatingSystem + +`func (o *Metadata) HasOperatingSystem() bool` + +HasOperatingSystem returns a boolean if a field has been set. + +### GetPlan + +`func (o *Metadata) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *Metadata) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *Metadata) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *Metadata) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetPrivateSubnets + +`func (o *Metadata) GetPrivateSubnets() []string` + +GetPrivateSubnets returns the PrivateSubnets field if non-nil, zero value otherwise. + +### GetPrivateSubnetsOk + +`func (o *Metadata) GetPrivateSubnetsOk() (*[]string, bool)` + +GetPrivateSubnetsOk returns a tuple with the PrivateSubnets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateSubnets + +`func (o *Metadata) SetPrivateSubnets(v []string)` + +SetPrivateSubnets sets PrivateSubnets field to given value. + +### HasPrivateSubnets + +`func (o *Metadata) HasPrivateSubnets() bool` + +HasPrivateSubnets returns a boolean if a field has been set. + +### GetReserved + +`func (o *Metadata) GetReserved() bool` + +GetReserved returns the Reserved field if non-nil, zero value otherwise. + +### GetReservedOk + +`func (o *Metadata) GetReservedOk() (*bool, bool)` + +GetReservedOk returns a tuple with the Reserved field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReserved + +`func (o *Metadata) SetReserved(v bool)` + +SetReserved sets Reserved field to given value. + +### HasReserved + +`func (o *Metadata) HasReserved() bool` + +HasReserved returns a boolean if a field has been set. + +### GetSpecs + +`func (o *Metadata) GetSpecs() map[string]interface{}` + +GetSpecs returns the Specs field if non-nil, zero value otherwise. + +### GetSpecsOk + +`func (o *Metadata) GetSpecsOk() (*map[string]interface{}, bool)` + +GetSpecsOk returns a tuple with the Specs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecs + +`func (o *Metadata) SetSpecs(v map[string]interface{})` + +SetSpecs sets Specs field to given value. + +### HasSpecs + +`func (o *Metadata) HasSpecs() bool` + +HasSpecs returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *Metadata) GetSshKeys() []string` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *Metadata) GetSshKeysOk() (*[]string, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *Metadata) SetSshKeys(v []string)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *Metadata) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetSwitchShortId + +`func (o *Metadata) GetSwitchShortId() string` + +GetSwitchShortId returns the SwitchShortId field if non-nil, zero value otherwise. + +### GetSwitchShortIdOk + +`func (o *Metadata) GetSwitchShortIdOk() (*string, bool)` + +GetSwitchShortIdOk returns a tuple with the SwitchShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSwitchShortId + +`func (o *Metadata) SetSwitchShortId(v string)` + +SetSwitchShortId sets SwitchShortId field to given value. + +### HasSwitchShortId + +`func (o *Metadata) HasSwitchShortId() bool` + +HasSwitchShortId returns a boolean if a field has been set. + +### GetState + +`func (o *Metadata) GetState() DeviceState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *Metadata) GetStateOk() (*DeviceState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *Metadata) SetState(v DeviceState)` + +SetState sets State field to given value. + +### HasState + +`func (o *Metadata) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTags + +`func (o *Metadata) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Metadata) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Metadata) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Metadata) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVolumes + +`func (o *Metadata) GetVolumes() []string` + +GetVolumes returns the Volumes field if non-nil, zero value otherwise. + +### GetVolumesOk + +`func (o *Metadata) GetVolumesOk() (*[]string, bool)` + +GetVolumesOk returns a tuple with the Volumes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumes + +`func (o *Metadata) SetVolumes(v []string)` + +SetVolumes sets Volumes field to given value. + +### HasVolumes + +`func (o *Metadata) HasVolumes() bool` + +HasVolumes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetadataNetwork.md b/services/metalv1/docs/MetadataNetwork.md new file mode 100644 index 00000000..7fccd166 --- /dev/null +++ b/services/metalv1/docs/MetadataNetwork.md @@ -0,0 +1,108 @@ +# MetadataNetwork + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addresses** | Pointer to **[]string** | | [optional] +**Interfaces** | Pointer to **[]map[string]interface{}** | | [optional] +**Network** | Pointer to [**MetadataNetworkNetwork**](MetadataNetworkNetwork.md) | | [optional] + +## Methods + +### NewMetadataNetwork + +`func NewMetadataNetwork() *MetadataNetwork` + +NewMetadataNetwork instantiates a new MetadataNetwork object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetadataNetworkWithDefaults + +`func NewMetadataNetworkWithDefaults() *MetadataNetwork` + +NewMetadataNetworkWithDefaults instantiates a new MetadataNetwork object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddresses + +`func (o *MetadataNetwork) GetAddresses() []string` + +GetAddresses returns the Addresses field if non-nil, zero value otherwise. + +### GetAddressesOk + +`func (o *MetadataNetwork) GetAddressesOk() (*[]string, bool)` + +GetAddressesOk returns a tuple with the Addresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddresses + +`func (o *MetadataNetwork) SetAddresses(v []string)` + +SetAddresses sets Addresses field to given value. + +### HasAddresses + +`func (o *MetadataNetwork) HasAddresses() bool` + +HasAddresses returns a boolean if a field has been set. + +### GetInterfaces + +`func (o *MetadataNetwork) GetInterfaces() []map[string]interface{}` + +GetInterfaces returns the Interfaces field if non-nil, zero value otherwise. + +### GetInterfacesOk + +`func (o *MetadataNetwork) GetInterfacesOk() (*[]map[string]interface{}, bool)` + +GetInterfacesOk returns a tuple with the Interfaces field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInterfaces + +`func (o *MetadataNetwork) SetInterfaces(v []map[string]interface{})` + +SetInterfaces sets Interfaces field to given value. + +### HasInterfaces + +`func (o *MetadataNetwork) HasInterfaces() bool` + +HasInterfaces returns a boolean if a field has been set. + +### GetNetwork + +`func (o *MetadataNetwork) GetNetwork() MetadataNetworkNetwork` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *MetadataNetwork) GetNetworkOk() (*MetadataNetworkNetwork, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *MetadataNetwork) SetNetwork(v MetadataNetworkNetwork)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *MetadataNetwork) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetadataNetworkNetwork.md b/services/metalv1/docs/MetadataNetworkNetwork.md new file mode 100644 index 00000000..ed55c87d --- /dev/null +++ b/services/metalv1/docs/MetadataNetworkNetwork.md @@ -0,0 +1,56 @@ +# MetadataNetworkNetwork + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bonding** | Pointer to [**MetadataNetworkNetworkBonding**](MetadataNetworkNetworkBonding.md) | | [optional] + +## Methods + +### NewMetadataNetworkNetwork + +`func NewMetadataNetworkNetwork() *MetadataNetworkNetwork` + +NewMetadataNetworkNetwork instantiates a new MetadataNetworkNetwork object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetadataNetworkNetworkWithDefaults + +`func NewMetadataNetworkNetworkWithDefaults() *MetadataNetworkNetwork` + +NewMetadataNetworkNetworkWithDefaults instantiates a new MetadataNetworkNetwork object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBonding + +`func (o *MetadataNetworkNetwork) GetBonding() MetadataNetworkNetworkBonding` + +GetBonding returns the Bonding field if non-nil, zero value otherwise. + +### GetBondingOk + +`func (o *MetadataNetworkNetwork) GetBondingOk() (*MetadataNetworkNetworkBonding, bool)` + +GetBondingOk returns a tuple with the Bonding field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBonding + +`func (o *MetadataNetworkNetwork) SetBonding(v MetadataNetworkNetworkBonding)` + +SetBonding sets Bonding field to given value. + +### HasBonding + +`func (o *MetadataNetworkNetwork) HasBonding() bool` + +HasBonding returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetadataNetworkNetworkBonding.md b/services/metalv1/docs/MetadataNetworkNetworkBonding.md new file mode 100644 index 00000000..088138cf --- /dev/null +++ b/services/metalv1/docs/MetadataNetworkNetworkBonding.md @@ -0,0 +1,108 @@ +# MetadataNetworkNetworkBonding + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LinkAggregation** | Pointer to **string** | | [optional] +**Mac** | Pointer to **string** | | [optional] +**Mode** | Pointer to **int32** | | [optional] + +## Methods + +### NewMetadataNetworkNetworkBonding + +`func NewMetadataNetworkNetworkBonding() *MetadataNetworkNetworkBonding` + +NewMetadataNetworkNetworkBonding instantiates a new MetadataNetworkNetworkBonding object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetadataNetworkNetworkBondingWithDefaults + +`func NewMetadataNetworkNetworkBondingWithDefaults() *MetadataNetworkNetworkBonding` + +NewMetadataNetworkNetworkBondingWithDefaults instantiates a new MetadataNetworkNetworkBonding object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLinkAggregation + +`func (o *MetadataNetworkNetworkBonding) GetLinkAggregation() string` + +GetLinkAggregation returns the LinkAggregation field if non-nil, zero value otherwise. + +### GetLinkAggregationOk + +`func (o *MetadataNetworkNetworkBonding) GetLinkAggregationOk() (*string, bool)` + +GetLinkAggregationOk returns a tuple with the LinkAggregation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinkAggregation + +`func (o *MetadataNetworkNetworkBonding) SetLinkAggregation(v string)` + +SetLinkAggregation sets LinkAggregation field to given value. + +### HasLinkAggregation + +`func (o *MetadataNetworkNetworkBonding) HasLinkAggregation() bool` + +HasLinkAggregation returns a boolean if a field has been set. + +### GetMac + +`func (o *MetadataNetworkNetworkBonding) GetMac() string` + +GetMac returns the Mac field if non-nil, zero value otherwise. + +### GetMacOk + +`func (o *MetadataNetworkNetworkBonding) GetMacOk() (*string, bool)` + +GetMacOk returns a tuple with the Mac field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMac + +`func (o *MetadataNetworkNetworkBonding) SetMac(v string)` + +SetMac sets Mac field to given value. + +### HasMac + +`func (o *MetadataNetworkNetworkBonding) HasMac() bool` + +HasMac returns a boolean if a field has been set. + +### GetMode + +`func (o *MetadataNetworkNetworkBonding) GetMode() int32` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *MetadataNetworkNetworkBonding) GetModeOk() (*int32, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *MetadataNetworkNetworkBonding) SetMode(v int32)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *MetadataNetworkNetworkBonding) HasMode() bool` + +HasMode returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGateway.md b/services/metalv1/docs/MetalGateway.md new file mode 100644 index 00000000..8f4f59c0 --- /dev/null +++ b/services/metalv1/docs/MetalGateway.md @@ -0,0 +1,264 @@ +# MetalGateway + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpReservation** | Pointer to [**IPReservation**](IPReservation.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**State** | Pointer to [**MetalGatewayState**](MetalGatewayState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] + +## Methods + +### NewMetalGateway + +`func NewMetalGateway() *MetalGateway` + +NewMetalGateway instantiates a new MetalGateway object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayWithDefaults + +`func NewMetalGatewayWithDefaults() *MetalGateway` + +NewMetalGatewayWithDefaults instantiates a new MetalGateway object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *MetalGateway) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *MetalGateway) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *MetalGateway) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *MetalGateway) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *MetalGateway) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *MetalGateway) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *MetalGateway) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *MetalGateway) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetHref + +`func (o *MetalGateway) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *MetalGateway) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *MetalGateway) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *MetalGateway) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *MetalGateway) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MetalGateway) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MetalGateway) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MetalGateway) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpReservation + +`func (o *MetalGateway) GetIpReservation() IPReservation` + +GetIpReservation returns the IpReservation field if non-nil, zero value otherwise. + +### GetIpReservationOk + +`func (o *MetalGateway) GetIpReservationOk() (*IPReservation, bool)` + +GetIpReservationOk returns a tuple with the IpReservation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservation + +`func (o *MetalGateway) SetIpReservation(v IPReservation)` + +SetIpReservation sets IpReservation field to given value. + +### HasIpReservation + +`func (o *MetalGateway) HasIpReservation() bool` + +HasIpReservation returns a boolean if a field has been set. + +### GetProject + +`func (o *MetalGateway) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *MetalGateway) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *MetalGateway) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *MetalGateway) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetState + +`func (o *MetalGateway) GetState() MetalGatewayState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *MetalGateway) GetStateOk() (*MetalGatewayState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *MetalGateway) SetState(v MetalGatewayState)` + +SetState sets State field to given value. + +### HasState + +`func (o *MetalGateway) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *MetalGateway) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *MetalGateway) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *MetalGateway) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *MetalGateway) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *MetalGateway) GetVirtualNetwork() VirtualNetwork` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *MetalGateway) GetVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *MetalGateway) SetVirtualNetwork(v VirtualNetwork)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *MetalGateway) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayCreateInput.md b/services/metalv1/docs/MetalGatewayCreateInput.md new file mode 100644 index 00000000..f8697a0f --- /dev/null +++ b/services/metalv1/docs/MetalGatewayCreateInput.md @@ -0,0 +1,103 @@ +# MetalGatewayCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpReservationId** | Pointer to **string** | The UUID of an IP reservation that belongs to the same project as where the metal gateway will be created in. This field is required unless the private IPv4 subnet size is specified. | [optional] +**PrivateIpv4SubnetSize** | Pointer to **int32** | The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. | [optional] +**VirtualNetworkId** | **string** | The UUID of a metro virtual network that belongs to the same project as where the metal gateway will be created in. | + +## Methods + +### NewMetalGatewayCreateInput + +`func NewMetalGatewayCreateInput(virtualNetworkId string, ) *MetalGatewayCreateInput` + +NewMetalGatewayCreateInput instantiates a new MetalGatewayCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayCreateInputWithDefaults + +`func NewMetalGatewayCreateInputWithDefaults() *MetalGatewayCreateInput` + +NewMetalGatewayCreateInputWithDefaults instantiates a new MetalGatewayCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpReservationId + +`func (o *MetalGatewayCreateInput) GetIpReservationId() string` + +GetIpReservationId returns the IpReservationId field if non-nil, zero value otherwise. + +### GetIpReservationIdOk + +`func (o *MetalGatewayCreateInput) GetIpReservationIdOk() (*string, bool)` + +GetIpReservationIdOk returns a tuple with the IpReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservationId + +`func (o *MetalGatewayCreateInput) SetIpReservationId(v string)` + +SetIpReservationId sets IpReservationId field to given value. + +### HasIpReservationId + +`func (o *MetalGatewayCreateInput) HasIpReservationId() bool` + +HasIpReservationId returns a boolean if a field has been set. + +### GetPrivateIpv4SubnetSize + +`func (o *MetalGatewayCreateInput) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *MetalGatewayCreateInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *MetalGatewayCreateInput) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *MetalGatewayCreateInput) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetVirtualNetworkId + +`func (o *MetalGatewayCreateInput) GetVirtualNetworkId() string` + +GetVirtualNetworkId returns the VirtualNetworkId field if non-nil, zero value otherwise. + +### GetVirtualNetworkIdOk + +`func (o *MetalGatewayCreateInput) GetVirtualNetworkIdOk() (*string, bool)` + +GetVirtualNetworkIdOk returns a tuple with the VirtualNetworkId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetworkId + +`func (o *MetalGatewayCreateInput) SetVirtualNetworkId(v string)` + +SetVirtualNetworkId sets VirtualNetworkId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md b/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md new file mode 100644 index 00000000..2bc2ac28 --- /dev/null +++ b/services/metalv1/docs/MetalGatewayElasticIpCreateInput.md @@ -0,0 +1,124 @@ +# MetalGatewayElasticIpCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | An IP address (or IP Address range) contained within one of the project's IP Reservations | +**NextHop** | **string** | An IP address contained within the Metal Gateways' IP Reservation range. | +**Customdata** | Pointer to **map[string]interface{}** | Optional User-defined JSON object value. | [optional] +**Tags** | Pointer to **[]string** | Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. | [optional] + +## Methods + +### NewMetalGatewayElasticIpCreateInput + +`func NewMetalGatewayElasticIpCreateInput(address string, nextHop string, ) *MetalGatewayElasticIpCreateInput` + +NewMetalGatewayElasticIpCreateInput instantiates a new MetalGatewayElasticIpCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayElasticIpCreateInputWithDefaults + +`func NewMetalGatewayElasticIpCreateInputWithDefaults() *MetalGatewayElasticIpCreateInput` + +NewMetalGatewayElasticIpCreateInputWithDefaults instantiates a new MetalGatewayElasticIpCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *MetalGatewayElasticIpCreateInput) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *MetalGatewayElasticIpCreateInput) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *MetalGatewayElasticIpCreateInput) SetAddress(v string)` + +SetAddress sets Address field to given value. + + +### GetNextHop + +`func (o *MetalGatewayElasticIpCreateInput) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *MetalGatewayElasticIpCreateInput) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *MetalGatewayElasticIpCreateInput) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + + +### GetCustomdata + +`func (o *MetalGatewayElasticIpCreateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *MetalGatewayElasticIpCreateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *MetalGatewayElasticIpCreateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *MetalGatewayElasticIpCreateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetTags + +`func (o *MetalGatewayElasticIpCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *MetalGatewayElasticIpCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *MetalGatewayElasticIpCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *MetalGatewayElasticIpCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayList.md b/services/metalv1/docs/MetalGatewayList.md new file mode 100644 index 00000000..09e30c67 --- /dev/null +++ b/services/metalv1/docs/MetalGatewayList.md @@ -0,0 +1,82 @@ +# MetalGatewayList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MetalGateways** | Pointer to [**[]MetalGatewayListMetalGatewaysInner**](MetalGatewayListMetalGatewaysInner.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewMetalGatewayList + +`func NewMetalGatewayList() *MetalGatewayList` + +NewMetalGatewayList instantiates a new MetalGatewayList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayListWithDefaults + +`func NewMetalGatewayListWithDefaults() *MetalGatewayList` + +NewMetalGatewayListWithDefaults instantiates a new MetalGatewayList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMetalGateways + +`func (o *MetalGatewayList) GetMetalGateways() []MetalGatewayListMetalGatewaysInner` + +GetMetalGateways returns the MetalGateways field if non-nil, zero value otherwise. + +### GetMetalGatewaysOk + +`func (o *MetalGatewayList) GetMetalGatewaysOk() (*[]MetalGatewayListMetalGatewaysInner, bool)` + +GetMetalGatewaysOk returns a tuple with the MetalGateways field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateways + +`func (o *MetalGatewayList) SetMetalGateways(v []MetalGatewayListMetalGatewaysInner)` + +SetMetalGateways sets MetalGateways field to given value. + +### HasMetalGateways + +`func (o *MetalGatewayList) HasMetalGateways() bool` + +HasMetalGateways returns a boolean if a field has been set. + +### GetMeta + +`func (o *MetalGatewayList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *MetalGatewayList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *MetalGatewayList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *MetalGatewayList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md b/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md new file mode 100644 index 00000000..22fc3a93 --- /dev/null +++ b/services/metalv1/docs/MetalGatewayListMetalGatewaysInner.md @@ -0,0 +1,290 @@ +# MetalGatewayListMetalGatewaysInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpReservation** | Pointer to [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**State** | Pointer to [**MetalGatewayState**](MetalGatewayState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**Vrf** | Pointer to [**Vrf**](Vrf.md) | | [optional] + +## Methods + +### NewMetalGatewayListMetalGatewaysInner + +`func NewMetalGatewayListMetalGatewaysInner() *MetalGatewayListMetalGatewaysInner` + +NewMetalGatewayListMetalGatewaysInner instantiates a new MetalGatewayListMetalGatewaysInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayListMetalGatewaysInnerWithDefaults + +`func NewMetalGatewayListMetalGatewaysInnerWithDefaults() *MetalGatewayListMetalGatewaysInner` + +NewMetalGatewayListMetalGatewaysInnerWithDefaults instantiates a new MetalGatewayListMetalGatewaysInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *MetalGatewayListMetalGatewaysInner) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *MetalGatewayListMetalGatewaysInner) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *MetalGatewayListMetalGatewaysInner) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetHref + +`func (o *MetalGatewayListMetalGatewaysInner) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *MetalGatewayListMetalGatewaysInner) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *MetalGatewayListMetalGatewaysInner) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *MetalGatewayListMetalGatewaysInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MetalGatewayListMetalGatewaysInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MetalGatewayListMetalGatewaysInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpReservation + +`func (o *MetalGatewayListMetalGatewaysInner) GetIpReservation() VrfIpReservation` + +GetIpReservation returns the IpReservation field if non-nil, zero value otherwise. + +### GetIpReservationOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetIpReservationOk() (*VrfIpReservation, bool)` + +GetIpReservationOk returns a tuple with the IpReservation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservation + +`func (o *MetalGatewayListMetalGatewaysInner) SetIpReservation(v VrfIpReservation)` + +SetIpReservation sets IpReservation field to given value. + +### HasIpReservation + +`func (o *MetalGatewayListMetalGatewaysInner) HasIpReservation() bool` + +HasIpReservation returns a boolean if a field has been set. + +### GetProject + +`func (o *MetalGatewayListMetalGatewaysInner) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *MetalGatewayListMetalGatewaysInner) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *MetalGatewayListMetalGatewaysInner) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetState + +`func (o *MetalGatewayListMetalGatewaysInner) GetState() MetalGatewayState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetStateOk() (*MetalGatewayState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *MetalGatewayListMetalGatewaysInner) SetState(v MetalGatewayState)` + +SetState sets State field to given value. + +### HasState + +`func (o *MetalGatewayListMetalGatewaysInner) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *MetalGatewayListMetalGatewaysInner) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *MetalGatewayListMetalGatewaysInner) GetVirtualNetwork() VirtualNetwork` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *MetalGatewayListMetalGatewaysInner) SetVirtualNetwork(v VirtualNetwork)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *MetalGatewayListMetalGatewaysInner) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVrf + +`func (o *MetalGatewayListMetalGatewaysInner) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *MetalGatewayListMetalGatewaysInner) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *MetalGatewayListMetalGatewaysInner) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + +### HasVrf + +`func (o *MetalGatewayListMetalGatewaysInner) HasVrf() bool` + +HasVrf returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayLite.md b/services/metalv1/docs/MetalGatewayLite.md new file mode 100644 index 00000000..1b1c7d69 --- /dev/null +++ b/services/metalv1/docs/MetalGatewayLite.md @@ -0,0 +1,212 @@ +# MetalGatewayLite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**GatewayAddress** | Pointer to **string** | The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27. | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**State** | Pointer to [**MetalGatewayState**](MetalGatewayState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Vlan** | Pointer to **int32** | The VLAN id of the Virtual Network record associated to this Metal Gateway. | [optional] + +## Methods + +### NewMetalGatewayLite + +`func NewMetalGatewayLite() *MetalGatewayLite` + +NewMetalGatewayLite instantiates a new MetalGatewayLite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetalGatewayLiteWithDefaults + +`func NewMetalGatewayLiteWithDefaults() *MetalGatewayLite` + +NewMetalGatewayLiteWithDefaults instantiates a new MetalGatewayLite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *MetalGatewayLite) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *MetalGatewayLite) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *MetalGatewayLite) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *MetalGatewayLite) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetGatewayAddress + +`func (o *MetalGatewayLite) GetGatewayAddress() string` + +GetGatewayAddress returns the GatewayAddress field if non-nil, zero value otherwise. + +### GetGatewayAddressOk + +`func (o *MetalGatewayLite) GetGatewayAddressOk() (*string, bool)` + +GetGatewayAddressOk returns a tuple with the GatewayAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGatewayAddress + +`func (o *MetalGatewayLite) SetGatewayAddress(v string)` + +SetGatewayAddress sets GatewayAddress field to given value. + +### HasGatewayAddress + +`func (o *MetalGatewayLite) HasGatewayAddress() bool` + +HasGatewayAddress returns a boolean if a field has been set. + +### GetHref + +`func (o *MetalGatewayLite) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *MetalGatewayLite) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *MetalGatewayLite) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *MetalGatewayLite) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *MetalGatewayLite) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MetalGatewayLite) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MetalGatewayLite) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MetalGatewayLite) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetState + +`func (o *MetalGatewayLite) GetState() MetalGatewayState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *MetalGatewayLite) GetStateOk() (*MetalGatewayState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *MetalGatewayLite) SetState(v MetalGatewayState)` + +SetState sets State field to given value. + +### HasState + +`func (o *MetalGatewayLite) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *MetalGatewayLite) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *MetalGatewayLite) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *MetalGatewayLite) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *MetalGatewayLite) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVlan + +`func (o *MetalGatewayLite) GetVlan() int32` + +GetVlan returns the Vlan field if non-nil, zero value otherwise. + +### GetVlanOk + +`func (o *MetalGatewayLite) GetVlanOk() (*int32, bool)` + +GetVlanOk returns a tuple with the Vlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlan + +`func (o *MetalGatewayLite) SetVlan(v int32)` + +SetVlan sets Vlan field to given value. + +### HasVlan + +`func (o *MetalGatewayLite) HasVlan() bool` + +HasVlan returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewayState.md b/services/metalv1/docs/MetalGatewayState.md new file mode 100644 index 00000000..7012f005 --- /dev/null +++ b/services/metalv1/docs/MetalGatewayState.md @@ -0,0 +1,15 @@ +# MetalGatewayState + +## Enum + + +* `READY` (value: `"ready"`) + +* `ACTIVE` (value: `"active"`) + +* `DELETING` (value: `"deleting"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetalGatewaysApi.md b/services/metalv1/docs/MetalGatewaysApi.md new file mode 100644 index 00000000..c0e5f985 --- /dev/null +++ b/services/metalv1/docs/MetalGatewaysApi.md @@ -0,0 +1,471 @@ +# \MetalGatewaysApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateMetalGateway**](MetalGatewaysApi.md#CreateMetalGateway) | **Post** /projects/{project_id}/metal-gateways | Create a metal gateway +[**CreateMetalGatewayElasticIp**](MetalGatewaysApi.md#CreateMetalGatewayElasticIp) | **Post** /metal-gateways/{id}/ips | Create a Metal Gateway Elastic IP +[**DeleteMetalGateway**](MetalGatewaysApi.md#DeleteMetalGateway) | **Delete** /metal-gateways/{id} | Deletes the metal gateway +[**FindMetalGatewayById**](MetalGatewaysApi.md#FindMetalGatewayById) | **Get** /metal-gateways/{id} | Returns the metal gateway +[**FindMetalGatewaysByProject**](MetalGatewaysApi.md#FindMetalGatewaysByProject) | **Get** /projects/{project_id}/metal-gateways | Returns all metal gateways for a project +[**GetMetalGatewayElasticIps**](MetalGatewaysApi.md#GetMetalGatewayElasticIps) | **Get** /metal-gateways/{id}/ips | List Metal Gateway Elastic IPs + + + +## CreateMetalGateway + +> FindMetalGatewayById200Response CreateMetalGateway(ctx, projectId).CreateMetalGatewayRequest(createMetalGatewayRequest).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Create a metal gateway + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + createMetalGatewayRequest := openapiclient.createMetalGateway_request{MetalGatewayCreateInput: openapiclient.NewMetalGatewayCreateInput("VirtualNetworkId_example")} // CreateMetalGatewayRequest | Metal Gateway to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.CreateMetalGateway(context.Background(), projectId).CreateMetalGatewayRequest(createMetalGatewayRequest).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.CreateMetalGateway``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateMetalGateway`: FindMetalGatewayById200Response + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.CreateMetalGateway`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateMetalGatewayRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createMetalGatewayRequest** | [**CreateMetalGatewayRequest**](CreateMetalGatewayRequest.md) | Metal Gateway to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateMetalGatewayElasticIp + +> IPAssignment CreateMetalGatewayElasticIp(ctx, id).MetalGatewayElasticIpCreateInput(metalGatewayElasticIpCreateInput).Include(include).Exclude(exclude).Execute() + +Create a Metal Gateway Elastic IP + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + metalGatewayElasticIpCreateInput := *openapiclient.NewMetalGatewayElasticIpCreateInput("147.75.234.8/31", "192.168.12.13") // MetalGatewayElasticIpCreateInput | + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.CreateMetalGatewayElasticIp(context.Background(), id).MetalGatewayElasticIpCreateInput(metalGatewayElasticIpCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.CreateMetalGatewayElasticIp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateMetalGatewayElasticIp`: IPAssignment + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.CreateMetalGatewayElasticIp`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateMetalGatewayElasticIpRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **metalGatewayElasticIpCreateInput** | [**MetalGatewayElasticIpCreateInput**](MetalGatewayElasticIpCreateInput.md) | | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**IPAssignment**](IPAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteMetalGateway + +> FindMetalGatewayById200Response DeleteMetalGateway(ctx, id).Include(include).Exclude(exclude).Execute() + +Deletes the metal gateway + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.DeleteMetalGateway(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.DeleteMetalGateway``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteMetalGateway`: FindMetalGatewayById200Response + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.DeleteMetalGateway`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteMetalGatewayRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindMetalGatewayById + +> FindMetalGatewayById200Response FindMetalGatewayById(ctx, id).Include(include).Exclude(exclude).Execute() + +Returns the metal gateway + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.FindMetalGatewayById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.FindMetalGatewayById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindMetalGatewayById`: FindMetalGatewayById200Response + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.FindMetalGatewayById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindMetalGatewayByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**FindMetalGatewayById200Response**](FindMetalGatewayById200Response.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindMetalGatewaysByProject + +> MetalGatewayList FindMetalGatewaysByProject(ctx, projectId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Returns all metal gateways for a project + + +FindMetalGatewaysByProject is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.FindMetalGatewaysByProject(context.Background(), projectId).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.FindMetalGatewaysByProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindMetalGatewaysByProject`: MetalGatewayList + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.FindMetalGatewaysByProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindMetalGatewaysByProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**MetalGatewayList**](MetalGatewayList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetMetalGatewayElasticIps + +> IPAssignmentList GetMetalGatewayElasticIps(ctx, id).Include(include).Exclude(exclude).Execute() + +List Metal Gateway Elastic IPs + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetalGatewaysApi.GetMetalGatewayElasticIps(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetalGatewaysApi.GetMetalGatewayElasticIps``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMetalGatewayElasticIps`: IPAssignmentList + fmt.Fprintf(os.Stdout, "Response from `MetalGatewaysApi.GetMetalGatewayElasticIps`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetMetalGatewayElasticIpsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**IPAssignmentList**](IPAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Metro.md b/services/metalv1/docs/Metro.md new file mode 100644 index 00000000..39c04762 --- /dev/null +++ b/services/metalv1/docs/Metro.md @@ -0,0 +1,134 @@ +# Metro + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewMetro + +`func NewMetro() *Metro` + +NewMetro instantiates a new Metro object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetroWithDefaults + +`func NewMetroWithDefaults() *Metro` + +NewMetroWithDefaults instantiates a new Metro object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *Metro) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *Metro) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *Metro) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *Metro) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *Metro) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *Metro) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *Metro) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *Metro) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetId + +`func (o *Metro) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Metro) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Metro) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Metro) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Metro) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Metro) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Metro) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Metro) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetroInput.md b/services/metalv1/docs/MetroInput.md new file mode 100644 index 00000000..2f0ffff0 --- /dev/null +++ b/services/metalv1/docs/MetroInput.md @@ -0,0 +1,51 @@ +# MetroInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metro** | **string** | Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. | + +## Methods + +### NewMetroInput + +`func NewMetroInput(metro string, ) *MetroInput` + +NewMetroInput instantiates a new MetroInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetroInputWithDefaults + +`func NewMetroInputWithDefaults() *MetroInput` + +NewMetroInputWithDefaults instantiates a new MetroInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMetro + +`func (o *MetroInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *MetroInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *MetroInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetroList.md b/services/metalv1/docs/MetroList.md new file mode 100644 index 00000000..9c6a0d71 --- /dev/null +++ b/services/metalv1/docs/MetroList.md @@ -0,0 +1,56 @@ +# MetroList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Metros** | Pointer to [**[]Metro**](Metro.md) | | [optional] + +## Methods + +### NewMetroList + +`func NewMetroList() *MetroList` + +NewMetroList instantiates a new MetroList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMetroListWithDefaults + +`func NewMetroListWithDefaults() *MetroList` + +NewMetroListWithDefaults instantiates a new MetroList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMetros + +`func (o *MetroList) GetMetros() []Metro` + +GetMetros returns the Metros field if non-nil, zero value otherwise. + +### GetMetrosOk + +`func (o *MetroList) GetMetrosOk() (*[]Metro, bool)` + +GetMetrosOk returns a tuple with the Metros field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetros + +`func (o *MetroList) SetMetros(v []Metro)` + +SetMetros sets Metros field to given value. + +### HasMetros + +`func (o *MetroList) HasMetros() bool` + +HasMetros returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MetrosApi.md b/services/metalv1/docs/MetrosApi.md new file mode 100644 index 00000000..09f1bd41 --- /dev/null +++ b/services/metalv1/docs/MetrosApi.md @@ -0,0 +1,141 @@ +# \MetrosApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindMetros**](MetrosApi.md#FindMetros) | **Get** /locations/metros | Retrieve all metros +[**GetMetro**](MetrosApi.md#GetMetro) | **Get** /locations/metros/{id} | Retrieve a specific Metro's details + + + +## FindMetros + +> MetroList FindMetros(ctx).Execute() + +Retrieve all metros + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetrosApi.FindMetros(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetrosApi.FindMetros``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindMetros`: MetroList + fmt.Fprintf(os.Stdout, "Response from `MetrosApi.FindMetros`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindMetrosRequest struct via the builder pattern + + +### Return type + +[**MetroList**](MetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetMetro + +> Metro GetMetro(ctx, id).Execute() + +Retrieve a specific Metro's details + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metro UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetrosApi.GetMetro(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetrosApi.GetMetro``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMetro`: Metro + fmt.Fprintf(os.Stdout, "Response from `MetrosApi.GetMetro`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metro UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetMetroRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Metro**](Metro.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Mount.md b/services/metalv1/docs/Mount.md new file mode 100644 index 00000000..8ccbe3ab --- /dev/null +++ b/services/metalv1/docs/Mount.md @@ -0,0 +1,134 @@ +# Mount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Device** | Pointer to **string** | | [optional] +**Format** | Pointer to **string** | | [optional] +**Point** | Pointer to **string** | | [optional] +**Options** | Pointer to **[]string** | | [optional] + +## Methods + +### NewMount + +`func NewMount() *Mount` + +NewMount instantiates a new Mount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMountWithDefaults + +`func NewMountWithDefaults() *Mount` + +NewMountWithDefaults instantiates a new Mount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDevice + +`func (o *Mount) GetDevice() string` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *Mount) GetDeviceOk() (*string, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *Mount) SetDevice(v string)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *Mount) HasDevice() bool` + +HasDevice returns a boolean if a field has been set. + +### GetFormat + +`func (o *Mount) GetFormat() string` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *Mount) GetFormatOk() (*string, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *Mount) SetFormat(v string)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *Mount) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetPoint + +`func (o *Mount) GetPoint() string` + +GetPoint returns the Point field if non-nil, zero value otherwise. + +### GetPointOk + +`func (o *Mount) GetPointOk() (*string, bool)` + +GetPointOk returns a tuple with the Point field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPoint + +`func (o *Mount) SetPoint(v string)` + +SetPoint sets Point field to given value. + +### HasPoint + +`func (o *Mount) HasPoint() bool` + +HasPoint returns a boolean if a field has been set. + +### GetOptions + +`func (o *Mount) GetOptions() []string` + +GetOptions returns the Options field if non-nil, zero value otherwise. + +### GetOptionsOk + +`func (o *Mount) GetOptionsOk() (*[]string, bool)` + +GetOptionsOk returns a tuple with the Options field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOptions + +`func (o *Mount) SetOptions(v []string)` + +SetOptions sets Options field to given value. + +### HasOptions + +`func (o *Mount) HasOptions() bool` + +HasOptions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/MoveHardwareReservationRequest.md b/services/metalv1/docs/MoveHardwareReservationRequest.md new file mode 100644 index 00000000..9816e471 --- /dev/null +++ b/services/metalv1/docs/MoveHardwareReservationRequest.md @@ -0,0 +1,56 @@ +# MoveHardwareReservationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProjectId** | Pointer to **string** | | [optional] + +## Methods + +### NewMoveHardwareReservationRequest + +`func NewMoveHardwareReservationRequest() *MoveHardwareReservationRequest` + +NewMoveHardwareReservationRequest instantiates a new MoveHardwareReservationRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMoveHardwareReservationRequestWithDefaults + +`func NewMoveHardwareReservationRequestWithDefaults() *MoveHardwareReservationRequest` + +NewMoveHardwareReservationRequestWithDefaults instantiates a new MoveHardwareReservationRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProjectId + +`func (o *MoveHardwareReservationRequest) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *MoveHardwareReservationRequest) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *MoveHardwareReservationRequest) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + +### HasProjectId + +`func (o *MoveHardwareReservationRequest) HasProjectId() bool` + +HasProjectId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/NewPassword.md b/services/metalv1/docs/NewPassword.md new file mode 100644 index 00000000..db1131f2 --- /dev/null +++ b/services/metalv1/docs/NewPassword.md @@ -0,0 +1,56 @@ +# NewPassword + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NewPassword** | Pointer to **string** | | [optional] + +## Methods + +### NewNewPassword + +`func NewNewPassword() *NewPassword` + +NewNewPassword instantiates a new NewPassword object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNewPasswordWithDefaults + +`func NewNewPasswordWithDefaults() *NewPassword` + +NewNewPasswordWithDefaults instantiates a new NewPassword object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNewPassword + +`func (o *NewPassword) GetNewPassword() string` + +GetNewPassword returns the NewPassword field if non-nil, zero value otherwise. + +### GetNewPasswordOk + +`func (o *NewPassword) GetNewPasswordOk() (*string, bool)` + +GetNewPasswordOk returns a tuple with the NewPassword field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNewPassword + +`func (o *NewPassword) SetNewPassword(v string)` + +SetNewPassword sets NewPassword field to given value. + +### HasNewPassword + +`func (o *NewPassword) HasNewPassword() bool` + +HasNewPassword returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OTPsApi.md b/services/metalv1/docs/OTPsApi.md new file mode 100644 index 00000000..645252c1 --- /dev/null +++ b/services/metalv1/docs/OTPsApi.md @@ -0,0 +1,261 @@ +# \OTPsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindEnsureOtp**](OTPsApi.md#FindEnsureOtp) | **Post** /user/otp/verify/{otp} | Verify user by providing an OTP +[**FindRecoveryCodes**](OTPsApi.md#FindRecoveryCodes) | **Get** /user/otp/recovery-codes | Retrieve my recovery codes +[**ReceiveCodes**](OTPsApi.md#ReceiveCodes) | **Post** /user/otp/sms/receive | Receive an OTP per sms +[**RegenerateCodes**](OTPsApi.md#RegenerateCodes) | **Post** /user/otp/recovery-codes | Generate new recovery codes + + + +## FindEnsureOtp + +> FindEnsureOtp(ctx, otp).Execute() + +Verify user by providing an OTP + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + otp := "otp_example" // string | OTP + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OTPsApi.FindEnsureOtp(context.Background(), otp).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OTPsApi.FindEnsureOtp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**otp** | **string** | OTP | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindEnsureOtpRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindRecoveryCodes + +> RecoveryCodeList FindRecoveryCodes(ctx).Execute() + +Retrieve my recovery codes + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OTPsApi.FindRecoveryCodes(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OTPsApi.FindRecoveryCodes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindRecoveryCodes`: RecoveryCodeList + fmt.Fprintf(os.Stdout, "Response from `OTPsApi.FindRecoveryCodes`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindRecoveryCodesRequest struct via the builder pattern + + +### Return type + +[**RecoveryCodeList**](RecoveryCodeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ReceiveCodes + +> ReceiveCodes(ctx).Execute() + +Receive an OTP per sms + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OTPsApi.ReceiveCodes(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OTPsApi.ReceiveCodes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiReceiveCodesRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RegenerateCodes + +> RecoveryCodeList RegenerateCodes(ctx).Execute() + +Generate new recovery codes + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OTPsApi.RegenerateCodes(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OTPsApi.RegenerateCodes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RegenerateCodes`: RecoveryCodeList + fmt.Fprintf(os.Stdout, "Response from `OTPsApi.RegenerateCodes`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiRegenerateCodesRequest struct via the builder pattern + + +### Return type + +[**RecoveryCodeList**](RecoveryCodeList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/OperatingSystem.md b/services/metalv1/docs/OperatingSystem.md new file mode 100644 index 00000000..49c85e29 --- /dev/null +++ b/services/metalv1/docs/OperatingSystem.md @@ -0,0 +1,316 @@ +# OperatingSystem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Distro** | Pointer to **string** | | [optional] +**DistroLabel** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Licensed** | Pointer to **bool** | Licenced OS is priced according to pricing property | [optional] +**Name** | Pointer to **string** | | [optional] +**Preinstallable** | Pointer to **bool** | Servers can be already preinstalled with OS in order to shorten provision time. | [optional] +**Pricing** | Pointer to **map[string]interface{}** | This object contains price per time unit and optional multiplier value if licence price depends on hardware plan or components (e.g. number of cores) | [optional] +**ProvisionableOn** | Pointer to **[]string** | | [optional] +**Slug** | Pointer to **string** | | [optional] +**Version** | Pointer to **string** | | [optional] +**DefaultOperatingSystem** | Pointer to **bool** | Default operating system for the distro. | [optional] [readonly] + +## Methods + +### NewOperatingSystem + +`func NewOperatingSystem() *OperatingSystem` + +NewOperatingSystem instantiates a new OperatingSystem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOperatingSystemWithDefaults + +`func NewOperatingSystemWithDefaults() *OperatingSystem` + +NewOperatingSystemWithDefaults instantiates a new OperatingSystem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDistro + +`func (o *OperatingSystem) GetDistro() string` + +GetDistro returns the Distro field if non-nil, zero value otherwise. + +### GetDistroOk + +`func (o *OperatingSystem) GetDistroOk() (*string, bool)` + +GetDistroOk returns a tuple with the Distro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDistro + +`func (o *OperatingSystem) SetDistro(v string)` + +SetDistro sets Distro field to given value. + +### HasDistro + +`func (o *OperatingSystem) HasDistro() bool` + +HasDistro returns a boolean if a field has been set. + +### GetDistroLabel + +`func (o *OperatingSystem) GetDistroLabel() string` + +GetDistroLabel returns the DistroLabel field if non-nil, zero value otherwise. + +### GetDistroLabelOk + +`func (o *OperatingSystem) GetDistroLabelOk() (*string, bool)` + +GetDistroLabelOk returns a tuple with the DistroLabel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDistroLabel + +`func (o *OperatingSystem) SetDistroLabel(v string)` + +SetDistroLabel sets DistroLabel field to given value. + +### HasDistroLabel + +`func (o *OperatingSystem) HasDistroLabel() bool` + +HasDistroLabel returns a boolean if a field has been set. + +### GetId + +`func (o *OperatingSystem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OperatingSystem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OperatingSystem) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OperatingSystem) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLicensed + +`func (o *OperatingSystem) GetLicensed() bool` + +GetLicensed returns the Licensed field if non-nil, zero value otherwise. + +### GetLicensedOk + +`func (o *OperatingSystem) GetLicensedOk() (*bool, bool)` + +GetLicensedOk returns a tuple with the Licensed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLicensed + +`func (o *OperatingSystem) SetLicensed(v bool)` + +SetLicensed sets Licensed field to given value. + +### HasLicensed + +`func (o *OperatingSystem) HasLicensed() bool` + +HasLicensed returns a boolean if a field has been set. + +### GetName + +`func (o *OperatingSystem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OperatingSystem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OperatingSystem) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OperatingSystem) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPreinstallable + +`func (o *OperatingSystem) GetPreinstallable() bool` + +GetPreinstallable returns the Preinstallable field if non-nil, zero value otherwise. + +### GetPreinstallableOk + +`func (o *OperatingSystem) GetPreinstallableOk() (*bool, bool)` + +GetPreinstallableOk returns a tuple with the Preinstallable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreinstallable + +`func (o *OperatingSystem) SetPreinstallable(v bool)` + +SetPreinstallable sets Preinstallable field to given value. + +### HasPreinstallable + +`func (o *OperatingSystem) HasPreinstallable() bool` + +HasPreinstallable returns a boolean if a field has been set. + +### GetPricing + +`func (o *OperatingSystem) GetPricing() map[string]interface{}` + +GetPricing returns the Pricing field if non-nil, zero value otherwise. + +### GetPricingOk + +`func (o *OperatingSystem) GetPricingOk() (*map[string]interface{}, bool)` + +GetPricingOk returns a tuple with the Pricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricing + +`func (o *OperatingSystem) SetPricing(v map[string]interface{})` + +SetPricing sets Pricing field to given value. + +### HasPricing + +`func (o *OperatingSystem) HasPricing() bool` + +HasPricing returns a boolean if a field has been set. + +### GetProvisionableOn + +`func (o *OperatingSystem) GetProvisionableOn() []string` + +GetProvisionableOn returns the ProvisionableOn field if non-nil, zero value otherwise. + +### GetProvisionableOnOk + +`func (o *OperatingSystem) GetProvisionableOnOk() (*[]string, bool)` + +GetProvisionableOnOk returns a tuple with the ProvisionableOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProvisionableOn + +`func (o *OperatingSystem) SetProvisionableOn(v []string)` + +SetProvisionableOn sets ProvisionableOn field to given value. + +### HasProvisionableOn + +`func (o *OperatingSystem) HasProvisionableOn() bool` + +HasProvisionableOn returns a boolean if a field has been set. + +### GetSlug + +`func (o *OperatingSystem) GetSlug() string` + +GetSlug returns the Slug field if non-nil, zero value otherwise. + +### GetSlugOk + +`func (o *OperatingSystem) GetSlugOk() (*string, bool)` + +GetSlugOk returns a tuple with the Slug field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSlug + +`func (o *OperatingSystem) SetSlug(v string)` + +SetSlug sets Slug field to given value. + +### HasSlug + +`func (o *OperatingSystem) HasSlug() bool` + +HasSlug returns a boolean if a field has been set. + +### GetVersion + +`func (o *OperatingSystem) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *OperatingSystem) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *OperatingSystem) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *OperatingSystem) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + +### GetDefaultOperatingSystem + +`func (o *OperatingSystem) GetDefaultOperatingSystem() bool` + +GetDefaultOperatingSystem returns the DefaultOperatingSystem field if non-nil, zero value otherwise. + +### GetDefaultOperatingSystemOk + +`func (o *OperatingSystem) GetDefaultOperatingSystemOk() (*bool, bool)` + +GetDefaultOperatingSystemOk returns a tuple with the DefaultOperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultOperatingSystem + +`func (o *OperatingSystem) SetDefaultOperatingSystem(v bool)` + +SetDefaultOperatingSystem sets DefaultOperatingSystem field to given value. + +### HasDefaultOperatingSystem + +`func (o *OperatingSystem) HasDefaultOperatingSystem() bool` + +HasDefaultOperatingSystem returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OperatingSystemList.md b/services/metalv1/docs/OperatingSystemList.md new file mode 100644 index 00000000..98f54794 --- /dev/null +++ b/services/metalv1/docs/OperatingSystemList.md @@ -0,0 +1,56 @@ +# OperatingSystemList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OperatingSystems** | Pointer to [**[]OperatingSystem**](OperatingSystem.md) | | [optional] + +## Methods + +### NewOperatingSystemList + +`func NewOperatingSystemList() *OperatingSystemList` + +NewOperatingSystemList instantiates a new OperatingSystemList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOperatingSystemListWithDefaults + +`func NewOperatingSystemListWithDefaults() *OperatingSystemList` + +NewOperatingSystemListWithDefaults instantiates a new OperatingSystemList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOperatingSystems + +`func (o *OperatingSystemList) GetOperatingSystems() []OperatingSystem` + +GetOperatingSystems returns the OperatingSystems field if non-nil, zero value otherwise. + +### GetOperatingSystemsOk + +`func (o *OperatingSystemList) GetOperatingSystemsOk() (*[]OperatingSystem, bool)` + +GetOperatingSystemsOk returns a tuple with the OperatingSystems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystems + +`func (o *OperatingSystemList) SetOperatingSystems(v []OperatingSystem)` + +SetOperatingSystems sets OperatingSystems field to given value. + +### HasOperatingSystems + +`func (o *OperatingSystemList) HasOperatingSystems() bool` + +HasOperatingSystems returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OperatingSystemsApi.md b/services/metalv1/docs/OperatingSystemsApi.md new file mode 100644 index 00000000..f5a5d95a --- /dev/null +++ b/services/metalv1/docs/OperatingSystemsApi.md @@ -0,0 +1,132 @@ +# \OperatingSystemsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindOperatingSystemVersion**](OperatingSystemsApi.md#FindOperatingSystemVersion) | **Get** /operating-system-versions | Retrieve all operating system versions +[**FindOperatingSystems**](OperatingSystemsApi.md#FindOperatingSystems) | **Get** /operating-systems | Retrieve all operating systems + + + +## FindOperatingSystemVersion + +> OperatingSystemList FindOperatingSystemVersion(ctx).Execute() + +Retrieve all operating system versions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatingSystemsApi.FindOperatingSystemVersion(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OperatingSystemsApi.FindOperatingSystemVersion``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOperatingSystemVersion`: OperatingSystemList + fmt.Fprintf(os.Stdout, "Response from `OperatingSystemsApi.FindOperatingSystemVersion`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOperatingSystemVersionRequest struct via the builder pattern + + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOperatingSystems + +> OperatingSystemList FindOperatingSystems(ctx).Execute() + +Retrieve all operating systems + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OperatingSystemsApi.FindOperatingSystems(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OperatingSystemsApi.FindOperatingSystems``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOperatingSystems`: OperatingSystemList + fmt.Fprintf(os.Stdout, "Response from `OperatingSystemsApi.FindOperatingSystems`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOperatingSystemsRequest struct via the builder pattern + + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Organization.md b/services/metalv1/docs/Organization.md new file mode 100644 index 00000000..06e83141 --- /dev/null +++ b/services/metalv1/docs/Organization.md @@ -0,0 +1,472 @@ +# Organization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to [**Address**](Address.md) | | [optional] +**BillingAddress** | Pointer to [**Address**](Address.md) | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreditAmount** | Pointer to **float32** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Enforce2faAt** | Pointer to **time.Time** | Force to all members to have enabled the two factor authentication after that date, unless the value is null | [optional] +**Id** | Pointer to **string** | | [optional] +**Logo** | Pointer to **string** | | [optional] +**Members** | Pointer to [**[]Href**](Href.md) | | [optional] +**Memberships** | Pointer to [**[]Href**](Href.md) | | [optional] +**Name** | Pointer to **string** | | [optional] +**Projects** | Pointer to [**[]Href**](Href.md) | | [optional] +**Terms** | Pointer to **int32** | | [optional] +**Twitter** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Website** | Pointer to **string** | | [optional] + +## Methods + +### NewOrganization + +`func NewOrganization() *Organization` + +NewOrganization instantiates a new Organization object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrganizationWithDefaults + +`func NewOrganizationWithDefaults() *Organization` + +NewOrganizationWithDefaults instantiates a new Organization object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *Organization) GetAddress() Address` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Organization) GetAddressOk() (*Address, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Organization) SetAddress(v Address)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *Organization) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetBillingAddress + +`func (o *Organization) GetBillingAddress() Address` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *Organization) GetBillingAddressOk() (*Address, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *Organization) SetBillingAddress(v Address)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *Organization) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Organization) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Organization) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Organization) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Organization) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreditAmount + +`func (o *Organization) GetCreditAmount() float32` + +GetCreditAmount returns the CreditAmount field if non-nil, zero value otherwise. + +### GetCreditAmountOk + +`func (o *Organization) GetCreditAmountOk() (*float32, bool)` + +GetCreditAmountOk returns a tuple with the CreditAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreditAmount + +`func (o *Organization) SetCreditAmount(v float32)` + +SetCreditAmount sets CreditAmount field to given value. + +### HasCreditAmount + +`func (o *Organization) HasCreditAmount() bool` + +HasCreditAmount returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *Organization) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *Organization) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *Organization) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *Organization) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *Organization) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Organization) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Organization) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Organization) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEnforce2faAt + +`func (o *Organization) GetEnforce2faAt() time.Time` + +GetEnforce2faAt returns the Enforce2faAt field if non-nil, zero value otherwise. + +### GetEnforce2faAtOk + +`func (o *Organization) GetEnforce2faAtOk() (*time.Time, bool)` + +GetEnforce2faAtOk returns a tuple with the Enforce2faAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnforce2faAt + +`func (o *Organization) SetEnforce2faAt(v time.Time)` + +SetEnforce2faAt sets Enforce2faAt field to given value. + +### HasEnforce2faAt + +`func (o *Organization) HasEnforce2faAt() bool` + +HasEnforce2faAt returns a boolean if a field has been set. + +### GetId + +`func (o *Organization) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Organization) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Organization) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Organization) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLogo + +`func (o *Organization) GetLogo() string` + +GetLogo returns the Logo field if non-nil, zero value otherwise. + +### GetLogoOk + +`func (o *Organization) GetLogoOk() (*string, bool)` + +GetLogoOk returns a tuple with the Logo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogo + +`func (o *Organization) SetLogo(v string)` + +SetLogo sets Logo field to given value. + +### HasLogo + +`func (o *Organization) HasLogo() bool` + +HasLogo returns a boolean if a field has been set. + +### GetMembers + +`func (o *Organization) GetMembers() []Href` + +GetMembers returns the Members field if non-nil, zero value otherwise. + +### GetMembersOk + +`func (o *Organization) GetMembersOk() (*[]Href, bool)` + +GetMembersOk returns a tuple with the Members field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembers + +`func (o *Organization) SetMembers(v []Href)` + +SetMembers sets Members field to given value. + +### HasMembers + +`func (o *Organization) HasMembers() bool` + +HasMembers returns a boolean if a field has been set. + +### GetMemberships + +`func (o *Organization) GetMemberships() []Href` + +GetMemberships returns the Memberships field if non-nil, zero value otherwise. + +### GetMembershipsOk + +`func (o *Organization) GetMembershipsOk() (*[]Href, bool)` + +GetMembershipsOk returns a tuple with the Memberships field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberships + +`func (o *Organization) SetMemberships(v []Href)` + +SetMemberships sets Memberships field to given value. + +### HasMemberships + +`func (o *Organization) HasMemberships() bool` + +HasMemberships returns a boolean if a field has been set. + +### GetName + +`func (o *Organization) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Organization) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Organization) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Organization) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetProjects + +`func (o *Organization) GetProjects() []Href` + +GetProjects returns the Projects field if non-nil, zero value otherwise. + +### GetProjectsOk + +`func (o *Organization) GetProjectsOk() (*[]Href, bool)` + +GetProjectsOk returns a tuple with the Projects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjects + +`func (o *Organization) SetProjects(v []Href)` + +SetProjects sets Projects field to given value. + +### HasProjects + +`func (o *Organization) HasProjects() bool` + +HasProjects returns a boolean if a field has been set. + +### GetTerms + +`func (o *Organization) GetTerms() int32` + +GetTerms returns the Terms field if non-nil, zero value otherwise. + +### GetTermsOk + +`func (o *Organization) GetTermsOk() (*int32, bool)` + +GetTermsOk returns a tuple with the Terms field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerms + +`func (o *Organization) SetTerms(v int32)` + +SetTerms sets Terms field to given value. + +### HasTerms + +`func (o *Organization) HasTerms() bool` + +HasTerms returns a boolean if a field has been set. + +### GetTwitter + +`func (o *Organization) GetTwitter() string` + +GetTwitter returns the Twitter field if non-nil, zero value otherwise. + +### GetTwitterOk + +`func (o *Organization) GetTwitterOk() (*string, bool)` + +GetTwitterOk returns a tuple with the Twitter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwitter + +`func (o *Organization) SetTwitter(v string)` + +SetTwitter sets Twitter field to given value. + +### HasTwitter + +`func (o *Organization) HasTwitter() bool` + +HasTwitter returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Organization) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Organization) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Organization) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Organization) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetWebsite + +`func (o *Organization) GetWebsite() string` + +GetWebsite returns the Website field if non-nil, zero value otherwise. + +### GetWebsiteOk + +`func (o *Organization) GetWebsiteOk() (*string, bool)` + +GetWebsiteOk returns a tuple with the Website field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebsite + +`func (o *Organization) SetWebsite(v string)` + +SetWebsite sets Website field to given value. + +### HasWebsite + +`func (o *Organization) HasWebsite() bool` + +HasWebsite returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OrganizationInput.md b/services/metalv1/docs/OrganizationInput.md new file mode 100644 index 00000000..01b9d338 --- /dev/null +++ b/services/metalv1/docs/OrganizationInput.md @@ -0,0 +1,264 @@ +# OrganizationInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | Pointer to [**Address**](Address.md) | | [optional] +**BillingAddress** | Pointer to [**Address**](Address.md) | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Enforce2faAt** | Pointer to **time.Time** | Force to all members to have enabled the two factor authentication after that date, unless the value is null | [optional] +**Logo** | Pointer to **string** | The logo for the organization; must be base64-encoded image data | [optional] +**Name** | Pointer to **string** | | [optional] +**Twitter** | Pointer to **string** | | [optional] +**Website** | Pointer to **string** | | [optional] + +## Methods + +### NewOrganizationInput + +`func NewOrganizationInput() *OrganizationInput` + +NewOrganizationInput instantiates a new OrganizationInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrganizationInputWithDefaults + +`func NewOrganizationInputWithDefaults() *OrganizationInput` + +NewOrganizationInputWithDefaults instantiates a new OrganizationInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddress + +`func (o *OrganizationInput) GetAddress() Address` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *OrganizationInput) GetAddressOk() (*Address, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *OrganizationInput) SetAddress(v Address)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *OrganizationInput) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetBillingAddress + +`func (o *OrganizationInput) GetBillingAddress() Address` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *OrganizationInput) GetBillingAddressOk() (*Address, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *OrganizationInput) SetBillingAddress(v Address)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *OrganizationInput) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *OrganizationInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *OrganizationInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *OrganizationInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *OrganizationInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *OrganizationInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *OrganizationInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *OrganizationInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *OrganizationInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetEnforce2faAt + +`func (o *OrganizationInput) GetEnforce2faAt() time.Time` + +GetEnforce2faAt returns the Enforce2faAt field if non-nil, zero value otherwise. + +### GetEnforce2faAtOk + +`func (o *OrganizationInput) GetEnforce2faAtOk() (*time.Time, bool)` + +GetEnforce2faAtOk returns a tuple with the Enforce2faAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnforce2faAt + +`func (o *OrganizationInput) SetEnforce2faAt(v time.Time)` + +SetEnforce2faAt sets Enforce2faAt field to given value. + +### HasEnforce2faAt + +`func (o *OrganizationInput) HasEnforce2faAt() bool` + +HasEnforce2faAt returns a boolean if a field has been set. + +### GetLogo + +`func (o *OrganizationInput) GetLogo() string` + +GetLogo returns the Logo field if non-nil, zero value otherwise. + +### GetLogoOk + +`func (o *OrganizationInput) GetLogoOk() (*string, bool)` + +GetLogoOk returns a tuple with the Logo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogo + +`func (o *OrganizationInput) SetLogo(v string)` + +SetLogo sets Logo field to given value. + +### HasLogo + +`func (o *OrganizationInput) HasLogo() bool` + +HasLogo returns a boolean if a field has been set. + +### GetName + +`func (o *OrganizationInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrganizationInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrganizationInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrganizationInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetTwitter + +`func (o *OrganizationInput) GetTwitter() string` + +GetTwitter returns the Twitter field if non-nil, zero value otherwise. + +### GetTwitterOk + +`func (o *OrganizationInput) GetTwitterOk() (*string, bool)` + +GetTwitterOk returns a tuple with the Twitter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwitter + +`func (o *OrganizationInput) SetTwitter(v string)` + +SetTwitter sets Twitter field to given value. + +### HasTwitter + +`func (o *OrganizationInput) HasTwitter() bool` + +HasTwitter returns a boolean if a field has been set. + +### GetWebsite + +`func (o *OrganizationInput) GetWebsite() string` + +GetWebsite returns the Website field if non-nil, zero value otherwise. + +### GetWebsiteOk + +`func (o *OrganizationInput) GetWebsiteOk() (*string, bool)` + +GetWebsiteOk returns a tuple with the Website field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWebsite + +`func (o *OrganizationInput) SetWebsite(v string)` + +SetWebsite sets Website field to given value. + +### HasWebsite + +`func (o *OrganizationInput) HasWebsite() bool` + +HasWebsite returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OrganizationList.md b/services/metalv1/docs/OrganizationList.md new file mode 100644 index 00000000..950978a4 --- /dev/null +++ b/services/metalv1/docs/OrganizationList.md @@ -0,0 +1,82 @@ +# OrganizationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] +**Organizations** | Pointer to [**[]Organization**](Organization.md) | | [optional] + +## Methods + +### NewOrganizationList + +`func NewOrganizationList() *OrganizationList` + +NewOrganizationList instantiates a new OrganizationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrganizationListWithDefaults + +`func NewOrganizationListWithDefaults() *OrganizationList` + +NewOrganizationListWithDefaults instantiates a new OrganizationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMeta + +`func (o *OrganizationList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *OrganizationList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *OrganizationList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *OrganizationList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetOrganizations + +`func (o *OrganizationList) GetOrganizations() []Organization` + +GetOrganizations returns the Organizations field if non-nil, zero value otherwise. + +### GetOrganizationsOk + +`func (o *OrganizationList) GetOrganizationsOk() (*[]Organization, bool)` + +GetOrganizationsOk returns a tuple with the Organizations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizations + +`func (o *OrganizationList) SetOrganizations(v []Organization)` + +SetOrganizations sets Organizations field to given value. + +### HasOrganizations + +`func (o *OrganizationList) HasOrganizations() bool` + +HasOrganizations returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/OrganizationsApi.md b/services/metalv1/docs/OrganizationsApi.md new file mode 100644 index 00000000..cbbcc806 --- /dev/null +++ b/services/metalv1/docs/OrganizationsApi.md @@ -0,0 +1,1131 @@ +# \OrganizationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateOrganization**](OrganizationsApi.md#CreateOrganization) | **Post** /organizations | Create an organization +[**CreateOrganizationInvitation**](OrganizationsApi.md#CreateOrganizationInvitation) | **Post** /organizations/{id}/invitations | Create an invitation for an organization +[**CreateOrganizationProject**](OrganizationsApi.md#CreateOrganizationProject) | **Post** /organizations/{id}/projects | Create a project for the organization +[**CreatePaymentMethod**](OrganizationsApi.md#CreatePaymentMethod) | **Post** /organizations/{id}/payment-methods | Create a payment method for the given organization +[**DeleteOrganization**](OrganizationsApi.md#DeleteOrganization) | **Delete** /organizations/{id} | Delete the organization +[**FindOperatingSystemsByOrganization**](OrganizationsApi.md#FindOperatingSystemsByOrganization) | **Get** /organizations/{id}/operating-systems | Retrieve all operating systems visible by the organization +[**FindOrganizationById**](OrganizationsApi.md#FindOrganizationById) | **Get** /organizations/{id} | Retrieve an organization's details +[**FindOrganizationCustomdata**](OrganizationsApi.md#FindOrganizationCustomdata) | **Get** /organizations/{id}/customdata | Retrieve the custom metadata of an organization +[**FindOrganizationInvitations**](OrganizationsApi.md#FindOrganizationInvitations) | **Get** /organizations/{id}/invitations | Retrieve organization invitations +[**FindOrganizationPaymentMethods**](OrganizationsApi.md#FindOrganizationPaymentMethods) | **Get** /organizations/{id}/payment-methods | Retrieve all payment methods of an organization +[**FindOrganizationProjects**](OrganizationsApi.md#FindOrganizationProjects) | **Get** /organizations/{id}/projects | Retrieve all projects of an organization +[**FindOrganizationTransfers**](OrganizationsApi.md#FindOrganizationTransfers) | **Get** /organizations/{id}/transfers | Retrieve all project transfer requests from or to an organization +[**FindOrganizations**](OrganizationsApi.md#FindOrganizations) | **Get** /organizations | Retrieve all organizations +[**FindPlansByOrganization**](OrganizationsApi.md#FindPlansByOrganization) | **Get** /organizations/{id}/plans | Retrieve all plans visible by the organization +[**UpdateOrganization**](OrganizationsApi.md#UpdateOrganization) | **Put** /organizations/{id} | Update the organization + + + +## CreateOrganization + +> Organization CreateOrganization(ctx).OrganizationInput(organizationInput).Include(include).Exclude(exclude).Execute() + +Create an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + organizationInput := *openapiclient.NewOrganizationInput() // OrganizationInput | Organization to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.CreateOrganization(context.Background()).OrganizationInput(organizationInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.CreateOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOrganization`: Organization + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.CreateOrganization`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organizationInput** | [**OrganizationInput**](OrganizationInput.md) | Organization to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateOrganizationInvitation + +> Invitation CreateOrganizationInvitation(ctx, id).InvitationInput(invitationInput).Include(include).Execute() + +Create an invitation for an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + invitationInput := *openapiclient.NewInvitationInput("Invitee_example") // InvitationInput | Invitation to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.CreateOrganizationInvitation(context.Background(), id).InvitationInput(invitationInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.CreateOrganizationInvitation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOrganizationInvitation`: Invitation + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.CreateOrganizationInvitation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateOrganizationInvitationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **invitationInput** | [**InvitationInput**](InvitationInput.md) | Invitation to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateOrganizationProject + +> Project CreateOrganizationProject(ctx, id).ProjectCreateInput(projectCreateInput).Include(include).Exclude(exclude).Execute() + +Create a project for the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + projectCreateInput := *openapiclient.NewProjectCreateInput("Name_example") // ProjectCreateInput | Project to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.CreateOrganizationProject(context.Background(), id).ProjectCreateInput(projectCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.CreateOrganizationProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateOrganizationProject`: Project + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.CreateOrganizationProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateOrganizationProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **projectCreateInput** | [**ProjectCreateInput**](ProjectCreateInput.md) | Project to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreatePaymentMethod + +> PaymentMethod CreatePaymentMethod(ctx, id).PaymentMethodCreateInput(paymentMethodCreateInput).Include(include).Execute() + +Create a payment method for the given organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + paymentMethodCreateInput := *openapiclient.NewPaymentMethodCreateInput("Name_example", "Nonce_example") // PaymentMethodCreateInput | Payment Method to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.CreatePaymentMethod(context.Background(), id).PaymentMethodCreateInput(paymentMethodCreateInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.CreatePaymentMethod``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreatePaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.CreatePaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePaymentMethodRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **paymentMethodCreateInput** | [**PaymentMethodCreateInput**](PaymentMethodCreateInput.md) | Payment Method to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteOrganization + +> DeleteOrganization(ctx, id).Execute() + +Delete the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OrganizationsApi.DeleteOrganization(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.DeleteOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOperatingSystemsByOrganization + +> OperatingSystemList FindOperatingSystemsByOrganization(ctx, id).Include(include).Execute() + +Retrieve all operating systems visible by the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOperatingSystemsByOrganization(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOperatingSystemsByOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOperatingSystemsByOrganization`: OperatingSystemList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOperatingSystemsByOrganization`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOperatingSystemsByOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**OperatingSystemList**](OperatingSystemList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationById + +> Organization FindOrganizationById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve an organization's details + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizationById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationById`: Organization + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizationById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationCustomdata + +> FindOrganizationCustomdata(ctx, id).Execute() + +Retrieve the custom metadata of an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.OrganizationsApi.FindOrganizationCustomdata(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationInvitations + +> InvitationList FindOrganizationInvitations(ctx, id).Include(include).Page(page).PerPage(perPage).Execute() + +Retrieve organization invitations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizationInvitations(context.Background(), id).Include(include).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationInvitations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationInvitations`: InvitationList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizationInvitations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationInvitationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationPaymentMethods + +> PaymentMethodList FindOrganizationPaymentMethods(ctx, id).Include(include).Page(page).PerPage(perPage).Execute() + +Retrieve all payment methods of an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizationPaymentMethods(context.Background(), id).Include(include).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationPaymentMethods``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationPaymentMethods`: PaymentMethodList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizationPaymentMethods`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationPaymentMethodsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**PaymentMethodList**](PaymentMethodList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationProjects + +> ProjectList FindOrganizationProjects(ctx, id).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all projects of an organization + + +FindOrganizationProjects is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + name := "name_example" // string | Filter results by name. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizationProjects(context.Background(), id).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationProjects``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationProjects`: ProjectList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizationProjects`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationProjectsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **name** | **string** | Filter results by name. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**ProjectList**](ProjectList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizationTransfers + +> TransferRequestList FindOrganizationTransfers(ctx, id).Include(include).Execute() + +Retrieve all project transfer requests from or to an organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizationTransfers(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizationTransfers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizationTransfers`: TransferRequestList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizationTransfers`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationTransfersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**TransferRequestList**](TransferRequestList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindOrganizations + +> OrganizationList FindOrganizations(ctx).Personal(personal).WithoutProjects(withoutProjects).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all organizations + + +FindOrganizations is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + personal := openapiclient.findOrganizations_personal_parameter("include") // FindOrganizationsPersonalParameter | Include, exclude or show only personal organizations. (optional) + withoutProjects := openapiclient.findOrganizations_personal_parameter("include") // FindOrganizationsPersonalParameter | Include, exclude or show only organizations that have no projects. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindOrganizations(context.Background()).Personal(personal).WithoutProjects(withoutProjects).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindOrganizations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindOrganizations`: OrganizationList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindOrganizations`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindOrganizationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **personal** | [**FindOrganizationsPersonalParameter**](FindOrganizationsPersonalParameter.md) | Include, exclude or show only personal organizations. | + **withoutProjects** | [**FindOrganizationsPersonalParameter**](FindOrganizationsPersonalParameter.md) | Include, exclude or show only organizations that have no projects. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**OrganizationList**](OrganizationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPlansByOrganization + +> PlanList FindPlansByOrganization(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all plans visible by the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.FindPlansByOrganization(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.FindPlansByOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPlansByOrganization`: PlanList + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.FindPlansByOrganization`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPlansByOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateOrganization + +> Organization UpdateOrganization(ctx, id).OrganizationInput(organizationInput).Include(include).Exclude(exclude).Execute() + +Update the organization + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Organization UUID + organizationInput := *openapiclient.NewOrganizationInput() // OrganizationInput | Organization to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.OrganizationsApi.UpdateOrganization(context.Background(), id).OrganizationInput(organizationInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.UpdateOrganization``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateOrganization`: Organization + fmt.Fprintf(os.Stdout, "Response from `OrganizationsApi.UpdateOrganization`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Organization UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateOrganizationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **organizationInput** | [**OrganizationInput**](OrganizationInput.md) | Organization to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/ParentBlock.md b/services/metalv1/docs/ParentBlock.md new file mode 100644 index 00000000..f3b00ff3 --- /dev/null +++ b/services/metalv1/docs/ParentBlock.md @@ -0,0 +1,134 @@ +# ParentBlock + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cidr** | Pointer to **int32** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] + +## Methods + +### NewParentBlock + +`func NewParentBlock() *ParentBlock` + +NewParentBlock instantiates a new ParentBlock object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewParentBlockWithDefaults + +`func NewParentBlockWithDefaults() *ParentBlock` + +NewParentBlockWithDefaults instantiates a new ParentBlock object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCidr + +`func (o *ParentBlock) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *ParentBlock) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *ParentBlock) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *ParentBlock) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetHref + +`func (o *ParentBlock) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *ParentBlock) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *ParentBlock) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *ParentBlock) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetNetmask + +`func (o *ParentBlock) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *ParentBlock) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *ParentBlock) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *ParentBlock) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *ParentBlock) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *ParentBlock) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *ParentBlock) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *ParentBlock) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Partition.md b/services/metalv1/docs/Partition.md new file mode 100644 index 00000000..7250fcbb --- /dev/null +++ b/services/metalv1/docs/Partition.md @@ -0,0 +1,108 @@ +# Partition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Label** | Pointer to **string** | | [optional] +**Number** | Pointer to **int32** | | [optional] +**Size** | Pointer to **string** | | [optional] + +## Methods + +### NewPartition + +`func NewPartition() *Partition` + +NewPartition instantiates a new Partition object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPartitionWithDefaults + +`func NewPartitionWithDefaults() *Partition` + +NewPartitionWithDefaults instantiates a new Partition object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLabel + +`func (o *Partition) GetLabel() string` + +GetLabel returns the Label field if non-nil, zero value otherwise. + +### GetLabelOk + +`func (o *Partition) GetLabelOk() (*string, bool)` + +GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabel + +`func (o *Partition) SetLabel(v string)` + +SetLabel sets Label field to given value. + +### HasLabel + +`func (o *Partition) HasLabel() bool` + +HasLabel returns a boolean if a field has been set. + +### GetNumber + +`func (o *Partition) GetNumber() int32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *Partition) GetNumberOk() (*int32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumber + +`func (o *Partition) SetNumber(v int32)` + +SetNumber sets Number field to given value. + +### HasNumber + +`func (o *Partition) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### GetSize + +`func (o *Partition) GetSize() string` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *Partition) GetSizeOk() (*string, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *Partition) SetSize(v string)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *Partition) HasSize() bool` + +HasSize returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PasswordResetTokensApi.md b/services/metalv1/docs/PasswordResetTokensApi.md new file mode 100644 index 00000000..5ef865bc --- /dev/null +++ b/services/metalv1/docs/PasswordResetTokensApi.md @@ -0,0 +1,135 @@ +# \PasswordResetTokensApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreatePasswordResetToken**](PasswordResetTokensApi.md#CreatePasswordResetToken) | **Post** /reset-password | Create a password reset token +[**ResetPassword**](PasswordResetTokensApi.md#ResetPassword) | **Delete** /reset-password | Reset current user password + + + +## CreatePasswordResetToken + +> CreatePasswordResetToken(ctx).Email(email).Execute() + +Create a password reset token + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + email := "email_example" // string | Email of user to create password reset token + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PasswordResetTokensApi.CreatePasswordResetToken(context.Background()).Email(email).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PasswordResetTokensApi.CreatePasswordResetToken``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePasswordResetTokenRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **email** | **string** | Email of user to create password reset token | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ResetPassword + +> NewPassword ResetPassword(ctx).Execute() + +Reset current user password + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PasswordResetTokensApi.ResetPassword(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PasswordResetTokensApi.ResetPassword``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ResetPassword`: NewPassword + fmt.Fprintf(os.Stdout, "Response from `PasswordResetTokensApi.ResetPassword`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiResetPasswordRequest struct via the builder pattern + + +### Return type + +[**NewPassword**](NewPassword.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/PaymentMethod.md b/services/metalv1/docs/PaymentMethod.md new file mode 100644 index 00000000..11525387 --- /dev/null +++ b/services/metalv1/docs/PaymentMethod.md @@ -0,0 +1,420 @@ +# PaymentMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingAddress** | Pointer to [**PaymentMethodBillingAddress**](PaymentMethodBillingAddress.md) | | [optional] +**CardType** | Pointer to **string** | | [optional] +**CardholderName** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedByUser** | Pointer to [**Href**](Href.md) | | [optional] +**Default** | Pointer to **bool** | | [optional] +**Email** | Pointer to **string** | | [optional] +**ExpirationMonth** | Pointer to **string** | | [optional] +**ExpirationYear** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Organization** | Pointer to [**Href**](Href.md) | | [optional] +**Projects** | Pointer to [**[]Href**](Href.md) | | [optional] +**Type** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewPaymentMethod + +`func NewPaymentMethod() *PaymentMethod` + +NewPaymentMethod instantiates a new PaymentMethod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodWithDefaults + +`func NewPaymentMethodWithDefaults() *PaymentMethod` + +NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBillingAddress + +`func (o *PaymentMethod) GetBillingAddress() PaymentMethodBillingAddress` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *PaymentMethod) GetBillingAddressOk() (*PaymentMethodBillingAddress, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *PaymentMethod) SetBillingAddress(v PaymentMethodBillingAddress)` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *PaymentMethod) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetCardType + +`func (o *PaymentMethod) GetCardType() string` + +GetCardType returns the CardType field if non-nil, zero value otherwise. + +### GetCardTypeOk + +`func (o *PaymentMethod) GetCardTypeOk() (*string, bool)` + +GetCardTypeOk returns a tuple with the CardType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardType + +`func (o *PaymentMethod) SetCardType(v string)` + +SetCardType sets CardType field to given value. + +### HasCardType + +`func (o *PaymentMethod) HasCardType() bool` + +HasCardType returns a boolean if a field has been set. + +### GetCardholderName + +`func (o *PaymentMethod) GetCardholderName() string` + +GetCardholderName returns the CardholderName field if non-nil, zero value otherwise. + +### GetCardholderNameOk + +`func (o *PaymentMethod) GetCardholderNameOk() (*string, bool)` + +GetCardholderNameOk returns a tuple with the CardholderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardholderName + +`func (o *PaymentMethod) SetCardholderName(v string)` + +SetCardholderName sets CardholderName field to given value. + +### HasCardholderName + +`func (o *PaymentMethod) HasCardholderName() bool` + +HasCardholderName returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *PaymentMethod) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *PaymentMethod) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *PaymentMethod) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *PaymentMethod) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedByUser + +`func (o *PaymentMethod) GetCreatedByUser() Href` + +GetCreatedByUser returns the CreatedByUser field if non-nil, zero value otherwise. + +### GetCreatedByUserOk + +`func (o *PaymentMethod) GetCreatedByUserOk() (*Href, bool)` + +GetCreatedByUserOk returns a tuple with the CreatedByUser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedByUser + +`func (o *PaymentMethod) SetCreatedByUser(v Href)` + +SetCreatedByUser sets CreatedByUser field to given value. + +### HasCreatedByUser + +`func (o *PaymentMethod) HasCreatedByUser() bool` + +HasCreatedByUser returns a boolean if a field has been set. + +### GetDefault + +`func (o *PaymentMethod) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *PaymentMethod) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *PaymentMethod) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *PaymentMethod) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + +### GetEmail + +`func (o *PaymentMethod) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *PaymentMethod) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *PaymentMethod) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *PaymentMethod) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetExpirationMonth + +`func (o *PaymentMethod) GetExpirationMonth() string` + +GetExpirationMonth returns the ExpirationMonth field if non-nil, zero value otherwise. + +### GetExpirationMonthOk + +`func (o *PaymentMethod) GetExpirationMonthOk() (*string, bool)` + +GetExpirationMonthOk returns a tuple with the ExpirationMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationMonth + +`func (o *PaymentMethod) SetExpirationMonth(v string)` + +SetExpirationMonth sets ExpirationMonth field to given value. + +### HasExpirationMonth + +`func (o *PaymentMethod) HasExpirationMonth() bool` + +HasExpirationMonth returns a boolean if a field has been set. + +### GetExpirationYear + +`func (o *PaymentMethod) GetExpirationYear() string` + +GetExpirationYear returns the ExpirationYear field if non-nil, zero value otherwise. + +### GetExpirationYearOk + +`func (o *PaymentMethod) GetExpirationYearOk() (*string, bool)` + +GetExpirationYearOk returns a tuple with the ExpirationYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationYear + +`func (o *PaymentMethod) SetExpirationYear(v string)` + +SetExpirationYear sets ExpirationYear field to given value. + +### HasExpirationYear + +`func (o *PaymentMethod) HasExpirationYear() bool` + +HasExpirationYear returns a boolean if a field has been set. + +### GetId + +`func (o *PaymentMethod) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PaymentMethod) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PaymentMethod) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *PaymentMethod) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *PaymentMethod) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *PaymentMethod) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *PaymentMethod) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *PaymentMethod) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOrganization + +`func (o *PaymentMethod) GetOrganization() Href` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *PaymentMethod) GetOrganizationOk() (*Href, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *PaymentMethod) SetOrganization(v Href)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *PaymentMethod) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetProjects + +`func (o *PaymentMethod) GetProjects() []Href` + +GetProjects returns the Projects field if non-nil, zero value otherwise. + +### GetProjectsOk + +`func (o *PaymentMethod) GetProjectsOk() (*[]Href, bool)` + +GetProjectsOk returns a tuple with the Projects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjects + +`func (o *PaymentMethod) SetProjects(v []Href)` + +SetProjects sets Projects field to given value. + +### HasProjects + +`func (o *PaymentMethod) HasProjects() bool` + +HasProjects returns a boolean if a field has been set. + +### GetType + +`func (o *PaymentMethod) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PaymentMethod) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PaymentMethod) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PaymentMethod) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *PaymentMethod) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *PaymentMethod) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *PaymentMethod) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *PaymentMethod) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PaymentMethodBillingAddress.md b/services/metalv1/docs/PaymentMethodBillingAddress.md new file mode 100644 index 00000000..76977b0c --- /dev/null +++ b/services/metalv1/docs/PaymentMethodBillingAddress.md @@ -0,0 +1,108 @@ +# PaymentMethodBillingAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CountryCodeAlpha2** | Pointer to **string** | | [optional] +**PostalCode** | Pointer to **string** | | [optional] +**StreetAddress** | Pointer to **string** | | [optional] + +## Methods + +### NewPaymentMethodBillingAddress + +`func NewPaymentMethodBillingAddress() *PaymentMethodBillingAddress` + +NewPaymentMethodBillingAddress instantiates a new PaymentMethodBillingAddress object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodBillingAddressWithDefaults + +`func NewPaymentMethodBillingAddressWithDefaults() *PaymentMethodBillingAddress` + +NewPaymentMethodBillingAddressWithDefaults instantiates a new PaymentMethodBillingAddress object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCountryCodeAlpha2 + +`func (o *PaymentMethodBillingAddress) GetCountryCodeAlpha2() string` + +GetCountryCodeAlpha2 returns the CountryCodeAlpha2 field if non-nil, zero value otherwise. + +### GetCountryCodeAlpha2Ok + +`func (o *PaymentMethodBillingAddress) GetCountryCodeAlpha2Ok() (*string, bool)` + +GetCountryCodeAlpha2Ok returns a tuple with the CountryCodeAlpha2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryCodeAlpha2 + +`func (o *PaymentMethodBillingAddress) SetCountryCodeAlpha2(v string)` + +SetCountryCodeAlpha2 sets CountryCodeAlpha2 field to given value. + +### HasCountryCodeAlpha2 + +`func (o *PaymentMethodBillingAddress) HasCountryCodeAlpha2() bool` + +HasCountryCodeAlpha2 returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *PaymentMethodBillingAddress) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *PaymentMethodBillingAddress) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *PaymentMethodBillingAddress) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *PaymentMethodBillingAddress) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + +### GetStreetAddress + +`func (o *PaymentMethodBillingAddress) GetStreetAddress() string` + +GetStreetAddress returns the StreetAddress field if non-nil, zero value otherwise. + +### GetStreetAddressOk + +`func (o *PaymentMethodBillingAddress) GetStreetAddressOk() (*string, bool)` + +GetStreetAddressOk returns a tuple with the StreetAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStreetAddress + +`func (o *PaymentMethodBillingAddress) SetStreetAddress(v string)` + +SetStreetAddress sets StreetAddress field to given value. + +### HasStreetAddress + +`func (o *PaymentMethodBillingAddress) HasStreetAddress() bool` + +HasStreetAddress returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PaymentMethodCreateInput.md b/services/metalv1/docs/PaymentMethodCreateInput.md new file mode 100644 index 00000000..09ea0587 --- /dev/null +++ b/services/metalv1/docs/PaymentMethodCreateInput.md @@ -0,0 +1,98 @@ +# PaymentMethodCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Default** | Pointer to **bool** | | [optional] +**Name** | **string** | | +**Nonce** | **string** | | + +## Methods + +### NewPaymentMethodCreateInput + +`func NewPaymentMethodCreateInput(name string, nonce string, ) *PaymentMethodCreateInput` + +NewPaymentMethodCreateInput instantiates a new PaymentMethodCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodCreateInputWithDefaults + +`func NewPaymentMethodCreateInputWithDefaults() *PaymentMethodCreateInput` + +NewPaymentMethodCreateInputWithDefaults instantiates a new PaymentMethodCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDefault + +`func (o *PaymentMethodCreateInput) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *PaymentMethodCreateInput) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *PaymentMethodCreateInput) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *PaymentMethodCreateInput) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + +### GetName + +`func (o *PaymentMethodCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *PaymentMethodCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *PaymentMethodCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNonce + +`func (o *PaymentMethodCreateInput) GetNonce() string` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *PaymentMethodCreateInput) GetNonceOk() (*string, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *PaymentMethodCreateInput) SetNonce(v string)` + +SetNonce sets Nonce field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PaymentMethodList.md b/services/metalv1/docs/PaymentMethodList.md new file mode 100644 index 00000000..1cb6fe37 --- /dev/null +++ b/services/metalv1/docs/PaymentMethodList.md @@ -0,0 +1,56 @@ +# PaymentMethodList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PaymentMethods** | Pointer to [**[]PaymentMethod**](PaymentMethod.md) | | [optional] + +## Methods + +### NewPaymentMethodList + +`func NewPaymentMethodList() *PaymentMethodList` + +NewPaymentMethodList instantiates a new PaymentMethodList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodListWithDefaults + +`func NewPaymentMethodListWithDefaults() *PaymentMethodList` + +NewPaymentMethodListWithDefaults instantiates a new PaymentMethodList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPaymentMethods + +`func (o *PaymentMethodList) GetPaymentMethods() []PaymentMethod` + +GetPaymentMethods returns the PaymentMethods field if non-nil, zero value otherwise. + +### GetPaymentMethodsOk + +`func (o *PaymentMethodList) GetPaymentMethodsOk() (*[]PaymentMethod, bool)` + +GetPaymentMethodsOk returns a tuple with the PaymentMethods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethods + +`func (o *PaymentMethodList) SetPaymentMethods(v []PaymentMethod)` + +SetPaymentMethods sets PaymentMethods field to given value. + +### HasPaymentMethods + +`func (o *PaymentMethodList) HasPaymentMethods() bool` + +HasPaymentMethods returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PaymentMethodUpdateInput.md b/services/metalv1/docs/PaymentMethodUpdateInput.md new file mode 100644 index 00000000..ff5c68ae --- /dev/null +++ b/services/metalv1/docs/PaymentMethodUpdateInput.md @@ -0,0 +1,186 @@ +# PaymentMethodUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingAddress** | Pointer to **map[string]interface{}** | | [optional] +**CardholderName** | Pointer to **string** | | [optional] +**Default** | Pointer to **bool** | | [optional] +**ExpirationMonth** | Pointer to **string** | | [optional] +**ExpirationYear** | Pointer to **int32** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewPaymentMethodUpdateInput + +`func NewPaymentMethodUpdateInput() *PaymentMethodUpdateInput` + +NewPaymentMethodUpdateInput instantiates a new PaymentMethodUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodUpdateInputWithDefaults + +`func NewPaymentMethodUpdateInputWithDefaults() *PaymentMethodUpdateInput` + +NewPaymentMethodUpdateInputWithDefaults instantiates a new PaymentMethodUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBillingAddress + +`func (o *PaymentMethodUpdateInput) GetBillingAddress() map[string]interface{}` + +GetBillingAddress returns the BillingAddress field if non-nil, zero value otherwise. + +### GetBillingAddressOk + +`func (o *PaymentMethodUpdateInput) GetBillingAddressOk() (*map[string]interface{}, bool)` + +GetBillingAddressOk returns a tuple with the BillingAddress field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingAddress + +`func (o *PaymentMethodUpdateInput) SetBillingAddress(v map[string]interface{})` + +SetBillingAddress sets BillingAddress field to given value. + +### HasBillingAddress + +`func (o *PaymentMethodUpdateInput) HasBillingAddress() bool` + +HasBillingAddress returns a boolean if a field has been set. + +### GetCardholderName + +`func (o *PaymentMethodUpdateInput) GetCardholderName() string` + +GetCardholderName returns the CardholderName field if non-nil, zero value otherwise. + +### GetCardholderNameOk + +`func (o *PaymentMethodUpdateInput) GetCardholderNameOk() (*string, bool)` + +GetCardholderNameOk returns a tuple with the CardholderName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCardholderName + +`func (o *PaymentMethodUpdateInput) SetCardholderName(v string)` + +SetCardholderName sets CardholderName field to given value. + +### HasCardholderName + +`func (o *PaymentMethodUpdateInput) HasCardholderName() bool` + +HasCardholderName returns a boolean if a field has been set. + +### GetDefault + +`func (o *PaymentMethodUpdateInput) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *PaymentMethodUpdateInput) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *PaymentMethodUpdateInput) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *PaymentMethodUpdateInput) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + +### GetExpirationMonth + +`func (o *PaymentMethodUpdateInput) GetExpirationMonth() string` + +GetExpirationMonth returns the ExpirationMonth field if non-nil, zero value otherwise. + +### GetExpirationMonthOk + +`func (o *PaymentMethodUpdateInput) GetExpirationMonthOk() (*string, bool)` + +GetExpirationMonthOk returns a tuple with the ExpirationMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationMonth + +`func (o *PaymentMethodUpdateInput) SetExpirationMonth(v string)` + +SetExpirationMonth sets ExpirationMonth field to given value. + +### HasExpirationMonth + +`func (o *PaymentMethodUpdateInput) HasExpirationMonth() bool` + +HasExpirationMonth returns a boolean if a field has been set. + +### GetExpirationYear + +`func (o *PaymentMethodUpdateInput) GetExpirationYear() int32` + +GetExpirationYear returns the ExpirationYear field if non-nil, zero value otherwise. + +### GetExpirationYearOk + +`func (o *PaymentMethodUpdateInput) GetExpirationYearOk() (*int32, bool)` + +GetExpirationYearOk returns a tuple with the ExpirationYear field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirationYear + +`func (o *PaymentMethodUpdateInput) SetExpirationYear(v int32)` + +SetExpirationYear sets ExpirationYear field to given value. + +### HasExpirationYear + +`func (o *PaymentMethodUpdateInput) HasExpirationYear() bool` + +HasExpirationYear returns a boolean if a field has been set. + +### GetName + +`func (o *PaymentMethodUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *PaymentMethodUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *PaymentMethodUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *PaymentMethodUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PaymentMethodsApi.md b/services/metalv1/docs/PaymentMethodsApi.md new file mode 100644 index 00000000..f8ac7a04 --- /dev/null +++ b/services/metalv1/docs/PaymentMethodsApi.md @@ -0,0 +1,225 @@ +# \PaymentMethodsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeletePaymentMethod**](PaymentMethodsApi.md#DeletePaymentMethod) | **Delete** /payment-methods/{id} | Delete the payment method +[**FindPaymentMethodById**](PaymentMethodsApi.md#FindPaymentMethodById) | **Get** /payment-methods/{id} | Retrieve a payment method +[**UpdatePaymentMethod**](PaymentMethodsApi.md#UpdatePaymentMethod) | **Put** /payment-methods/{id} | Update the payment method + + + +## DeletePaymentMethod + +> DeletePaymentMethod(ctx, id).Execute() + +Delete the payment method + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Payment Method UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PaymentMethodsApi.DeletePaymentMethod(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodsApi.DeletePaymentMethod``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Payment Method UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeletePaymentMethodRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPaymentMethodById + +> PaymentMethod FindPaymentMethodById(ctx, id).Include(include).Execute() + +Retrieve a payment method + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Payment Method UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PaymentMethodsApi.FindPaymentMethodById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodsApi.FindPaymentMethodById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPaymentMethodById`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodsApi.FindPaymentMethodById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Payment Method UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPaymentMethodByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdatePaymentMethod + +> PaymentMethod UpdatePaymentMethod(ctx, id).PaymentMethodUpdateInput(paymentMethodUpdateInput).Include(include).Execute() + +Update the payment method + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Payment Method UUID + paymentMethodUpdateInput := *openapiclient.NewPaymentMethodUpdateInput() // PaymentMethodUpdateInput | Payment Method to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PaymentMethodsApi.UpdatePaymentMethod(context.Background(), id).PaymentMethodUpdateInput(paymentMethodUpdateInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PaymentMethodsApi.UpdatePaymentMethod``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdatePaymentMethod`: PaymentMethod + fmt.Fprintf(os.Stdout, "Response from `PaymentMethodsApi.UpdatePaymentMethod`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Payment Method UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdatePaymentMethodRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **paymentMethodUpdateInput** | [**PaymentMethodUpdateInput**](PaymentMethodUpdateInput.md) | Payment Method to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**PaymentMethod**](PaymentMethod.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Plan.md b/services/metalv1/docs/Plan.md new file mode 100644 index 00000000..2411bfd4 --- /dev/null +++ b/services/metalv1/docs/Plan.md @@ -0,0 +1,394 @@ +# Plan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvailableIn** | Pointer to [**[]PlanAvailableInInner**](PlanAvailableInInner.md) | Shows which facilities the plan is available in, and the facility-based price if it is different from the default price. | [optional] +**AvailableInMetros** | Pointer to [**[]PlanAvailableInMetrosInner**](PlanAvailableInMetrosInner.md) | Shows which metros the plan is available in, and the metro-based price if it is different from the default price. | [optional] +**Categories** | Pointer to **[]string** | Categories of the plan, like compute or storage. A Plan can belong to multiple categories. | [optional] +**Class** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | | [optional] +**DeploymentTypes** | Pointer to [**[]PlanDeploymentTypesInner**](PlanDeploymentTypesInner.md) | | [optional] +**Id** | Pointer to **string** | | [optional] +**Legacy** | Pointer to **bool** | Deprecated. Always return false | [optional] +**Line** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Pricing** | Pointer to **map[string]interface{}** | | [optional] +**Slug** | Pointer to **string** | | [optional] +**Specs** | Pointer to [**PlanSpecs**](PlanSpecs.md) | | [optional] +**Type** | Pointer to [**PlanType**](PlanType.md) | | [optional] + +## Methods + +### NewPlan + +`func NewPlan() *Plan` + +NewPlan instantiates a new Plan object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanWithDefaults + +`func NewPlanWithDefaults() *Plan` + +NewPlanWithDefaults instantiates a new Plan object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvailableIn + +`func (o *Plan) GetAvailableIn() []PlanAvailableInInner` + +GetAvailableIn returns the AvailableIn field if non-nil, zero value otherwise. + +### GetAvailableInOk + +`func (o *Plan) GetAvailableInOk() (*[]PlanAvailableInInner, bool)` + +GetAvailableInOk returns a tuple with the AvailableIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableIn + +`func (o *Plan) SetAvailableIn(v []PlanAvailableInInner)` + +SetAvailableIn sets AvailableIn field to given value. + +### HasAvailableIn + +`func (o *Plan) HasAvailableIn() bool` + +HasAvailableIn returns a boolean if a field has been set. + +### GetAvailableInMetros + +`func (o *Plan) GetAvailableInMetros() []PlanAvailableInMetrosInner` + +GetAvailableInMetros returns the AvailableInMetros field if non-nil, zero value otherwise. + +### GetAvailableInMetrosOk + +`func (o *Plan) GetAvailableInMetrosOk() (*[]PlanAvailableInMetrosInner, bool)` + +GetAvailableInMetrosOk returns a tuple with the AvailableInMetros field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableInMetros + +`func (o *Plan) SetAvailableInMetros(v []PlanAvailableInMetrosInner)` + +SetAvailableInMetros sets AvailableInMetros field to given value. + +### HasAvailableInMetros + +`func (o *Plan) HasAvailableInMetros() bool` + +HasAvailableInMetros returns a boolean if a field has been set. + +### GetCategories + +`func (o *Plan) GetCategories() []string` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *Plan) GetCategoriesOk() (*[]string, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *Plan) SetCategories(v []string)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *Plan) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + +### GetClass + +`func (o *Plan) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Plan) GetClassOk() (*string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClass + +`func (o *Plan) SetClass(v string)` + +SetClass sets Class field to given value. + +### HasClass + +`func (o *Plan) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### GetDescription + +`func (o *Plan) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Plan) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Plan) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Plan) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetDeploymentTypes + +`func (o *Plan) GetDeploymentTypes() []PlanDeploymentTypesInner` + +GetDeploymentTypes returns the DeploymentTypes field if non-nil, zero value otherwise. + +### GetDeploymentTypesOk + +`func (o *Plan) GetDeploymentTypesOk() (*[]PlanDeploymentTypesInner, bool)` + +GetDeploymentTypesOk returns a tuple with the DeploymentTypes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeploymentTypes + +`func (o *Plan) SetDeploymentTypes(v []PlanDeploymentTypesInner)` + +SetDeploymentTypes sets DeploymentTypes field to given value. + +### HasDeploymentTypes + +`func (o *Plan) HasDeploymentTypes() bool` + +HasDeploymentTypes returns a boolean if a field has been set. + +### GetId + +`func (o *Plan) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Plan) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Plan) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Plan) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLegacy + +`func (o *Plan) GetLegacy() bool` + +GetLegacy returns the Legacy field if non-nil, zero value otherwise. + +### GetLegacyOk + +`func (o *Plan) GetLegacyOk() (*bool, bool)` + +GetLegacyOk returns a tuple with the Legacy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLegacy + +`func (o *Plan) SetLegacy(v bool)` + +SetLegacy sets Legacy field to given value. + +### HasLegacy + +`func (o *Plan) HasLegacy() bool` + +HasLegacy returns a boolean if a field has been set. + +### GetLine + +`func (o *Plan) GetLine() string` + +GetLine returns the Line field if non-nil, zero value otherwise. + +### GetLineOk + +`func (o *Plan) GetLineOk() (*string, bool)` + +GetLineOk returns a tuple with the Line field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLine + +`func (o *Plan) SetLine(v string)` + +SetLine sets Line field to given value. + +### HasLine + +`func (o *Plan) HasLine() bool` + +HasLine returns a boolean if a field has been set. + +### GetName + +`func (o *Plan) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Plan) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Plan) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Plan) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPricing + +`func (o *Plan) GetPricing() map[string]interface{}` + +GetPricing returns the Pricing field if non-nil, zero value otherwise. + +### GetPricingOk + +`func (o *Plan) GetPricingOk() (*map[string]interface{}, bool)` + +GetPricingOk returns a tuple with the Pricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricing + +`func (o *Plan) SetPricing(v map[string]interface{})` + +SetPricing sets Pricing field to given value. + +### HasPricing + +`func (o *Plan) HasPricing() bool` + +HasPricing returns a boolean if a field has been set. + +### GetSlug + +`func (o *Plan) GetSlug() string` + +GetSlug returns the Slug field if non-nil, zero value otherwise. + +### GetSlugOk + +`func (o *Plan) GetSlugOk() (*string, bool)` + +GetSlugOk returns a tuple with the Slug field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSlug + +`func (o *Plan) SetSlug(v string)` + +SetSlug sets Slug field to given value. + +### HasSlug + +`func (o *Plan) HasSlug() bool` + +HasSlug returns a boolean if a field has been set. + +### GetSpecs + +`func (o *Plan) GetSpecs() PlanSpecs` + +GetSpecs returns the Specs field if non-nil, zero value otherwise. + +### GetSpecsOk + +`func (o *Plan) GetSpecsOk() (*PlanSpecs, bool)` + +GetSpecsOk returns a tuple with the Specs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecs + +`func (o *Plan) SetSpecs(v PlanSpecs)` + +SetSpecs sets Specs field to given value. + +### HasSpecs + +`func (o *Plan) HasSpecs() bool` + +HasSpecs returns a boolean if a field has been set. + +### GetType + +`func (o *Plan) GetType() PlanType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Plan) GetTypeOk() (*PlanType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Plan) SetType(v PlanType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Plan) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanAvailableInInner.md b/services/metalv1/docs/PlanAvailableInInner.md new file mode 100644 index 00000000..78f907ac --- /dev/null +++ b/services/metalv1/docs/PlanAvailableInInner.md @@ -0,0 +1,82 @@ +# PlanAvailableInInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | Pointer to **string** | href to the Facility | [optional] +**Price** | Pointer to [**PlanAvailableInInnerPrice**](PlanAvailableInInnerPrice.md) | | [optional] + +## Methods + +### NewPlanAvailableInInner + +`func NewPlanAvailableInInner() *PlanAvailableInInner` + +NewPlanAvailableInInner instantiates a new PlanAvailableInInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanAvailableInInnerWithDefaults + +`func NewPlanAvailableInInnerWithDefaults() *PlanAvailableInInner` + +NewPlanAvailableInInnerWithDefaults instantiates a new PlanAvailableInInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *PlanAvailableInInner) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PlanAvailableInInner) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PlanAvailableInInner) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PlanAvailableInInner) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetPrice + +`func (o *PlanAvailableInInner) GetPrice() PlanAvailableInInnerPrice` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *PlanAvailableInInner) GetPriceOk() (*PlanAvailableInInnerPrice, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *PlanAvailableInInner) SetPrice(v PlanAvailableInInnerPrice)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *PlanAvailableInInner) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanAvailableInInnerPrice.md b/services/metalv1/docs/PlanAvailableInInnerPrice.md new file mode 100644 index 00000000..985ef5b4 --- /dev/null +++ b/services/metalv1/docs/PlanAvailableInInnerPrice.md @@ -0,0 +1,56 @@ +# PlanAvailableInInnerPrice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Hour** | Pointer to **float64** | | [optional] + +## Methods + +### NewPlanAvailableInInnerPrice + +`func NewPlanAvailableInInnerPrice() *PlanAvailableInInnerPrice` + +NewPlanAvailableInInnerPrice instantiates a new PlanAvailableInInnerPrice object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanAvailableInInnerPriceWithDefaults + +`func NewPlanAvailableInInnerPriceWithDefaults() *PlanAvailableInInnerPrice` + +NewPlanAvailableInInnerPriceWithDefaults instantiates a new PlanAvailableInInnerPrice object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHour + +`func (o *PlanAvailableInInnerPrice) GetHour() float64` + +GetHour returns the Hour field if non-nil, zero value otherwise. + +### GetHourOk + +`func (o *PlanAvailableInInnerPrice) GetHourOk() (*float64, bool)` + +GetHourOk returns a tuple with the Hour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHour + +`func (o *PlanAvailableInInnerPrice) SetHour(v float64)` + +SetHour sets Hour field to given value. + +### HasHour + +`func (o *PlanAvailableInInnerPrice) HasHour() bool` + +HasHour returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanAvailableInMetrosInner.md b/services/metalv1/docs/PlanAvailableInMetrosInner.md new file mode 100644 index 00000000..126d181e --- /dev/null +++ b/services/metalv1/docs/PlanAvailableInMetrosInner.md @@ -0,0 +1,82 @@ +# PlanAvailableInMetrosInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Href** | Pointer to **string** | href to the Metro | [optional] +**Price** | Pointer to [**PlanAvailableInInnerPrice**](PlanAvailableInInnerPrice.md) | | [optional] + +## Methods + +### NewPlanAvailableInMetrosInner + +`func NewPlanAvailableInMetrosInner() *PlanAvailableInMetrosInner` + +NewPlanAvailableInMetrosInner instantiates a new PlanAvailableInMetrosInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanAvailableInMetrosInnerWithDefaults + +`func NewPlanAvailableInMetrosInnerWithDefaults() *PlanAvailableInMetrosInner` + +NewPlanAvailableInMetrosInnerWithDefaults instantiates a new PlanAvailableInMetrosInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetHref + +`func (o *PlanAvailableInMetrosInner) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *PlanAvailableInMetrosInner) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *PlanAvailableInMetrosInner) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *PlanAvailableInMetrosInner) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetPrice + +`func (o *PlanAvailableInMetrosInner) GetPrice() PlanAvailableInInnerPrice` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *PlanAvailableInMetrosInner) GetPriceOk() (*PlanAvailableInInnerPrice, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *PlanAvailableInMetrosInner) SetPrice(v PlanAvailableInInnerPrice)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *PlanAvailableInMetrosInner) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanDeploymentTypesInner.md b/services/metalv1/docs/PlanDeploymentTypesInner.md new file mode 100644 index 00000000..60556b24 --- /dev/null +++ b/services/metalv1/docs/PlanDeploymentTypesInner.md @@ -0,0 +1,13 @@ +# PlanDeploymentTypesInner + +## Enum + + +* `ON_DEMAND` (value: `"on_demand"`) + +* `SPOT_MARKET` (value: `"spot_market"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanList.md b/services/metalv1/docs/PlanList.md new file mode 100644 index 00000000..133a86ba --- /dev/null +++ b/services/metalv1/docs/PlanList.md @@ -0,0 +1,56 @@ +# PlanList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Plans** | Pointer to [**[]Plan**](Plan.md) | | [optional] + +## Methods + +### NewPlanList + +`func NewPlanList() *PlanList` + +NewPlanList instantiates a new PlanList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanListWithDefaults + +`func NewPlanListWithDefaults() *PlanList` + +NewPlanListWithDefaults instantiates a new PlanList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPlans + +`func (o *PlanList) GetPlans() []Plan` + +GetPlans returns the Plans field if non-nil, zero value otherwise. + +### GetPlansOk + +`func (o *PlanList) GetPlansOk() (*[]Plan, bool)` + +GetPlansOk returns a tuple with the Plans field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlans + +`func (o *PlanList) SetPlans(v []Plan)` + +SetPlans sets Plans field to given value. + +### HasPlans + +`func (o *PlanList) HasPlans() bool` + +HasPlans returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecs.md b/services/metalv1/docs/PlanSpecs.md new file mode 100644 index 00000000..53b179fc --- /dev/null +++ b/services/metalv1/docs/PlanSpecs.md @@ -0,0 +1,160 @@ +# PlanSpecs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cpus** | Pointer to [**[]PlanSpecsCpusInner**](PlanSpecsCpusInner.md) | | [optional] +**Memory** | Pointer to [**PlanSpecsMemory**](PlanSpecsMemory.md) | | [optional] +**Drives** | Pointer to [**[]PlanSpecsDrivesInner**](PlanSpecsDrivesInner.md) | | [optional] +**Nics** | Pointer to [**[]PlanSpecsNicsInner**](PlanSpecsNicsInner.md) | | [optional] +**Features** | Pointer to [**PlanSpecsFeatures**](PlanSpecsFeatures.md) | | [optional] + +## Methods + +### NewPlanSpecs + +`func NewPlanSpecs() *PlanSpecs` + +NewPlanSpecs instantiates a new PlanSpecs object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsWithDefaults + +`func NewPlanSpecsWithDefaults() *PlanSpecs` + +NewPlanSpecsWithDefaults instantiates a new PlanSpecs object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCpus + +`func (o *PlanSpecs) GetCpus() []PlanSpecsCpusInner` + +GetCpus returns the Cpus field if non-nil, zero value otherwise. + +### GetCpusOk + +`func (o *PlanSpecs) GetCpusOk() (*[]PlanSpecsCpusInner, bool)` + +GetCpusOk returns a tuple with the Cpus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCpus + +`func (o *PlanSpecs) SetCpus(v []PlanSpecsCpusInner)` + +SetCpus sets Cpus field to given value. + +### HasCpus + +`func (o *PlanSpecs) HasCpus() bool` + +HasCpus returns a boolean if a field has been set. + +### GetMemory + +`func (o *PlanSpecs) GetMemory() PlanSpecsMemory` + +GetMemory returns the Memory field if non-nil, zero value otherwise. + +### GetMemoryOk + +`func (o *PlanSpecs) GetMemoryOk() (*PlanSpecsMemory, bool)` + +GetMemoryOk returns a tuple with the Memory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemory + +`func (o *PlanSpecs) SetMemory(v PlanSpecsMemory)` + +SetMemory sets Memory field to given value. + +### HasMemory + +`func (o *PlanSpecs) HasMemory() bool` + +HasMemory returns a boolean if a field has been set. + +### GetDrives + +`func (o *PlanSpecs) GetDrives() []PlanSpecsDrivesInner` + +GetDrives returns the Drives field if non-nil, zero value otherwise. + +### GetDrivesOk + +`func (o *PlanSpecs) GetDrivesOk() (*[]PlanSpecsDrivesInner, bool)` + +GetDrivesOk returns a tuple with the Drives field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDrives + +`func (o *PlanSpecs) SetDrives(v []PlanSpecsDrivesInner)` + +SetDrives sets Drives field to given value. + +### HasDrives + +`func (o *PlanSpecs) HasDrives() bool` + +HasDrives returns a boolean if a field has been set. + +### GetNics + +`func (o *PlanSpecs) GetNics() []PlanSpecsNicsInner` + +GetNics returns the Nics field if non-nil, zero value otherwise. + +### GetNicsOk + +`func (o *PlanSpecs) GetNicsOk() (*[]PlanSpecsNicsInner, bool)` + +GetNicsOk returns a tuple with the Nics field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNics + +`func (o *PlanSpecs) SetNics(v []PlanSpecsNicsInner)` + +SetNics sets Nics field to given value. + +### HasNics + +`func (o *PlanSpecs) HasNics() bool` + +HasNics returns a boolean if a field has been set. + +### GetFeatures + +`func (o *PlanSpecs) GetFeatures() PlanSpecsFeatures` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *PlanSpecs) GetFeaturesOk() (*PlanSpecsFeatures, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *PlanSpecs) SetFeatures(v PlanSpecsFeatures)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *PlanSpecs) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsCpusInner.md b/services/metalv1/docs/PlanSpecsCpusInner.md new file mode 100644 index 00000000..624953af --- /dev/null +++ b/services/metalv1/docs/PlanSpecsCpusInner.md @@ -0,0 +1,82 @@ +# PlanSpecsCpusInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] + +## Methods + +### NewPlanSpecsCpusInner + +`func NewPlanSpecsCpusInner() *PlanSpecsCpusInner` + +NewPlanSpecsCpusInner instantiates a new PlanSpecsCpusInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsCpusInnerWithDefaults + +`func NewPlanSpecsCpusInnerWithDefaults() *PlanSpecsCpusInner` + +NewPlanSpecsCpusInnerWithDefaults instantiates a new PlanSpecsCpusInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCount + +`func (o *PlanSpecsCpusInner) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *PlanSpecsCpusInner) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *PlanSpecsCpusInner) SetCount(v int32)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *PlanSpecsCpusInner) HasCount() bool` + +HasCount returns a boolean if a field has been set. + +### GetType + +`func (o *PlanSpecsCpusInner) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PlanSpecsCpusInner) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PlanSpecsCpusInner) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PlanSpecsCpusInner) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsDrivesInner.md b/services/metalv1/docs/PlanSpecsDrivesInner.md new file mode 100644 index 00000000..ddf0e14c --- /dev/null +++ b/services/metalv1/docs/PlanSpecsDrivesInner.md @@ -0,0 +1,134 @@ +# PlanSpecsDrivesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Size** | Pointer to **string** | | [optional] +**Category** | Pointer to [**PlanSpecsDrivesInnerCategory**](PlanSpecsDrivesInnerCategory.md) | | [optional] + +## Methods + +### NewPlanSpecsDrivesInner + +`func NewPlanSpecsDrivesInner() *PlanSpecsDrivesInner` + +NewPlanSpecsDrivesInner instantiates a new PlanSpecsDrivesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsDrivesInnerWithDefaults + +`func NewPlanSpecsDrivesInnerWithDefaults() *PlanSpecsDrivesInner` + +NewPlanSpecsDrivesInnerWithDefaults instantiates a new PlanSpecsDrivesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCount + +`func (o *PlanSpecsDrivesInner) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *PlanSpecsDrivesInner) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *PlanSpecsDrivesInner) SetCount(v int32)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *PlanSpecsDrivesInner) HasCount() bool` + +HasCount returns a boolean if a field has been set. + +### GetType + +`func (o *PlanSpecsDrivesInner) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PlanSpecsDrivesInner) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PlanSpecsDrivesInner) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PlanSpecsDrivesInner) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetSize + +`func (o *PlanSpecsDrivesInner) GetSize() string` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *PlanSpecsDrivesInner) GetSizeOk() (*string, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *PlanSpecsDrivesInner) SetSize(v string)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *PlanSpecsDrivesInner) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetCategory + +`func (o *PlanSpecsDrivesInner) GetCategory() PlanSpecsDrivesInnerCategory` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *PlanSpecsDrivesInner) GetCategoryOk() (*PlanSpecsDrivesInnerCategory, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *PlanSpecsDrivesInner) SetCategory(v PlanSpecsDrivesInnerCategory)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *PlanSpecsDrivesInner) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsDrivesInnerCategory.md b/services/metalv1/docs/PlanSpecsDrivesInnerCategory.md new file mode 100644 index 00000000..91f05852 --- /dev/null +++ b/services/metalv1/docs/PlanSpecsDrivesInnerCategory.md @@ -0,0 +1,15 @@ +# PlanSpecsDrivesInnerCategory + +## Enum + + +* `BOOT` (value: `"boot"`) + +* `CACHE` (value: `"cache"`) + +* `STORAGE` (value: `"storage"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsFeatures.md b/services/metalv1/docs/PlanSpecsFeatures.md new file mode 100644 index 00000000..6a16fca2 --- /dev/null +++ b/services/metalv1/docs/PlanSpecsFeatures.md @@ -0,0 +1,108 @@ +# PlanSpecsFeatures + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Raid** | Pointer to **bool** | | [optional] +**Txt** | Pointer to **bool** | | [optional] +**Uefi** | Pointer to **bool** | | [optional] + +## Methods + +### NewPlanSpecsFeatures + +`func NewPlanSpecsFeatures() *PlanSpecsFeatures` + +NewPlanSpecsFeatures instantiates a new PlanSpecsFeatures object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsFeaturesWithDefaults + +`func NewPlanSpecsFeaturesWithDefaults() *PlanSpecsFeatures` + +NewPlanSpecsFeaturesWithDefaults instantiates a new PlanSpecsFeatures object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRaid + +`func (o *PlanSpecsFeatures) GetRaid() bool` + +GetRaid returns the Raid field if non-nil, zero value otherwise. + +### GetRaidOk + +`func (o *PlanSpecsFeatures) GetRaidOk() (*bool, bool)` + +GetRaidOk returns a tuple with the Raid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRaid + +`func (o *PlanSpecsFeatures) SetRaid(v bool)` + +SetRaid sets Raid field to given value. + +### HasRaid + +`func (o *PlanSpecsFeatures) HasRaid() bool` + +HasRaid returns a boolean if a field has been set. + +### GetTxt + +`func (o *PlanSpecsFeatures) GetTxt() bool` + +GetTxt returns the Txt field if non-nil, zero value otherwise. + +### GetTxtOk + +`func (o *PlanSpecsFeatures) GetTxtOk() (*bool, bool)` + +GetTxtOk returns a tuple with the Txt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTxt + +`func (o *PlanSpecsFeatures) SetTxt(v bool)` + +SetTxt sets Txt field to given value. + +### HasTxt + +`func (o *PlanSpecsFeatures) HasTxt() bool` + +HasTxt returns a boolean if a field has been set. + +### GetUefi + +`func (o *PlanSpecsFeatures) GetUefi() bool` + +GetUefi returns the Uefi field if non-nil, zero value otherwise. + +### GetUefiOk + +`func (o *PlanSpecsFeatures) GetUefiOk() (*bool, bool)` + +GetUefiOk returns a tuple with the Uefi field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUefi + +`func (o *PlanSpecsFeatures) SetUefi(v bool)` + +SetUefi sets Uefi field to given value. + +### HasUefi + +`func (o *PlanSpecsFeatures) HasUefi() bool` + +HasUefi returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsMemory.md b/services/metalv1/docs/PlanSpecsMemory.md new file mode 100644 index 00000000..fcb9200a --- /dev/null +++ b/services/metalv1/docs/PlanSpecsMemory.md @@ -0,0 +1,56 @@ +# PlanSpecsMemory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Total** | Pointer to **string** | | [optional] + +## Methods + +### NewPlanSpecsMemory + +`func NewPlanSpecsMemory() *PlanSpecsMemory` + +NewPlanSpecsMemory instantiates a new PlanSpecsMemory object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsMemoryWithDefaults + +`func NewPlanSpecsMemoryWithDefaults() *PlanSpecsMemory` + +NewPlanSpecsMemoryWithDefaults instantiates a new PlanSpecsMemory object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotal + +`func (o *PlanSpecsMemory) GetTotal() string` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *PlanSpecsMemory) GetTotalOk() (*string, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *PlanSpecsMemory) SetTotal(v string)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *PlanSpecsMemory) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanSpecsNicsInner.md b/services/metalv1/docs/PlanSpecsNicsInner.md new file mode 100644 index 00000000..ede9901e --- /dev/null +++ b/services/metalv1/docs/PlanSpecsNicsInner.md @@ -0,0 +1,82 @@ +# PlanSpecsNicsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] + +## Methods + +### NewPlanSpecsNicsInner + +`func NewPlanSpecsNicsInner() *PlanSpecsNicsInner` + +NewPlanSpecsNicsInner instantiates a new PlanSpecsNicsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPlanSpecsNicsInnerWithDefaults + +`func NewPlanSpecsNicsInnerWithDefaults() *PlanSpecsNicsInner` + +NewPlanSpecsNicsInnerWithDefaults instantiates a new PlanSpecsNicsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCount + +`func (o *PlanSpecsNicsInner) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *PlanSpecsNicsInner) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *PlanSpecsNicsInner) SetCount(v int32)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *PlanSpecsNicsInner) HasCount() bool` + +HasCount returns a boolean if a field has been set. + +### GetType + +`func (o *PlanSpecsNicsInner) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *PlanSpecsNicsInner) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *PlanSpecsNicsInner) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *PlanSpecsNicsInner) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlanType.md b/services/metalv1/docs/PlanType.md new file mode 100644 index 00000000..54b42855 --- /dev/null +++ b/services/metalv1/docs/PlanType.md @@ -0,0 +1,15 @@ +# PlanType + +## Enum + + +* `STANDARD` (value: `"standard"`) + +* `WORKLOAD_OPTIMIZED` (value: `"workload_optimized"`) + +* `CUSTOM` (value: `"custom"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PlansApi.md b/services/metalv1/docs/PlansApi.md new file mode 100644 index 00000000..dc7afb38 --- /dev/null +++ b/services/metalv1/docs/PlansApi.md @@ -0,0 +1,158 @@ +# \PlansApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindPlans**](PlansApi.md#FindPlans) | **Get** /plans | Retrieve all plans +[**FindPlansByProject**](PlansApi.md#FindPlansByProject) | **Get** /projects/{id}/plans | Retrieve all plans visible by the project + + + +## FindPlans + +> PlanList FindPlans(ctx).Categories(categories).Type_(type_).Slug(slug).Include(include).Exclude(exclude).Execute() + +Retrieve all plans + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter plans by its category (optional) + type_ := openapiclient.findPlans_type_parameter("standard") // FindPlansTypeParameter | Filter plans by its plan type (optional) + slug := "c3.small.x86" // string | Filter plans by slug (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PlansApi.FindPlans(context.Background()).Categories(categories).Type_(type_).Slug(slug).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PlansApi.FindPlans``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPlans`: PlanList + fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlans`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPlansRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **categories** | [**[]FindOrganizationDevicesCategoriesParameterInner**](FindOrganizationDevicesCategoriesParameterInner.md) | Filter plans by its category | + **type_** | [**FindPlansTypeParameter**](FindPlansTypeParameter.md) | Filter plans by its plan type | + **slug** | **string** | Filter plans by slug | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPlansByProject + +> PlanList FindPlansByProject(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all plans visible by the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PlansApi.FindPlansByProject(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PlansApi.FindPlansByProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPlansByProject`: PlanList + fmt.Fprintf(os.Stdout, "Response from `PlansApi.FindPlansByProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPlansByProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**PlanList**](PlanList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Port.md b/services/metalv1/docs/Port.md new file mode 100644 index 00000000..fcffb922 --- /dev/null +++ b/services/metalv1/docs/Port.md @@ -0,0 +1,290 @@ +# Port + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bond** | Pointer to [**BondPortData**](BondPortData.md) | | [optional] +**Data** | Pointer to [**PortData**](PortData.md) | | [optional] +**DisbondOperationSupported** | Pointer to **bool** | Indicates whether or not the bond can be broken on the port (when applicable). | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Type** | Pointer to [**PortType**](PortType.md) | | [optional] +**NetworkType** | Pointer to [**PortNetworkType**](PortNetworkType.md) | | [optional] +**NativeVirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**VirtualNetworks** | Pointer to [**[]Href**](Href.md) | | [optional] + +## Methods + +### NewPort + +`func NewPort() *Port` + +NewPort instantiates a new Port object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortWithDefaults + +`func NewPortWithDefaults() *Port` + +NewPortWithDefaults instantiates a new Port object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBond + +`func (o *Port) GetBond() BondPortData` + +GetBond returns the Bond field if non-nil, zero value otherwise. + +### GetBondOk + +`func (o *Port) GetBondOk() (*BondPortData, bool)` + +GetBondOk returns a tuple with the Bond field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBond + +`func (o *Port) SetBond(v BondPortData)` + +SetBond sets Bond field to given value. + +### HasBond + +`func (o *Port) HasBond() bool` + +HasBond returns a boolean if a field has been set. + +### GetData + +`func (o *Port) GetData() PortData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *Port) GetDataOk() (*PortData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *Port) SetData(v PortData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *Port) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetDisbondOperationSupported + +`func (o *Port) GetDisbondOperationSupported() bool` + +GetDisbondOperationSupported returns the DisbondOperationSupported field if non-nil, zero value otherwise. + +### GetDisbondOperationSupportedOk + +`func (o *Port) GetDisbondOperationSupportedOk() (*bool, bool)` + +GetDisbondOperationSupportedOk returns a tuple with the DisbondOperationSupported field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisbondOperationSupported + +`func (o *Port) SetDisbondOperationSupported(v bool)` + +SetDisbondOperationSupported sets DisbondOperationSupported field to given value. + +### HasDisbondOperationSupported + +`func (o *Port) HasDisbondOperationSupported() bool` + +HasDisbondOperationSupported returns a boolean if a field has been set. + +### GetHref + +`func (o *Port) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Port) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Port) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Port) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Port) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Port) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Port) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Port) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Port) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Port) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Port) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Port) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetType + +`func (o *Port) GetType() PortType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Port) GetTypeOk() (*PortType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Port) SetType(v PortType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Port) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetNetworkType + +`func (o *Port) GetNetworkType() PortNetworkType` + +GetNetworkType returns the NetworkType field if non-nil, zero value otherwise. + +### GetNetworkTypeOk + +`func (o *Port) GetNetworkTypeOk() (*PortNetworkType, bool)` + +GetNetworkTypeOk returns a tuple with the NetworkType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkType + +`func (o *Port) SetNetworkType(v PortNetworkType)` + +SetNetworkType sets NetworkType field to given value. + +### HasNetworkType + +`func (o *Port) HasNetworkType() bool` + +HasNetworkType returns a boolean if a field has been set. + +### GetNativeVirtualNetwork + +`func (o *Port) GetNativeVirtualNetwork() VirtualNetwork` + +GetNativeVirtualNetwork returns the NativeVirtualNetwork field if non-nil, zero value otherwise. + +### GetNativeVirtualNetworkOk + +`func (o *Port) GetNativeVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetNativeVirtualNetworkOk returns a tuple with the NativeVirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNativeVirtualNetwork + +`func (o *Port) SetNativeVirtualNetwork(v VirtualNetwork)` + +SetNativeVirtualNetwork sets NativeVirtualNetwork field to given value. + +### HasNativeVirtualNetwork + +`func (o *Port) HasNativeVirtualNetwork() bool` + +HasNativeVirtualNetwork returns a boolean if a field has been set. + +### GetVirtualNetworks + +`func (o *Port) GetVirtualNetworks() []Href` + +GetVirtualNetworks returns the VirtualNetworks field if non-nil, zero value otherwise. + +### GetVirtualNetworksOk + +`func (o *Port) GetVirtualNetworksOk() (*[]Href, bool)` + +GetVirtualNetworksOk returns a tuple with the VirtualNetworks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetworks + +`func (o *Port) SetVirtualNetworks(v []Href)` + +SetVirtualNetworks sets VirtualNetworks field to given value. + +### HasVirtualNetworks + +`func (o *Port) HasVirtualNetworks() bool` + +HasVirtualNetworks returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortAssignInput.md b/services/metalv1/docs/PortAssignInput.md new file mode 100644 index 00000000..aacc8b64 --- /dev/null +++ b/services/metalv1/docs/PortAssignInput.md @@ -0,0 +1,56 @@ +# PortAssignInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Vnid** | Pointer to **string** | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself. | [optional] + +## Methods + +### NewPortAssignInput + +`func NewPortAssignInput() *PortAssignInput` + +NewPortAssignInput instantiates a new PortAssignInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortAssignInputWithDefaults + +`func NewPortAssignInputWithDefaults() *PortAssignInput` + +NewPortAssignInputWithDefaults instantiates a new PortAssignInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVnid + +`func (o *PortAssignInput) GetVnid() string` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *PortAssignInput) GetVnidOk() (*string, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *PortAssignInput) SetVnid(v string)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *PortAssignInput) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortConvertLayer3Input.md b/services/metalv1/docs/PortConvertLayer3Input.md new file mode 100644 index 00000000..a204c2d3 --- /dev/null +++ b/services/metalv1/docs/PortConvertLayer3Input.md @@ -0,0 +1,56 @@ +# PortConvertLayer3Input + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestIps** | Pointer to [**[]PortConvertLayer3InputRequestIpsInner**](PortConvertLayer3InputRequestIpsInner.md) | | [optional] + +## Methods + +### NewPortConvertLayer3Input + +`func NewPortConvertLayer3Input() *PortConvertLayer3Input` + +NewPortConvertLayer3Input instantiates a new PortConvertLayer3Input object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortConvertLayer3InputWithDefaults + +`func NewPortConvertLayer3InputWithDefaults() *PortConvertLayer3Input` + +NewPortConvertLayer3InputWithDefaults instantiates a new PortConvertLayer3Input object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestIps + +`func (o *PortConvertLayer3Input) GetRequestIps() []PortConvertLayer3InputRequestIpsInner` + +GetRequestIps returns the RequestIps field if non-nil, zero value otherwise. + +### GetRequestIpsOk + +`func (o *PortConvertLayer3Input) GetRequestIpsOk() (*[]PortConvertLayer3InputRequestIpsInner, bool)` + +GetRequestIpsOk returns a tuple with the RequestIps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestIps + +`func (o *PortConvertLayer3Input) SetRequestIps(v []PortConvertLayer3InputRequestIpsInner)` + +SetRequestIps sets RequestIps field to given value. + +### HasRequestIps + +`func (o *PortConvertLayer3Input) HasRequestIps() bool` + +HasRequestIps returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md b/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md new file mode 100644 index 00000000..2dec0cd2 --- /dev/null +++ b/services/metalv1/docs/PortConvertLayer3InputRequestIpsInner.md @@ -0,0 +1,82 @@ +# PortConvertLayer3InputRequestIpsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to **int32** | | [optional] +**Public** | Pointer to **bool** | | [optional] + +## Methods + +### NewPortConvertLayer3InputRequestIpsInner + +`func NewPortConvertLayer3InputRequestIpsInner() *PortConvertLayer3InputRequestIpsInner` + +NewPortConvertLayer3InputRequestIpsInner instantiates a new PortConvertLayer3InputRequestIpsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortConvertLayer3InputRequestIpsInnerWithDefaults + +`func NewPortConvertLayer3InputRequestIpsInnerWithDefaults() *PortConvertLayer3InputRequestIpsInner` + +NewPortConvertLayer3InputRequestIpsInnerWithDefaults instantiates a new PortConvertLayer3InputRequestIpsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *PortConvertLayer3InputRequestIpsInner) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *PortConvertLayer3InputRequestIpsInner) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *PortConvertLayer3InputRequestIpsInner) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *PortConvertLayer3InputRequestIpsInner) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetPublic + +`func (o *PortConvertLayer3InputRequestIpsInner) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *PortConvertLayer3InputRequestIpsInner) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *PortConvertLayer3InputRequestIpsInner) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *PortConvertLayer3InputRequestIpsInner) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortData.md b/services/metalv1/docs/PortData.md new file mode 100644 index 00000000..357149d4 --- /dev/null +++ b/services/metalv1/docs/PortData.md @@ -0,0 +1,82 @@ +# PortData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mac** | Pointer to **string** | MAC address is set for NetworkPort ports | [optional] +**Bonded** | Pointer to **bool** | Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active | [optional] + +## Methods + +### NewPortData + +`func NewPortData() *PortData` + +NewPortData instantiates a new PortData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortDataWithDefaults + +`func NewPortDataWithDefaults() *PortData` + +NewPortDataWithDefaults instantiates a new PortData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMac + +`func (o *PortData) GetMac() string` + +GetMac returns the Mac field if non-nil, zero value otherwise. + +### GetMacOk + +`func (o *PortData) GetMacOk() (*string, bool)` + +GetMacOk returns a tuple with the Mac field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMac + +`func (o *PortData) SetMac(v string)` + +SetMac sets Mac field to given value. + +### HasMac + +`func (o *PortData) HasMac() bool` + +HasMac returns a boolean if a field has been set. + +### GetBonded + +`func (o *PortData) GetBonded() bool` + +GetBonded returns the Bonded field if non-nil, zero value otherwise. + +### GetBondedOk + +`func (o *PortData) GetBondedOk() (*bool, bool)` + +GetBondedOk returns a tuple with the Bonded field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBonded + +`func (o *PortData) SetBonded(v bool)` + +SetBonded sets Bonded field to given value. + +### HasBonded + +`func (o *PortData) HasBonded() bool` + +HasBonded returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortNetworkType.md b/services/metalv1/docs/PortNetworkType.md new file mode 100644 index 00000000..ee700b04 --- /dev/null +++ b/services/metalv1/docs/PortNetworkType.md @@ -0,0 +1,19 @@ +# PortNetworkType + +## Enum + + +* `LAYER2_BONDED` (value: `"layer2-bonded"`) + +* `LAYER2_INDIVIDUAL` (value: `"layer2-individual"`) + +* `LAYER3` (value: `"layer3"`) + +* `HYBRID` (value: `"hybrid"`) + +* `HYBRID_BONDED` (value: `"hybrid-bonded"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortType.md b/services/metalv1/docs/PortType.md new file mode 100644 index 00000000..294d7bd8 --- /dev/null +++ b/services/metalv1/docs/PortType.md @@ -0,0 +1,13 @@ +# PortType + +## Enum + + +* `NETWORK_PORT` (value: `"NetworkPort"`) + +* `NETWORK_BOND_PORT` (value: `"NetworkBondPort"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignment.md b/services/metalv1/docs/PortVlanAssignment.md new file mode 100644 index 00000000..de7009a5 --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignment.md @@ -0,0 +1,238 @@ +# PortVlanAssignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Native** | Pointer to **bool** | | [optional] +**Port** | Pointer to [**Href**](Href.md) | | [optional] +**State** | Pointer to [**PortVlanAssignmentState**](PortVlanAssignmentState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VirtualNetwork** | Pointer to [**Href**](Href.md) | | [optional] +**Vlan** | Pointer to **int32** | | [optional] + +## Methods + +### NewPortVlanAssignment + +`func NewPortVlanAssignment() *PortVlanAssignment` + +NewPortVlanAssignment instantiates a new PortVlanAssignment object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentWithDefaults + +`func NewPortVlanAssignmentWithDefaults() *PortVlanAssignment` + +NewPortVlanAssignmentWithDefaults instantiates a new PortVlanAssignment object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *PortVlanAssignment) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *PortVlanAssignment) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *PortVlanAssignment) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *PortVlanAssignment) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetId + +`func (o *PortVlanAssignment) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PortVlanAssignment) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PortVlanAssignment) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *PortVlanAssignment) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetNative + +`func (o *PortVlanAssignment) GetNative() bool` + +GetNative returns the Native field if non-nil, zero value otherwise. + +### GetNativeOk + +`func (o *PortVlanAssignment) GetNativeOk() (*bool, bool)` + +GetNativeOk returns a tuple with the Native field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNative + +`func (o *PortVlanAssignment) SetNative(v bool)` + +SetNative sets Native field to given value. + +### HasNative + +`func (o *PortVlanAssignment) HasNative() bool` + +HasNative returns a boolean if a field has been set. + +### GetPort + +`func (o *PortVlanAssignment) GetPort() Href` + +GetPort returns the Port field if non-nil, zero value otherwise. + +### GetPortOk + +`func (o *PortVlanAssignment) GetPortOk() (*Href, bool)` + +GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPort + +`func (o *PortVlanAssignment) SetPort(v Href)` + +SetPort sets Port field to given value. + +### HasPort + +`func (o *PortVlanAssignment) HasPort() bool` + +HasPort returns a boolean if a field has been set. + +### GetState + +`func (o *PortVlanAssignment) GetState() PortVlanAssignmentState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *PortVlanAssignment) GetStateOk() (*PortVlanAssignmentState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *PortVlanAssignment) SetState(v PortVlanAssignmentState)` + +SetState sets State field to given value. + +### HasState + +`func (o *PortVlanAssignment) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *PortVlanAssignment) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *PortVlanAssignment) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *PortVlanAssignment) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *PortVlanAssignment) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *PortVlanAssignment) GetVirtualNetwork() Href` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *PortVlanAssignment) GetVirtualNetworkOk() (*Href, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *PortVlanAssignment) SetVirtualNetwork(v Href)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *PortVlanAssignment) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVlan + +`func (o *PortVlanAssignment) GetVlan() int32` + +GetVlan returns the Vlan field if non-nil, zero value otherwise. + +### GetVlanOk + +`func (o *PortVlanAssignment) GetVlanOk() (*int32, bool)` + +GetVlanOk returns a tuple with the Vlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlan + +`func (o *PortVlanAssignment) SetVlan(v int32)` + +SetVlan sets Vlan field to given value. + +### HasVlan + +`func (o *PortVlanAssignment) HasVlan() bool` + +HasVlan returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatch.md b/services/metalv1/docs/PortVlanAssignmentBatch.md new file mode 100644 index 00000000..b8a53e8a --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatch.md @@ -0,0 +1,264 @@ +# PortVlanAssignmentBatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**ErrorMessages** | Pointer to **[]string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Port** | Pointer to [**Port**](Port.md) | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**State** | Pointer to [**PortVlanAssignmentBatchState**](PortVlanAssignmentBatchState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VlanAssignments** | Pointer to [**[]PortVlanAssignmentBatchVlanAssignmentsInner**](PortVlanAssignmentBatchVlanAssignmentsInner.md) | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] + +## Methods + +### NewPortVlanAssignmentBatch + +`func NewPortVlanAssignmentBatch() *PortVlanAssignmentBatch` + +NewPortVlanAssignmentBatch instantiates a new PortVlanAssignmentBatch object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentBatchWithDefaults + +`func NewPortVlanAssignmentBatchWithDefaults() *PortVlanAssignmentBatch` + +NewPortVlanAssignmentBatchWithDefaults instantiates a new PortVlanAssignmentBatch object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *PortVlanAssignmentBatch) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *PortVlanAssignmentBatch) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *PortVlanAssignmentBatch) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *PortVlanAssignmentBatch) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetErrorMessages + +`func (o *PortVlanAssignmentBatch) GetErrorMessages() []string` + +GetErrorMessages returns the ErrorMessages field if non-nil, zero value otherwise. + +### GetErrorMessagesOk + +`func (o *PortVlanAssignmentBatch) GetErrorMessagesOk() (*[]string, bool)` + +GetErrorMessagesOk returns a tuple with the ErrorMessages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorMessages + +`func (o *PortVlanAssignmentBatch) SetErrorMessages(v []string)` + +SetErrorMessages sets ErrorMessages field to given value. + +### HasErrorMessages + +`func (o *PortVlanAssignmentBatch) HasErrorMessages() bool` + +HasErrorMessages returns a boolean if a field has been set. + +### GetId + +`func (o *PortVlanAssignmentBatch) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PortVlanAssignmentBatch) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PortVlanAssignmentBatch) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *PortVlanAssignmentBatch) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPort + +`func (o *PortVlanAssignmentBatch) GetPort() Port` + +GetPort returns the Port field if non-nil, zero value otherwise. + +### GetPortOk + +`func (o *PortVlanAssignmentBatch) GetPortOk() (*Port, bool)` + +GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPort + +`func (o *PortVlanAssignmentBatch) SetPort(v Port)` + +SetPort sets Port field to given value. + +### HasPort + +`func (o *PortVlanAssignmentBatch) HasPort() bool` + +HasPort returns a boolean if a field has been set. + +### GetQuantity + +`func (o *PortVlanAssignmentBatch) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *PortVlanAssignmentBatch) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *PortVlanAssignmentBatch) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *PortVlanAssignmentBatch) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetState + +`func (o *PortVlanAssignmentBatch) GetState() PortVlanAssignmentBatchState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *PortVlanAssignmentBatch) GetStateOk() (*PortVlanAssignmentBatchState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *PortVlanAssignmentBatch) SetState(v PortVlanAssignmentBatchState)` + +SetState sets State field to given value. + +### HasState + +`func (o *PortVlanAssignmentBatch) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *PortVlanAssignmentBatch) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *PortVlanAssignmentBatch) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *PortVlanAssignmentBatch) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *PortVlanAssignmentBatch) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVlanAssignments + +`func (o *PortVlanAssignmentBatch) GetVlanAssignments() []PortVlanAssignmentBatchVlanAssignmentsInner` + +GetVlanAssignments returns the VlanAssignments field if non-nil, zero value otherwise. + +### GetVlanAssignmentsOk + +`func (o *PortVlanAssignmentBatch) GetVlanAssignmentsOk() (*[]PortVlanAssignmentBatchVlanAssignmentsInner, bool)` + +GetVlanAssignmentsOk returns a tuple with the VlanAssignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlanAssignments + +`func (o *PortVlanAssignmentBatch) SetVlanAssignments(v []PortVlanAssignmentBatchVlanAssignmentsInner)` + +SetVlanAssignments sets VlanAssignments field to given value. + +### HasVlanAssignments + +`func (o *PortVlanAssignmentBatch) HasVlanAssignments() bool` + +HasVlanAssignments returns a boolean if a field has been set. + +### GetProject + +`func (o *PortVlanAssignmentBatch) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *PortVlanAssignmentBatch) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *PortVlanAssignmentBatch) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *PortVlanAssignmentBatch) HasProject() bool` + +HasProject returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md b/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md new file mode 100644 index 00000000..618d3c19 --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchCreateInput.md @@ -0,0 +1,56 @@ +# PortVlanAssignmentBatchCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VlanAssignments** | Pointer to [**[]PortVlanAssignmentBatchCreateInputVlanAssignmentsInner**](PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md) | | [optional] + +## Methods + +### NewPortVlanAssignmentBatchCreateInput + +`func NewPortVlanAssignmentBatchCreateInput() *PortVlanAssignmentBatchCreateInput` + +NewPortVlanAssignmentBatchCreateInput instantiates a new PortVlanAssignmentBatchCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentBatchCreateInputWithDefaults + +`func NewPortVlanAssignmentBatchCreateInputWithDefaults() *PortVlanAssignmentBatchCreateInput` + +NewPortVlanAssignmentBatchCreateInputWithDefaults instantiates a new PortVlanAssignmentBatchCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVlanAssignments + +`func (o *PortVlanAssignmentBatchCreateInput) GetVlanAssignments() []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner` + +GetVlanAssignments returns the VlanAssignments field if non-nil, zero value otherwise. + +### GetVlanAssignmentsOk + +`func (o *PortVlanAssignmentBatchCreateInput) GetVlanAssignmentsOk() (*[]PortVlanAssignmentBatchCreateInputVlanAssignmentsInner, bool)` + +GetVlanAssignmentsOk returns a tuple with the VlanAssignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlanAssignments + +`func (o *PortVlanAssignmentBatchCreateInput) SetVlanAssignments(v []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner)` + +SetVlanAssignments sets VlanAssignments field to given value. + +### HasVlanAssignments + +`func (o *PortVlanAssignmentBatchCreateInput) HasVlanAssignments() bool` + +HasVlanAssignments returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md b/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md new file mode 100644 index 00000000..07fb141e --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchCreateInputVlanAssignmentsInner.md @@ -0,0 +1,108 @@ +# PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Native** | Pointer to **bool** | | [optional] +**State** | Pointer to [**PortVlanAssignmentBatchVlanAssignmentsInnerState**](PortVlanAssignmentBatchVlanAssignmentsInnerState.md) | | [optional] +**Vlan** | Pointer to **string** | | [optional] + +## Methods + +### NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInner + +`func NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInner() *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner` + +NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInner instantiates a new PortVlanAssignmentBatchCreateInputVlanAssignmentsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInnerWithDefaults + +`func NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInnerWithDefaults() *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner` + +NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInnerWithDefaults instantiates a new PortVlanAssignmentBatchCreateInputVlanAssignmentsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNative + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetNative() bool` + +GetNative returns the Native field if non-nil, zero value otherwise. + +### GetNativeOk + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetNativeOk() (*bool, bool)` + +GetNativeOk returns a tuple with the Native field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNative + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetNative(v bool)` + +SetNative sets Native field to given value. + +### HasNative + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasNative() bool` + +HasNative returns a boolean if a field has been set. + +### GetState + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetState() PortVlanAssignmentBatchVlanAssignmentsInnerState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetStateOk() (*PortVlanAssignmentBatchVlanAssignmentsInnerState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetState(v PortVlanAssignmentBatchVlanAssignmentsInnerState)` + +SetState sets State field to given value. + +### HasState + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetVlan + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetVlan() string` + +GetVlan returns the Vlan field if non-nil, zero value otherwise. + +### GetVlanOk + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetVlanOk() (*string, bool)` + +GetVlanOk returns a tuple with the Vlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlan + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetVlan(v string)` + +SetVlan sets Vlan field to given value. + +### HasVlan + +`func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasVlan() bool` + +HasVlan returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchList.md b/services/metalv1/docs/PortVlanAssignmentBatchList.md new file mode 100644 index 00000000..e0a31293 --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchList.md @@ -0,0 +1,56 @@ +# PortVlanAssignmentBatchList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Batches** | Pointer to [**[]PortVlanAssignmentBatch**](PortVlanAssignmentBatch.md) | | [optional] + +## Methods + +### NewPortVlanAssignmentBatchList + +`func NewPortVlanAssignmentBatchList() *PortVlanAssignmentBatchList` + +NewPortVlanAssignmentBatchList instantiates a new PortVlanAssignmentBatchList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentBatchListWithDefaults + +`func NewPortVlanAssignmentBatchListWithDefaults() *PortVlanAssignmentBatchList` + +NewPortVlanAssignmentBatchListWithDefaults instantiates a new PortVlanAssignmentBatchList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBatches + +`func (o *PortVlanAssignmentBatchList) GetBatches() []PortVlanAssignmentBatch` + +GetBatches returns the Batches field if non-nil, zero value otherwise. + +### GetBatchesOk + +`func (o *PortVlanAssignmentBatchList) GetBatchesOk() (*[]PortVlanAssignmentBatch, bool)` + +GetBatchesOk returns a tuple with the Batches field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBatches + +`func (o *PortVlanAssignmentBatchList) SetBatches(v []PortVlanAssignmentBatch)` + +SetBatches sets Batches field to given value. + +### HasBatches + +`func (o *PortVlanAssignmentBatchList) HasBatches() bool` + +HasBatches returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchState.md b/services/metalv1/docs/PortVlanAssignmentBatchState.md new file mode 100644 index 00000000..33cbfab0 --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchState.md @@ -0,0 +1,17 @@ +# PortVlanAssignmentBatchState + +## Enum + + +* `QUEUED` (value: `"queued"`) + +* `IN_PROGRESS` (value: `"in_progress"`) + +* `COMPLETED` (value: `"completed"`) + +* `FAILED` (value: `"failed"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md b/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md new file mode 100644 index 00000000..6326a02b --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInner.md @@ -0,0 +1,134 @@ +# PortVlanAssignmentBatchVlanAssignmentsInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Native** | Pointer to **bool** | | [optional] +**State** | Pointer to [**PortVlanAssignmentBatchVlanAssignmentsInnerState**](PortVlanAssignmentBatchVlanAssignmentsInnerState.md) | | [optional] +**Vlan** | Pointer to **int32** | | [optional] + +## Methods + +### NewPortVlanAssignmentBatchVlanAssignmentsInner + +`func NewPortVlanAssignmentBatchVlanAssignmentsInner() *PortVlanAssignmentBatchVlanAssignmentsInner` + +NewPortVlanAssignmentBatchVlanAssignmentsInner instantiates a new PortVlanAssignmentBatchVlanAssignmentsInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentBatchVlanAssignmentsInnerWithDefaults + +`func NewPortVlanAssignmentBatchVlanAssignmentsInnerWithDefaults() *PortVlanAssignmentBatchVlanAssignmentsInner` + +NewPortVlanAssignmentBatchVlanAssignmentsInnerWithDefaults instantiates a new PortVlanAssignmentBatchVlanAssignmentsInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetNative + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetNative() bool` + +GetNative returns the Native field if non-nil, zero value otherwise. + +### GetNativeOk + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetNativeOk() (*bool, bool)` + +GetNativeOk returns a tuple with the Native field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNative + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetNative(v bool)` + +SetNative sets Native field to given value. + +### HasNative + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasNative() bool` + +HasNative returns a boolean if a field has been set. + +### GetState + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetState() PortVlanAssignmentBatchVlanAssignmentsInnerState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetStateOk() (*PortVlanAssignmentBatchVlanAssignmentsInnerState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetState(v PortVlanAssignmentBatchVlanAssignmentsInnerState)` + +SetState sets State field to given value. + +### HasState + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetVlan + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetVlan() int32` + +GetVlan returns the Vlan field if non-nil, zero value otherwise. + +### GetVlanOk + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetVlanOk() (*int32, bool)` + +GetVlanOk returns a tuple with the Vlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlan + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetVlan(v int32)` + +SetVlan sets Vlan field to given value. + +### HasVlan + +`func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasVlan() bool` + +HasVlan returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInnerState.md b/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInnerState.md new file mode 100644 index 00000000..6f6e3174 --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentBatchVlanAssignmentsInnerState.md @@ -0,0 +1,13 @@ +# PortVlanAssignmentBatchVlanAssignmentsInnerState + +## Enum + + +* `ASSIGNED` (value: `"assigned"`) + +* `UNASSIGNED` (value: `"unassigned"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentList.md b/services/metalv1/docs/PortVlanAssignmentList.md new file mode 100644 index 00000000..0e14d2ed --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentList.md @@ -0,0 +1,56 @@ +# PortVlanAssignmentList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VlanAssignments** | Pointer to [**[]PortVlanAssignment**](PortVlanAssignment.md) | | [optional] + +## Methods + +### NewPortVlanAssignmentList + +`func NewPortVlanAssignmentList() *PortVlanAssignmentList` + +NewPortVlanAssignmentList instantiates a new PortVlanAssignmentList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPortVlanAssignmentListWithDefaults + +`func NewPortVlanAssignmentListWithDefaults() *PortVlanAssignmentList` + +NewPortVlanAssignmentListWithDefaults instantiates a new PortVlanAssignmentList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVlanAssignments + +`func (o *PortVlanAssignmentList) GetVlanAssignments() []PortVlanAssignment` + +GetVlanAssignments returns the VlanAssignments field if non-nil, zero value otherwise. + +### GetVlanAssignmentsOk + +`func (o *PortVlanAssignmentList) GetVlanAssignmentsOk() (*[]PortVlanAssignment, bool)` + +GetVlanAssignmentsOk returns a tuple with the VlanAssignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlanAssignments + +`func (o *PortVlanAssignmentList) SetVlanAssignments(v []PortVlanAssignment)` + +SetVlanAssignments sets VlanAssignments field to given value. + +### HasVlanAssignments + +`func (o *PortVlanAssignmentList) HasVlanAssignments() bool` + +HasVlanAssignments returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortVlanAssignmentState.md b/services/metalv1/docs/PortVlanAssignmentState.md new file mode 100644 index 00000000..26f4517b --- /dev/null +++ b/services/metalv1/docs/PortVlanAssignmentState.md @@ -0,0 +1,13 @@ +# PortVlanAssignmentState + +## Enum + + +* `ASSIGNED` (value: `"assigned"`) + +* `UNASSIGNING` (value: `"unassigning"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/PortsApi.md b/services/metalv1/docs/PortsApi.md new file mode 100644 index 00000000..d1f0f13c --- /dev/null +++ b/services/metalv1/docs/PortsApi.md @@ -0,0 +1,1050 @@ +# \PortsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AssignNativeVlan**](PortsApi.md#AssignNativeVlan) | **Post** /ports/{id}/native-vlan | Assign a native VLAN +[**AssignPort**](PortsApi.md#AssignPort) | **Post** /ports/{id}/assign | Assign a port to virtual network +[**BondPort**](PortsApi.md#BondPort) | **Post** /ports/{id}/bond | Enabling bonding +[**ConvertLayer2**](PortsApi.md#ConvertLayer2) | **Post** /ports/{id}/convert/layer-2 | Convert to Layer 2 +[**ConvertLayer3**](PortsApi.md#ConvertLayer3) | **Post** /ports/{id}/convert/layer-3 | Convert to Layer 3 +[**CreatePortVlanAssignmentBatch**](PortsApi.md#CreatePortVlanAssignmentBatch) | **Post** /ports/{id}/vlan-assignments/batches | Create a new Port-VLAN Assignment management batch +[**DeleteNativeVlan**](PortsApi.md#DeleteNativeVlan) | **Delete** /ports/{id}/native-vlan | Remove native VLAN +[**DisbondPort**](PortsApi.md#DisbondPort) | **Post** /ports/{id}/disbond | Disabling bonding +[**FindPortById**](PortsApi.md#FindPortById) | **Get** /ports/{id} | Retrieve a port +[**FindPortVlanAssignmentBatchByPortIdAndBatchId**](PortsApi.md#FindPortVlanAssignmentBatchByPortIdAndBatchId) | **Get** /ports/{id}/vlan-assignments/batches/{batch_id} | Retrieve a VLAN Assignment Batch's details +[**FindPortVlanAssignmentBatches**](PortsApi.md#FindPortVlanAssignmentBatches) | **Get** /ports/{id}/vlan-assignments/batches | List the VLAN Assignment Batches for a port +[**FindPortVlanAssignmentByPortIdAndAssignmentId**](PortsApi.md#FindPortVlanAssignmentByPortIdAndAssignmentId) | **Get** /ports/{id}/vlan-assignments/{assignment_id} | Show a particular Port VLAN assignment's details +[**FindPortVlanAssignments**](PortsApi.md#FindPortVlanAssignments) | **Get** /ports/{id}/vlan-assignments | List Current VLAN assignments for a port +[**UnassignPort**](PortsApi.md#UnassignPort) | **Post** /ports/{id}/unassign | Unassign a port + + + +## AssignNativeVlan + +> Port AssignNativeVlan(ctx, id).Vnid(vnid).Include(include).Execute() + +Assign a native VLAN + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + vnid := "vnid_example" // string | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.AssignNativeVlan(context.Background(), id).Vnid(vnid).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.AssignNativeVlan``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AssignNativeVlan`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.AssignNativeVlan`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAssignNativeVlanRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **vnid** | **string** | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## AssignPort + +> Port AssignPort(ctx, id).PortAssignInput(portAssignInput).Include(include).Execute() + +Assign a port to virtual network + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + portAssignInput := *openapiclient.NewPortAssignInput() // PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.AssignPort(context.Background(), id).PortAssignInput(portAssignInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.AssignPort``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AssignPort`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.AssignPort`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAssignPortRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **portAssignInput** | [**PortAssignInput**](PortAssignInput.md) | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## BondPort + +> Port BondPort(ctx, id).BulkEnable(bulkEnable).Include(include).Execute() + +Enabling bonding + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + bulkEnable := true // bool | enable both ports (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.BondPort(context.Background(), id).BulkEnable(bulkEnable).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.BondPort``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BondPort`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.BondPort`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBondPortRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **bulkEnable** | **bool** | enable both ports | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ConvertLayer2 + +> Port ConvertLayer2(ctx, id).PortAssignInput(portAssignInput).Include(include).Execute() + +Convert to Layer 2 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + portAssignInput := *openapiclient.NewPortAssignInput() // PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.ConvertLayer2(context.Background(), id).PortAssignInput(portAssignInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.ConvertLayer2``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ConvertLayer2`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.ConvertLayer2`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiConvertLayer2Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **portAssignInput** | [**PortAssignInput**](PortAssignInput.md) | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ConvertLayer3 + +> Port ConvertLayer3(ctx, id).Include(include).PortConvertLayer3Input(portConvertLayer3Input).Execute() + +Convert to Layer 3 + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + portConvertLayer3Input := *openapiclient.NewPortConvertLayer3Input() // PortConvertLayer3Input | IPs to request (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.ConvertLayer3(context.Background(), id).Include(include).PortConvertLayer3Input(portConvertLayer3Input).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.ConvertLayer3``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ConvertLayer3`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.ConvertLayer3`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiConvertLayer3Request struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **portConvertLayer3Input** | [**PortConvertLayer3Input**](PortConvertLayer3Input.md) | IPs to request | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreatePortVlanAssignmentBatch + +> PortVlanAssignmentBatch CreatePortVlanAssignmentBatch(ctx, id).PortVlanAssignmentBatchCreateInput(portVlanAssignmentBatchCreateInput).Include(include).Execute() + +Create a new Port-VLAN Assignment management batch + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + portVlanAssignmentBatchCreateInput := *openapiclient.NewPortVlanAssignmentBatchCreateInput() // PortVlanAssignmentBatchCreateInput | VLAN Assignment batch details + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.CreatePortVlanAssignmentBatch(context.Background(), id).PortVlanAssignmentBatchCreateInput(portVlanAssignmentBatchCreateInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.CreatePortVlanAssignmentBatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreatePortVlanAssignmentBatch`: PortVlanAssignmentBatch + fmt.Fprintf(os.Stdout, "Response from `PortsApi.CreatePortVlanAssignmentBatch`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreatePortVlanAssignmentBatchRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **portVlanAssignmentBatchCreateInput** | [**PortVlanAssignmentBatchCreateInput**](PortVlanAssignmentBatchCreateInput.md) | VLAN Assignment batch details | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**PortVlanAssignmentBatch**](PortVlanAssignmentBatch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteNativeVlan + +> Port DeleteNativeVlan(ctx, id).Include(include).Execute() + +Remove native VLAN + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.DeleteNativeVlan(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.DeleteNativeVlan``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteNativeVlan`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.DeleteNativeVlan`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteNativeVlanRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DisbondPort + +> Port DisbondPort(ctx, id).BulkDisable(bulkDisable).Include(include).Execute() + +Disabling bonding + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + bulkDisable := true // bool | disable both ports (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.DisbondPort(context.Background(), id).BulkDisable(bulkDisable).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.DisbondPort``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DisbondPort`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.DisbondPort`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDisbondPortRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **bulkDisable** | **bool** | disable both ports | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPortById + +> Port FindPortById(ctx, id).Include(include).Execute() + +Retrieve a port + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.FindPortById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.FindPortById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPortById`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.FindPortById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPortByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPortVlanAssignmentBatchByPortIdAndBatchId + +> PortVlanAssignmentBatch FindPortVlanAssignmentBatchByPortIdAndBatchId(ctx, id, batchId).Include(include).Execute() + +Retrieve a VLAN Assignment Batch's details + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + batchId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Batch ID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.FindPortVlanAssignmentBatchByPortIdAndBatchId(context.Background(), id, batchId).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.FindPortVlanAssignmentBatchByPortIdAndBatchId``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPortVlanAssignmentBatchByPortIdAndBatchId`: PortVlanAssignmentBatch + fmt.Fprintf(os.Stdout, "Response from `PortsApi.FindPortVlanAssignmentBatchByPortIdAndBatchId`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | +**batchId** | **string** | Batch ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPortVlanAssignmentBatchByPortIdAndBatchIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**PortVlanAssignmentBatch**](PortVlanAssignmentBatch.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPortVlanAssignmentBatches + +> PortVlanAssignmentBatchList FindPortVlanAssignmentBatches(ctx, id).Execute() + +List the VLAN Assignment Batches for a port + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.FindPortVlanAssignmentBatches(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.FindPortVlanAssignmentBatches``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPortVlanAssignmentBatches`: PortVlanAssignmentBatchList + fmt.Fprintf(os.Stdout, "Response from `PortsApi.FindPortVlanAssignmentBatches`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPortVlanAssignmentBatchesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**PortVlanAssignmentBatchList**](PortVlanAssignmentBatchList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPortVlanAssignmentByPortIdAndAssignmentId + +> PortVlanAssignment FindPortVlanAssignmentByPortIdAndAssignmentId(ctx, id, assignmentId).Include(include).Execute() + +Show a particular Port VLAN assignment's details + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + assignmentId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Assignment ID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) (default to [port, virtual_network]) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.FindPortVlanAssignmentByPortIdAndAssignmentId(context.Background(), id, assignmentId).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.FindPortVlanAssignmentByPortIdAndAssignmentId``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPortVlanAssignmentByPortIdAndAssignmentId`: PortVlanAssignment + fmt.Fprintf(os.Stdout, "Response from `PortsApi.FindPortVlanAssignmentByPortIdAndAssignmentId`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | +**assignmentId** | **string** | Assignment ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPortVlanAssignmentByPortIdAndAssignmentIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [default to [port, virtual_network]] + +### Return type + +[**PortVlanAssignment**](PortVlanAssignment.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPortVlanAssignments + +> PortVlanAssignmentList FindPortVlanAssignments(ctx, id).Include(include).Execute() + +List Current VLAN assignments for a port + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) (default to [port, virtual_network]) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.FindPortVlanAssignments(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.FindPortVlanAssignments``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPortVlanAssignments`: PortVlanAssignmentList + fmt.Fprintf(os.Stdout, "Response from `PortsApi.FindPortVlanAssignments`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindPortVlanAssignmentsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | [default to [port, virtual_network]] + +### Return type + +[**PortVlanAssignmentList**](PortVlanAssignmentList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UnassignPort + +> Port UnassignPort(ctx, id).PortAssignInput(portAssignInput).Include(include).Execute() + +Unassign a port + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Port UUID + portAssignInput := *openapiclient.NewPortAssignInput() // PortAssignInput | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PortsApi.UnassignPort(context.Background(), id).PortAssignInput(portAssignInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PortsApi.UnassignPort``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UnassignPort`: Port + fmt.Fprintf(os.Stdout, "Response from `PortsApi.UnassignPort`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Port UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUnassignPortRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **portAssignInput** | [**PortAssignInput**](PortAssignInput.md) | Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: '1001'). | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Port**](Port.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Project.md b/services/metalv1/docs/Project.md new file mode 100644 index 00000000..b01b3672 --- /dev/null +++ b/services/metalv1/docs/Project.md @@ -0,0 +1,524 @@ +# Project + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpConfig** | Pointer to [**Href**](Href.md) | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Devices** | Pointer to [**[]Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Invitations** | Pointer to [**[]Href**](Href.md) | | [optional] +**MaxDevices** | Pointer to **map[string]interface{}** | | [optional] +**Members** | Pointer to [**[]Href**](Href.md) | | [optional] +**Memberships** | Pointer to [**[]Href**](Href.md) | | [optional] +**Name** | Pointer to **string** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**NetworkStatus** | Pointer to **map[string]interface{}** | | [optional] +**Organization** | Pointer to [**Organization**](Organization.md) | | [optional] +**PaymentMethod** | Pointer to [**Href**](Href.md) | | [optional] +**SshKeys** | Pointer to [**[]Href**](Href.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Volumes** | Pointer to [**[]Href**](Href.md) | | [optional] +**Type** | Pointer to [**ProjectType**](ProjectType.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewProject + +`func NewProject() *Project` + +NewProject instantiates a new Project object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectWithDefaults + +`func NewProjectWithDefaults() *Project` + +NewProjectWithDefaults instantiates a new Project object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpConfig + +`func (o *Project) GetBgpConfig() Href` + +GetBgpConfig returns the BgpConfig field if non-nil, zero value otherwise. + +### GetBgpConfigOk + +`func (o *Project) GetBgpConfigOk() (*Href, bool)` + +GetBgpConfigOk returns a tuple with the BgpConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpConfig + +`func (o *Project) SetBgpConfig(v Href)` + +SetBgpConfig sets BgpConfig field to given value. + +### HasBgpConfig + +`func (o *Project) HasBgpConfig() bool` + +HasBgpConfig returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Project) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Project) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Project) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Project) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *Project) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *Project) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *Project) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *Project) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDevices + +`func (o *Project) GetDevices() []Href` + +GetDevices returns the Devices field if non-nil, zero value otherwise. + +### GetDevicesOk + +`func (o *Project) GetDevicesOk() (*[]Href, bool)` + +GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevices + +`func (o *Project) SetDevices(v []Href)` + +SetDevices sets Devices field to given value. + +### HasDevices + +`func (o *Project) HasDevices() bool` + +HasDevices returns a boolean if a field has been set. + +### GetHref + +`func (o *Project) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Project) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Project) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Project) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *Project) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Project) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Project) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Project) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInvitations + +`func (o *Project) GetInvitations() []Href` + +GetInvitations returns the Invitations field if non-nil, zero value otherwise. + +### GetInvitationsOk + +`func (o *Project) GetInvitationsOk() (*[]Href, bool)` + +GetInvitationsOk returns a tuple with the Invitations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitations + +`func (o *Project) SetInvitations(v []Href)` + +SetInvitations sets Invitations field to given value. + +### HasInvitations + +`func (o *Project) HasInvitations() bool` + +HasInvitations returns a boolean if a field has been set. + +### GetMaxDevices + +`func (o *Project) GetMaxDevices() map[string]interface{}` + +GetMaxDevices returns the MaxDevices field if non-nil, zero value otherwise. + +### GetMaxDevicesOk + +`func (o *Project) GetMaxDevicesOk() (*map[string]interface{}, bool)` + +GetMaxDevicesOk returns a tuple with the MaxDevices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxDevices + +`func (o *Project) SetMaxDevices(v map[string]interface{})` + +SetMaxDevices sets MaxDevices field to given value. + +### HasMaxDevices + +`func (o *Project) HasMaxDevices() bool` + +HasMaxDevices returns a boolean if a field has been set. + +### GetMembers + +`func (o *Project) GetMembers() []Href` + +GetMembers returns the Members field if non-nil, zero value otherwise. + +### GetMembersOk + +`func (o *Project) GetMembersOk() (*[]Href, bool)` + +GetMembersOk returns a tuple with the Members field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembers + +`func (o *Project) SetMembers(v []Href)` + +SetMembers sets Members field to given value. + +### HasMembers + +`func (o *Project) HasMembers() bool` + +HasMembers returns a boolean if a field has been set. + +### GetMemberships + +`func (o *Project) GetMemberships() []Href` + +GetMemberships returns the Memberships field if non-nil, zero value otherwise. + +### GetMembershipsOk + +`func (o *Project) GetMembershipsOk() (*[]Href, bool)` + +GetMembershipsOk returns a tuple with the Memberships field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberships + +`func (o *Project) SetMemberships(v []Href)` + +SetMemberships sets Memberships field to given value. + +### HasMemberships + +`func (o *Project) HasMemberships() bool` + +HasMemberships returns a boolean if a field has been set. + +### GetName + +`func (o *Project) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Project) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Project) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Project) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNetworkStatus + +`func (o *Project) GetNetworkStatus() map[string]interface{}` + +GetNetworkStatus returns the NetworkStatus field if non-nil, zero value otherwise. + +### GetNetworkStatusOk + +`func (o *Project) GetNetworkStatusOk() (*map[string]interface{}, bool)` + +GetNetworkStatusOk returns a tuple with the NetworkStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetworkStatus + +`func (o *Project) SetNetworkStatus(v map[string]interface{})` + +SetNetworkStatus sets NetworkStatus field to given value. + +### HasNetworkStatus + +`func (o *Project) HasNetworkStatus() bool` + +HasNetworkStatus returns a boolean if a field has been set. + +### GetOrganization + +`func (o *Project) GetOrganization() Organization` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *Project) GetOrganizationOk() (*Organization, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *Project) SetOrganization(v Organization)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *Project) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *Project) GetPaymentMethod() Href` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *Project) GetPaymentMethodOk() (*Href, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *Project) SetPaymentMethod(v Href)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *Project) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetSshKeys + +`func (o *Project) GetSshKeys() []Href` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *Project) GetSshKeysOk() (*[]Href, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *Project) SetSshKeys(v []Href)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *Project) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Project) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Project) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Project) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Project) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVolumes + +`func (o *Project) GetVolumes() []Href` + +GetVolumes returns the Volumes field if non-nil, zero value otherwise. + +### GetVolumesOk + +`func (o *Project) GetVolumesOk() (*[]Href, bool)` + +GetVolumesOk returns a tuple with the Volumes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVolumes + +`func (o *Project) SetVolumes(v []Href)` + +SetVolumes sets Volumes field to given value. + +### HasVolumes + +`func (o *Project) HasVolumes() bool` + +HasVolumes returns a boolean if a field has been set. + +### GetType + +`func (o *Project) GetType() ProjectType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Project) GetTypeOk() (*ProjectType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Project) SetType(v ProjectType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *Project) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetTags + +`func (o *Project) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Project) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Project) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Project) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectCreateFromRootInput.md b/services/metalv1/docs/ProjectCreateFromRootInput.md new file mode 100644 index 00000000..8114591f --- /dev/null +++ b/services/metalv1/docs/ProjectCreateFromRootInput.md @@ -0,0 +1,181 @@ +# ProjectCreateFromRootInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Name** | **string** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | +**OrganizationId** | Pointer to **string** | | [optional] +**PaymentMethodId** | Pointer to **string** | | [optional] +**Type** | Pointer to [**ProjectCreateFromRootInputType**](ProjectCreateFromRootInputType.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewProjectCreateFromRootInput + +`func NewProjectCreateFromRootInput(name string, ) *ProjectCreateFromRootInput` + +NewProjectCreateFromRootInput instantiates a new ProjectCreateFromRootInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectCreateFromRootInputWithDefaults + +`func NewProjectCreateFromRootInputWithDefaults() *ProjectCreateFromRootInput` + +NewProjectCreateFromRootInputWithDefaults instantiates a new ProjectCreateFromRootInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomdata + +`func (o *ProjectCreateFromRootInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *ProjectCreateFromRootInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *ProjectCreateFromRootInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *ProjectCreateFromRootInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetName + +`func (o *ProjectCreateFromRootInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectCreateFromRootInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectCreateFromRootInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetOrganizationId + +`func (o *ProjectCreateFromRootInput) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *ProjectCreateFromRootInput) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *ProjectCreateFromRootInput) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *ProjectCreateFromRootInput) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetPaymentMethodId + +`func (o *ProjectCreateFromRootInput) GetPaymentMethodId() string` + +GetPaymentMethodId returns the PaymentMethodId field if non-nil, zero value otherwise. + +### GetPaymentMethodIdOk + +`func (o *ProjectCreateFromRootInput) GetPaymentMethodIdOk() (*string, bool)` + +GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodId + +`func (o *ProjectCreateFromRootInput) SetPaymentMethodId(v string)` + +SetPaymentMethodId sets PaymentMethodId field to given value. + +### HasPaymentMethodId + +`func (o *ProjectCreateFromRootInput) HasPaymentMethodId() bool` + +HasPaymentMethodId returns a boolean if a field has been set. + +### GetType + +`func (o *ProjectCreateFromRootInput) GetType() ProjectCreateFromRootInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ProjectCreateFromRootInput) GetTypeOk() (*ProjectCreateFromRootInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ProjectCreateFromRootInput) SetType(v ProjectCreateFromRootInputType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ProjectCreateFromRootInput) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetTags + +`func (o *ProjectCreateFromRootInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *ProjectCreateFromRootInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *ProjectCreateFromRootInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *ProjectCreateFromRootInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectCreateFromRootInputType.md b/services/metalv1/docs/ProjectCreateFromRootInputType.md new file mode 100644 index 00000000..ec741853 --- /dev/null +++ b/services/metalv1/docs/ProjectCreateFromRootInputType.md @@ -0,0 +1,13 @@ +# ProjectCreateFromRootInputType + +## Enum + + +* `DEFAULT` (value: `"default"`) + +* `VMCE` (value: `"vmce"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectCreateInput.md b/services/metalv1/docs/ProjectCreateInput.md new file mode 100644 index 00000000..eb92d523 --- /dev/null +++ b/services/metalv1/docs/ProjectCreateInput.md @@ -0,0 +1,155 @@ +# ProjectCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Name** | **string** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | +**PaymentMethodId** | Pointer to **string** | | [optional] +**Type** | Pointer to [**ProjectCreateFromRootInputType**](ProjectCreateFromRootInputType.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewProjectCreateInput + +`func NewProjectCreateInput(name string, ) *ProjectCreateInput` + +NewProjectCreateInput instantiates a new ProjectCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectCreateInputWithDefaults + +`func NewProjectCreateInputWithDefaults() *ProjectCreateInput` + +NewProjectCreateInputWithDefaults instantiates a new ProjectCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomdata + +`func (o *ProjectCreateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *ProjectCreateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *ProjectCreateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *ProjectCreateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetName + +`func (o *ProjectCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPaymentMethodId + +`func (o *ProjectCreateInput) GetPaymentMethodId() string` + +GetPaymentMethodId returns the PaymentMethodId field if non-nil, zero value otherwise. + +### GetPaymentMethodIdOk + +`func (o *ProjectCreateInput) GetPaymentMethodIdOk() (*string, bool)` + +GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodId + +`func (o *ProjectCreateInput) SetPaymentMethodId(v string)` + +SetPaymentMethodId sets PaymentMethodId field to given value. + +### HasPaymentMethodId + +`func (o *ProjectCreateInput) HasPaymentMethodId() bool` + +HasPaymentMethodId returns a boolean if a field has been set. + +### GetType + +`func (o *ProjectCreateInput) GetType() ProjectCreateFromRootInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ProjectCreateInput) GetTypeOk() (*ProjectCreateFromRootInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ProjectCreateInput) SetType(v ProjectCreateFromRootInputType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ProjectCreateInput) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetTags + +`func (o *ProjectCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *ProjectCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *ProjectCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *ProjectCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectIdName.md b/services/metalv1/docs/ProjectIdName.md new file mode 100644 index 00000000..e31ed043 --- /dev/null +++ b/services/metalv1/docs/ProjectIdName.md @@ -0,0 +1,82 @@ +# ProjectIdName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewProjectIdName + +`func NewProjectIdName() *ProjectIdName` + +NewProjectIdName instantiates a new ProjectIdName object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectIdNameWithDefaults + +`func NewProjectIdNameWithDefaults() *ProjectIdName` + +NewProjectIdNameWithDefaults instantiates a new ProjectIdName object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ProjectIdName) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ProjectIdName) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ProjectIdName) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *ProjectIdName) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *ProjectIdName) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectIdName) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectIdName) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ProjectIdName) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectList.md b/services/metalv1/docs/ProjectList.md new file mode 100644 index 00000000..b1def0f4 --- /dev/null +++ b/services/metalv1/docs/ProjectList.md @@ -0,0 +1,82 @@ +# ProjectList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] +**Projects** | Pointer to [**[]Project**](Project.md) | | [optional] + +## Methods + +### NewProjectList + +`func NewProjectList() *ProjectList` + +NewProjectList instantiates a new ProjectList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectListWithDefaults + +`func NewProjectListWithDefaults() *ProjectList` + +NewProjectListWithDefaults instantiates a new ProjectList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMeta + +`func (o *ProjectList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *ProjectList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *ProjectList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *ProjectList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetProjects + +`func (o *ProjectList) GetProjects() []Project` + +GetProjects returns the Projects field if non-nil, zero value otherwise. + +### GetProjectsOk + +`func (o *ProjectList) GetProjectsOk() (*[]Project, bool)` + +GetProjectsOk returns a tuple with the Projects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjects + +`func (o *ProjectList) SetProjects(v []Project)` + +SetProjects sets Projects field to given value. + +### HasProjects + +`func (o *ProjectList) HasProjects() bool` + +HasProjects returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectType.md b/services/metalv1/docs/ProjectType.md new file mode 100644 index 00000000..233e36ca --- /dev/null +++ b/services/metalv1/docs/ProjectType.md @@ -0,0 +1,13 @@ +# ProjectType + +## Enum + + +* `DEFAULT` (value: `"default"`) + +* `VMCE` (value: `"vmce"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectUpdateInput.md b/services/metalv1/docs/ProjectUpdateInput.md new file mode 100644 index 00000000..ab3d6be4 --- /dev/null +++ b/services/metalv1/docs/ProjectUpdateInput.md @@ -0,0 +1,160 @@ +# ProjectUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BackendTransferEnabled** | Pointer to **bool** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Name** | Pointer to **string** | The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. | [optional] +**PaymentMethodId** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewProjectUpdateInput + +`func NewProjectUpdateInput() *ProjectUpdateInput` + +NewProjectUpdateInput instantiates a new ProjectUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectUpdateInputWithDefaults + +`func NewProjectUpdateInputWithDefaults() *ProjectUpdateInput` + +NewProjectUpdateInputWithDefaults instantiates a new ProjectUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBackendTransferEnabled + +`func (o *ProjectUpdateInput) GetBackendTransferEnabled() bool` + +GetBackendTransferEnabled returns the BackendTransferEnabled field if non-nil, zero value otherwise. + +### GetBackendTransferEnabledOk + +`func (o *ProjectUpdateInput) GetBackendTransferEnabledOk() (*bool, bool)` + +GetBackendTransferEnabledOk returns a tuple with the BackendTransferEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBackendTransferEnabled + +`func (o *ProjectUpdateInput) SetBackendTransferEnabled(v bool)` + +SetBackendTransferEnabled sets BackendTransferEnabled field to given value. + +### HasBackendTransferEnabled + +`func (o *ProjectUpdateInput) HasBackendTransferEnabled() bool` + +HasBackendTransferEnabled returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *ProjectUpdateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *ProjectUpdateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *ProjectUpdateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *ProjectUpdateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetName + +`func (o *ProjectUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ProjectUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPaymentMethodId + +`func (o *ProjectUpdateInput) GetPaymentMethodId() string` + +GetPaymentMethodId returns the PaymentMethodId field if non-nil, zero value otherwise. + +### GetPaymentMethodIdOk + +`func (o *ProjectUpdateInput) GetPaymentMethodIdOk() (*string, bool)` + +GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodId + +`func (o *ProjectUpdateInput) SetPaymentMethodId(v string)` + +SetPaymentMethodId sets PaymentMethodId field to given value. + +### HasPaymentMethodId + +`func (o *ProjectUpdateInput) HasPaymentMethodId() bool` + +HasPaymentMethodId returns a boolean if a field has been set. + +### GetTags + +`func (o *ProjectUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *ProjectUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *ProjectUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *ProjectUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectUsage.md b/services/metalv1/docs/ProjectUsage.md new file mode 100644 index 00000000..44572f6c --- /dev/null +++ b/services/metalv1/docs/ProjectUsage.md @@ -0,0 +1,264 @@ +# ProjectUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Facility** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Plan** | Pointer to **string** | | [optional] +**PlanVersion** | Pointer to **string** | | [optional] +**Price** | Pointer to **string** | | [optional] +**Quantity** | Pointer to **string** | | [optional] +**Total** | Pointer to **string** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Unit** | Pointer to **string** | | [optional] + +## Methods + +### NewProjectUsage + +`func NewProjectUsage() *ProjectUsage` + +NewProjectUsage instantiates a new ProjectUsage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectUsageWithDefaults + +`func NewProjectUsageWithDefaults() *ProjectUsage` + +NewProjectUsageWithDefaults instantiates a new ProjectUsage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFacility + +`func (o *ProjectUsage) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *ProjectUsage) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *ProjectUsage) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *ProjectUsage) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetName + +`func (o *ProjectUsage) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ProjectUsage) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ProjectUsage) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ProjectUsage) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPlan + +`func (o *ProjectUsage) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *ProjectUsage) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *ProjectUsage) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *ProjectUsage) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetPlanVersion + +`func (o *ProjectUsage) GetPlanVersion() string` + +GetPlanVersion returns the PlanVersion field if non-nil, zero value otherwise. + +### GetPlanVersionOk + +`func (o *ProjectUsage) GetPlanVersionOk() (*string, bool)` + +GetPlanVersionOk returns a tuple with the PlanVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanVersion + +`func (o *ProjectUsage) SetPlanVersion(v string)` + +SetPlanVersion sets PlanVersion field to given value. + +### HasPlanVersion + +`func (o *ProjectUsage) HasPlanVersion() bool` + +HasPlanVersion returns a boolean if a field has been set. + +### GetPrice + +`func (o *ProjectUsage) GetPrice() string` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *ProjectUsage) GetPriceOk() (*string, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *ProjectUsage) SetPrice(v string)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *ProjectUsage) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetQuantity + +`func (o *ProjectUsage) GetQuantity() string` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *ProjectUsage) GetQuantityOk() (*string, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *ProjectUsage) SetQuantity(v string)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *ProjectUsage) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetTotal + +`func (o *ProjectUsage) GetTotal() string` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *ProjectUsage) GetTotalOk() (*string, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *ProjectUsage) SetTotal(v string)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *ProjectUsage) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetType + +`func (o *ProjectUsage) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ProjectUsage) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ProjectUsage) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *ProjectUsage) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetUnit + +`func (o *ProjectUsage) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *ProjectUsage) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *ProjectUsage) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *ProjectUsage) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectUsageList.md b/services/metalv1/docs/ProjectUsageList.md new file mode 100644 index 00000000..aa2055b9 --- /dev/null +++ b/services/metalv1/docs/ProjectUsageList.md @@ -0,0 +1,56 @@ +# ProjectUsageList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Usages** | Pointer to [**[]ProjectUsage**](ProjectUsage.md) | | [optional] + +## Methods + +### NewProjectUsageList + +`func NewProjectUsageList() *ProjectUsageList` + +NewProjectUsageList instantiates a new ProjectUsageList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewProjectUsageListWithDefaults + +`func NewProjectUsageListWithDefaults() *ProjectUsageList` + +NewProjectUsageListWithDefaults instantiates a new ProjectUsageList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsages + +`func (o *ProjectUsageList) GetUsages() []ProjectUsage` + +GetUsages returns the Usages field if non-nil, zero value otherwise. + +### GetUsagesOk + +`func (o *ProjectUsageList) GetUsagesOk() (*[]ProjectUsage, bool)` + +GetUsagesOk returns a tuple with the Usages field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsages + +`func (o *ProjectUsageList) SetUsages(v []ProjectUsage)` + +SetUsages sets Usages field to given value. + +### HasUsages + +`func (o *ProjectUsageList) HasUsages() bool` + +HasUsages returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/ProjectsApi.md b/services/metalv1/docs/ProjectsApi.md new file mode 100644 index 00000000..2753cb56 --- /dev/null +++ b/services/metalv1/docs/ProjectsApi.md @@ -0,0 +1,823 @@ +# \ProjectsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateProject**](ProjectsApi.md#CreateProject) | **Post** /projects | Create a project +[**CreateProjectInvitation**](ProjectsApi.md#CreateProjectInvitation) | **Post** /projects/{project_id}/invitations | Create an invitation for a project +[**CreateTransferRequest**](ProjectsApi.md#CreateTransferRequest) | **Post** /projects/{id}/transfers | Create a transfer request +[**DeleteProject**](ProjectsApi.md#DeleteProject) | **Delete** /projects/{id} | Delete the project +[**FindIPReservationCustomdata**](ProjectsApi.md#FindIPReservationCustomdata) | **Get** /projects/{project_id}/ips/{id}/customdata | Retrieve the custom metadata of an IP Reservation +[**FindProjectById**](ProjectsApi.md#FindProjectById) | **Get** /projects/{id} | Retrieve a project +[**FindProjectCustomdata**](ProjectsApi.md#FindProjectCustomdata) | **Get** /projects/{id}/customdata | Retrieve the custom metadata of a project +[**FindProjectInvitations**](ProjectsApi.md#FindProjectInvitations) | **Get** /projects/{project_id}/invitations | Retrieve project invitations +[**FindProjectMemberships**](ProjectsApi.md#FindProjectMemberships) | **Get** /projects/{project_id}/memberships | Retrieve project memberships +[**FindProjects**](ProjectsApi.md#FindProjects) | **Get** /projects | Retrieve all projects +[**UpdateProject**](ProjectsApi.md#UpdateProject) | **Put** /projects/{id} | Update the project + + + +## CreateProject + +> Project CreateProject(ctx).ProjectCreateFromRootInput(projectCreateFromRootInput).Include(include).Exclude(exclude).Execute() + +Create a project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectCreateFromRootInput := *openapiclient.NewProjectCreateFromRootInput("Name_example") // ProjectCreateFromRootInput | Project to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.CreateProject(context.Background()).ProjectCreateFromRootInput(projectCreateFromRootInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateProject`: Project + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateProject`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **projectCreateFromRootInput** | [**ProjectCreateFromRootInput**](ProjectCreateFromRootInput.md) | Project to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateProjectInvitation + +> Invitation CreateProjectInvitation(ctx, projectId).InvitationInput(invitationInput).Include(include).Execute() + +Create an invitation for a project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + invitationInput := *openapiclient.NewInvitationInput("Invitee_example") // InvitationInput | Invitation to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.CreateProjectInvitation(context.Background(), projectId).InvitationInput(invitationInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateProjectInvitation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateProjectInvitation`: Invitation + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateProjectInvitation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectInvitationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **invitationInput** | [**InvitationInput**](InvitationInput.md) | Invitation to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**Invitation**](Invitation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateTransferRequest + +> TransferRequest CreateTransferRequest(ctx, id).TransferRequestInput(transferRequestInput).Include(include).Execute() + +Create a transfer request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | UUID of the project to be transferred + transferRequestInput := *openapiclient.NewTransferRequestInput() // TransferRequestInput | Transfer Request to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.CreateTransferRequest(context.Background(), id).TransferRequestInput(transferRequestInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.CreateTransferRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateTransferRequest`: TransferRequest + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.CreateTransferRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | UUID of the project to be transferred | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateTransferRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **transferRequestInput** | [**TransferRequestInput**](TransferRequestInput.md) | Transfer Request to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**TransferRequest**](TransferRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteProject + +> DeleteProject(ctx, id).Execute() + +Delete the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ProjectsApi.DeleteProject(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.DeleteProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindIPReservationCustomdata + +> FindIPReservationCustomdata(ctx, projectId, id).Execute() + +Retrieve the custom metadata of an IP Reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Ip Reservation UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ProjectsApi.FindIPReservationCustomdata(context.Background(), projectId, id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindIPReservationCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | +**id** | **string** | Ip Reservation UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindIPReservationCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectById + +> Project FindProjectById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.FindProjectById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectById`: Project + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectCustomdata + +> FindProjectCustomdata(ctx, id).Execute() + +Retrieve the custom metadata of a project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ProjectsApi.FindProjectCustomdata(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectInvitations + +> InvitationList FindProjectInvitations(ctx, projectId).Include(include).Page(page).PerPage(perPage).Execute() + +Retrieve project invitations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.FindProjectInvitations(context.Background(), projectId).Include(include).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectInvitations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectInvitations`: InvitationList + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectInvitations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectInvitationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectMemberships + +> MembershipList FindProjectMemberships(ctx, projectId).Search(search).Include(include).Page(page).PerPage(perPage).Execute() + +Retrieve project memberships + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + search := "search_example" // string | Search by member full name, id and email. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.FindProjectMemberships(context.Background(), projectId).Search(search).Include(include).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjectMemberships``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectMemberships`: MembershipList + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjectMemberships`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectMembershipsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **search** | **string** | Search by member full name, id and email. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**MembershipList**](MembershipList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjects + +> ProjectList FindProjects(ctx).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all projects + + +FindProjects is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + name := "name_example" // string | Filter results by name. (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.FindProjects(context.Background()).Name(name).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.FindProjects``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjects`: ProjectList + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.FindProjects`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | Filter results by name. | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**ProjectList**](ProjectList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateProject + +> Project UpdateProject(ctx, id).ProjectUpdateInput(projectUpdateInput).Include(include).Exclude(exclude).Execute() + +Update the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + projectUpdateInput := *openapiclient.NewProjectUpdateInput() // ProjectUpdateInput | Project to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProjectsApi.UpdateProject(context.Background(), id).ProjectUpdateInput(projectUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.UpdateProject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateProject`: Project + fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.UpdateProject`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateProjectRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **projectUpdateInput** | [**ProjectUpdateInput**](ProjectUpdateInput.md) | Project to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Raid.md b/services/metalv1/docs/Raid.md new file mode 100644 index 00000000..c4f14ed8 --- /dev/null +++ b/services/metalv1/docs/Raid.md @@ -0,0 +1,108 @@ +# Raid + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Devices** | Pointer to **[]string** | | [optional] +**Level** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewRaid + +`func NewRaid() *Raid` + +NewRaid instantiates a new Raid object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRaidWithDefaults + +`func NewRaidWithDefaults() *Raid` + +NewRaidWithDefaults instantiates a new Raid object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDevices + +`func (o *Raid) GetDevices() []string` + +GetDevices returns the Devices field if non-nil, zero value otherwise. + +### GetDevicesOk + +`func (o *Raid) GetDevicesOk() (*[]string, bool)` + +GetDevicesOk returns a tuple with the Devices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevices + +`func (o *Raid) SetDevices(v []string)` + +SetDevices sets Devices field to given value. + +### HasDevices + +`func (o *Raid) HasDevices() bool` + +HasDevices returns a boolean if a field has been set. + +### GetLevel + +`func (o *Raid) GetLevel() string` + +GetLevel returns the Level field if non-nil, zero value otherwise. + +### GetLevelOk + +`func (o *Raid) GetLevelOk() (*string, bool)` + +GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLevel + +`func (o *Raid) SetLevel(v string)` + +SetLevel sets Level field to given value. + +### HasLevel + +`func (o *Raid) HasLevel() bool` + +HasLevel returns a boolean if a field has been set. + +### GetName + +`func (o *Raid) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Raid) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Raid) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Raid) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/RecoveryCodeList.md b/services/metalv1/docs/RecoveryCodeList.md new file mode 100644 index 00000000..3a3080b5 --- /dev/null +++ b/services/metalv1/docs/RecoveryCodeList.md @@ -0,0 +1,56 @@ +# RecoveryCodeList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RecoveryCodes** | Pointer to **[]string** | | [optional] + +## Methods + +### NewRecoveryCodeList + +`func NewRecoveryCodeList() *RecoveryCodeList` + +NewRecoveryCodeList instantiates a new RecoveryCodeList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRecoveryCodeListWithDefaults + +`func NewRecoveryCodeListWithDefaults() *RecoveryCodeList` + +NewRecoveryCodeListWithDefaults instantiates a new RecoveryCodeList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRecoveryCodes + +`func (o *RecoveryCodeList) GetRecoveryCodes() []string` + +GetRecoveryCodes returns the RecoveryCodes field if non-nil, zero value otherwise. + +### GetRecoveryCodesOk + +`func (o *RecoveryCodeList) GetRecoveryCodesOk() (*[]string, bool)` + +GetRecoveryCodesOk returns a tuple with the RecoveryCodes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecoveryCodes + +`func (o *RecoveryCodeList) SetRecoveryCodes(v []string)` + +SetRecoveryCodes sets RecoveryCodes field to given value. + +### HasRecoveryCodes + +`func (o *RecoveryCodeList) HasRecoveryCodes() bool` + +HasRecoveryCodes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/RequestIPReservation201Response.md b/services/metalv1/docs/RequestIPReservation201Response.md new file mode 100644 index 00000000..c7cc369e --- /dev/null +++ b/services/metalv1/docs/RequestIPReservation201Response.md @@ -0,0 +1,826 @@ +# RequestIPReservation201Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addon** | Pointer to **bool** | | [optional] +**Address** | Pointer to **string** | | [optional] +**AddressFamily** | Pointer to **int32** | | [optional] +**Assignments** | Pointer to [**[]IPAssignment**](IPAssignment.md) | | [optional] +**Available** | Pointer to **string** | | [optional] +**Bill** | Pointer to **bool** | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Enabled** | Pointer to **bool** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**IPReservationFacility**](IPReservationFacility.md) | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**GlobalIp** | Pointer to **bool** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**MetalGateway** | Pointer to [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**ProjectLite** | Pointer to [**Project**](Project.md) | | [optional] +**RequestedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Public** | Pointer to **bool** | | [optional] +**State** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VrfIpReservationType**](VrfIpReservationType.md) | | +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Vrf** | [**Vrf**](Vrf.md) | | + +## Methods + +### NewRequestIPReservation201Response + +`func NewRequestIPReservation201Response(type_ VrfIpReservationType, vrf Vrf, ) *RequestIPReservation201Response` + +NewRequestIPReservation201Response instantiates a new RequestIPReservation201Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestIPReservation201ResponseWithDefaults + +`func NewRequestIPReservation201ResponseWithDefaults() *RequestIPReservation201Response` + +NewRequestIPReservation201ResponseWithDefaults instantiates a new RequestIPReservation201Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddon + +`func (o *RequestIPReservation201Response) GetAddon() bool` + +GetAddon returns the Addon field if non-nil, zero value otherwise. + +### GetAddonOk + +`func (o *RequestIPReservation201Response) GetAddonOk() (*bool, bool)` + +GetAddonOk returns a tuple with the Addon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddon + +`func (o *RequestIPReservation201Response) SetAddon(v bool)` + +SetAddon sets Addon field to given value. + +### HasAddon + +`func (o *RequestIPReservation201Response) HasAddon() bool` + +HasAddon returns a boolean if a field has been set. + +### GetAddress + +`func (o *RequestIPReservation201Response) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *RequestIPReservation201Response) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *RequestIPReservation201Response) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *RequestIPReservation201Response) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetAddressFamily + +`func (o *RequestIPReservation201Response) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *RequestIPReservation201Response) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *RequestIPReservation201Response) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *RequestIPReservation201Response) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetAssignments + +`func (o *RequestIPReservation201Response) GetAssignments() []IPAssignment` + +GetAssignments returns the Assignments field if non-nil, zero value otherwise. + +### GetAssignmentsOk + +`func (o *RequestIPReservation201Response) GetAssignmentsOk() (*[]IPAssignment, bool)` + +GetAssignmentsOk returns a tuple with the Assignments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignments + +`func (o *RequestIPReservation201Response) SetAssignments(v []IPAssignment)` + +SetAssignments sets Assignments field to given value. + +### HasAssignments + +`func (o *RequestIPReservation201Response) HasAssignments() bool` + +HasAssignments returns a boolean if a field has been set. + +### GetAvailable + +`func (o *RequestIPReservation201Response) GetAvailable() string` + +GetAvailable returns the Available field if non-nil, zero value otherwise. + +### GetAvailableOk + +`func (o *RequestIPReservation201Response) GetAvailableOk() (*string, bool)` + +GetAvailableOk returns a tuple with the Available field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailable + +`func (o *RequestIPReservation201Response) SetAvailable(v string)` + +SetAvailable sets Available field to given value. + +### HasAvailable + +`func (o *RequestIPReservation201Response) HasAvailable() bool` + +HasAvailable returns a boolean if a field has been set. + +### GetBill + +`func (o *RequestIPReservation201Response) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *RequestIPReservation201Response) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *RequestIPReservation201Response) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *RequestIPReservation201Response) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetCidr + +`func (o *RequestIPReservation201Response) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *RequestIPReservation201Response) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *RequestIPReservation201Response) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *RequestIPReservation201Response) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *RequestIPReservation201Response) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *RequestIPReservation201Response) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *RequestIPReservation201Response) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *RequestIPReservation201Response) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *RequestIPReservation201Response) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *RequestIPReservation201Response) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *RequestIPReservation201Response) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *RequestIPReservation201Response) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetEnabled + +`func (o *RequestIPReservation201Response) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *RequestIPReservation201Response) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *RequestIPReservation201Response) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + +### HasEnabled + +`func (o *RequestIPReservation201Response) HasEnabled() bool` + +HasEnabled returns a boolean if a field has been set. + +### GetDetails + +`func (o *RequestIPReservation201Response) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *RequestIPReservation201Response) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *RequestIPReservation201Response) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *RequestIPReservation201Response) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *RequestIPReservation201Response) GetFacility() IPReservationFacility` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *RequestIPReservation201Response) GetFacilityOk() (*IPReservationFacility, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *RequestIPReservation201Response) SetFacility(v IPReservationFacility)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *RequestIPReservation201Response) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetGateway + +`func (o *RequestIPReservation201Response) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *RequestIPReservation201Response) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *RequestIPReservation201Response) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *RequestIPReservation201Response) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetGlobalIp + +`func (o *RequestIPReservation201Response) GetGlobalIp() bool` + +GetGlobalIp returns the GlobalIp field if non-nil, zero value otherwise. + +### GetGlobalIpOk + +`func (o *RequestIPReservation201Response) GetGlobalIpOk() (*bool, bool)` + +GetGlobalIpOk returns a tuple with the GlobalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGlobalIp + +`func (o *RequestIPReservation201Response) SetGlobalIp(v bool)` + +SetGlobalIp sets GlobalIp field to given value. + +### HasGlobalIp + +`func (o *RequestIPReservation201Response) HasGlobalIp() bool` + +HasGlobalIp returns a boolean if a field has been set. + +### GetHref + +`func (o *RequestIPReservation201Response) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *RequestIPReservation201Response) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *RequestIPReservation201Response) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *RequestIPReservation201Response) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *RequestIPReservation201Response) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RequestIPReservation201Response) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RequestIPReservation201Response) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *RequestIPReservation201Response) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetManageable + +`func (o *RequestIPReservation201Response) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *RequestIPReservation201Response) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *RequestIPReservation201Response) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *RequestIPReservation201Response) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetManagement + +`func (o *RequestIPReservation201Response) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *RequestIPReservation201Response) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *RequestIPReservation201Response) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *RequestIPReservation201Response) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *RequestIPReservation201Response) GetMetalGateway() MetalGatewayLite` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *RequestIPReservation201Response) GetMetalGatewayOk() (*MetalGatewayLite, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *RequestIPReservation201Response) SetMetalGateway(v MetalGatewayLite)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *RequestIPReservation201Response) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetMetro + +`func (o *RequestIPReservation201Response) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *RequestIPReservation201Response) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *RequestIPReservation201Response) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *RequestIPReservation201Response) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetNetmask + +`func (o *RequestIPReservation201Response) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *RequestIPReservation201Response) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *RequestIPReservation201Response) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *RequestIPReservation201Response) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *RequestIPReservation201Response) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *RequestIPReservation201Response) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *RequestIPReservation201Response) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *RequestIPReservation201Response) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetProject + +`func (o *RequestIPReservation201Response) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *RequestIPReservation201Response) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *RequestIPReservation201Response) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *RequestIPReservation201Response) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *RequestIPReservation201Response) GetProjectLite() Project` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *RequestIPReservation201Response) GetProjectLiteOk() (*Project, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *RequestIPReservation201Response) SetProjectLite(v Project)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *RequestIPReservation201Response) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetRequestedBy + +`func (o *RequestIPReservation201Response) GetRequestedBy() Href` + +GetRequestedBy returns the RequestedBy field if non-nil, zero value otherwise. + +### GetRequestedByOk + +`func (o *RequestIPReservation201Response) GetRequestedByOk() (*Href, bool)` + +GetRequestedByOk returns a tuple with the RequestedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestedBy + +`func (o *RequestIPReservation201Response) SetRequestedBy(v Href)` + +SetRequestedBy sets RequestedBy field to given value. + +### HasRequestedBy + +`func (o *RequestIPReservation201Response) HasRequestedBy() bool` + +HasRequestedBy returns a boolean if a field has been set. + +### GetPublic + +`func (o *RequestIPReservation201Response) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *RequestIPReservation201Response) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *RequestIPReservation201Response) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *RequestIPReservation201Response) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetState + +`func (o *RequestIPReservation201Response) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *RequestIPReservation201Response) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *RequestIPReservation201Response) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *RequestIPReservation201Response) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTags + +`func (o *RequestIPReservation201Response) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *RequestIPReservation201Response) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *RequestIPReservation201Response) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *RequestIPReservation201Response) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *RequestIPReservation201Response) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *RequestIPReservation201Response) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *RequestIPReservation201Response) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + + +### GetCreatedBy + +`func (o *RequestIPReservation201Response) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *RequestIPReservation201Response) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *RequestIPReservation201Response) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *RequestIPReservation201Response) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetVrf + +`func (o *RequestIPReservation201Response) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *RequestIPReservation201Response) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *RequestIPReservation201Response) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/RequestIPReservationRequest.md b/services/metalv1/docs/RequestIPReservationRequest.md new file mode 100644 index 00000000..4e7da896 --- /dev/null +++ b/services/metalv1/docs/RequestIPReservationRequest.md @@ -0,0 +1,317 @@ +# RequestIPReservationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Comments** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Facility** | Pointer to **string** | | [optional] +**FailOnApprovalRequired** | Pointer to **bool** | | [optional] +**Metro** | Pointer to **string** | The code of the metro you are requesting the IP reservation in. | [optional] +**Quantity** | **int32** | | +**Tags** | Pointer to **[]string** | | [optional] +**Type** | **string** | Must be set to 'vrf' | +**Cidr** | **int32** | The size of the VRF IP Reservation's subnet | +**Network** | **string** | The starting address for this VRF IP Reservation's subnet | +**VrfId** | **string** | The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. | + +## Methods + +### NewRequestIPReservationRequest + +`func NewRequestIPReservationRequest(quantity int32, type_ string, cidr int32, network string, vrfId string, ) *RequestIPReservationRequest` + +NewRequestIPReservationRequest instantiates a new RequestIPReservationRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRequestIPReservationRequestWithDefaults + +`func NewRequestIPReservationRequestWithDefaults() *RequestIPReservationRequest` + +NewRequestIPReservationRequestWithDefaults instantiates a new RequestIPReservationRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetComments + +`func (o *RequestIPReservationRequest) GetComments() string` + +GetComments returns the Comments field if non-nil, zero value otherwise. + +### GetCommentsOk + +`func (o *RequestIPReservationRequest) GetCommentsOk() (*string, bool)` + +GetCommentsOk returns a tuple with the Comments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetComments + +`func (o *RequestIPReservationRequest) SetComments(v string)` + +SetComments sets Comments field to given value. + +### HasComments + +`func (o *RequestIPReservationRequest) HasComments() bool` + +HasComments returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *RequestIPReservationRequest) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *RequestIPReservationRequest) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *RequestIPReservationRequest) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *RequestIPReservationRequest) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDetails + +`func (o *RequestIPReservationRequest) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *RequestIPReservationRequest) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *RequestIPReservationRequest) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *RequestIPReservationRequest) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetFacility + +`func (o *RequestIPReservationRequest) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *RequestIPReservationRequest) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *RequestIPReservationRequest) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *RequestIPReservationRequest) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetFailOnApprovalRequired + +`func (o *RequestIPReservationRequest) GetFailOnApprovalRequired() bool` + +GetFailOnApprovalRequired returns the FailOnApprovalRequired field if non-nil, zero value otherwise. + +### GetFailOnApprovalRequiredOk + +`func (o *RequestIPReservationRequest) GetFailOnApprovalRequiredOk() (*bool, bool)` + +GetFailOnApprovalRequiredOk returns a tuple with the FailOnApprovalRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailOnApprovalRequired + +`func (o *RequestIPReservationRequest) SetFailOnApprovalRequired(v bool)` + +SetFailOnApprovalRequired sets FailOnApprovalRequired field to given value. + +### HasFailOnApprovalRequired + +`func (o *RequestIPReservationRequest) HasFailOnApprovalRequired() bool` + +HasFailOnApprovalRequired returns a boolean if a field has been set. + +### GetMetro + +`func (o *RequestIPReservationRequest) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *RequestIPReservationRequest) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *RequestIPReservationRequest) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *RequestIPReservationRequest) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetQuantity + +`func (o *RequestIPReservationRequest) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *RequestIPReservationRequest) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *RequestIPReservationRequest) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + + +### GetTags + +`func (o *RequestIPReservationRequest) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *RequestIPReservationRequest) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *RequestIPReservationRequest) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *RequestIPReservationRequest) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *RequestIPReservationRequest) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *RequestIPReservationRequest) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *RequestIPReservationRequest) SetType(v string)` + +SetType sets Type field to given value. + + +### GetCidr + +`func (o *RequestIPReservationRequest) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *RequestIPReservationRequest) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *RequestIPReservationRequest) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + + +### GetNetwork + +`func (o *RequestIPReservationRequest) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *RequestIPReservationRequest) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *RequestIPReservationRequest) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + + +### GetVrfId + +`func (o *RequestIPReservationRequest) GetVrfId() string` + +GetVrfId returns the VrfId field if non-nil, zero value otherwise. + +### GetVrfIdOk + +`func (o *RequestIPReservationRequest) GetVrfIdOk() (*string, bool)` + +GetVrfIdOk returns a tuple with the VrfId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrfId + +`func (o *RequestIPReservationRequest) SetVrfId(v string)` + +SetVrfId sets VrfId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SSHKey.md b/services/metalv1/docs/SSHKey.md new file mode 100644 index 00000000..c25b66df --- /dev/null +++ b/services/metalv1/docs/SSHKey.md @@ -0,0 +1,264 @@ +# SSHKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Entity** | Pointer to [**Href**](Href.md) | | [optional] +**Fingerprint** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Key** | Pointer to **string** | | [optional] +**Label** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewSSHKey + +`func NewSSHKey() *SSHKey` + +NewSSHKey instantiates a new SSHKey object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSSHKeyWithDefaults + +`func NewSSHKeyWithDefaults() *SSHKey` + +NewSSHKeyWithDefaults instantiates a new SSHKey object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *SSHKey) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SSHKey) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *SSHKey) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *SSHKey) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetEntity + +`func (o *SSHKey) GetEntity() Href` + +GetEntity returns the Entity field if non-nil, zero value otherwise. + +### GetEntityOk + +`func (o *SSHKey) GetEntityOk() (*Href, bool)` + +GetEntityOk returns a tuple with the Entity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntity + +`func (o *SSHKey) SetEntity(v Href)` + +SetEntity sets Entity field to given value. + +### HasEntity + +`func (o *SSHKey) HasEntity() bool` + +HasEntity returns a boolean if a field has been set. + +### GetFingerprint + +`func (o *SSHKey) GetFingerprint() string` + +GetFingerprint returns the Fingerprint field if non-nil, zero value otherwise. + +### GetFingerprintOk + +`func (o *SSHKey) GetFingerprintOk() (*string, bool)` + +GetFingerprintOk returns a tuple with the Fingerprint field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFingerprint + +`func (o *SSHKey) SetFingerprint(v string)` + +SetFingerprint sets Fingerprint field to given value. + +### HasFingerprint + +`func (o *SSHKey) HasFingerprint() bool` + +HasFingerprint returns a boolean if a field has been set. + +### GetHref + +`func (o *SSHKey) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *SSHKey) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *SSHKey) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *SSHKey) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *SSHKey) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SSHKey) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SSHKey) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SSHKey) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetKey + +`func (o *SSHKey) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *SSHKey) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *SSHKey) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *SSHKey) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetLabel + +`func (o *SSHKey) GetLabel() string` + +GetLabel returns the Label field if non-nil, zero value otherwise. + +### GetLabelOk + +`func (o *SSHKey) GetLabelOk() (*string, bool)` + +GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabel + +`func (o *SSHKey) SetLabel(v string)` + +SetLabel sets Label field to given value. + +### HasLabel + +`func (o *SSHKey) HasLabel() bool` + +HasLabel returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *SSHKey) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *SSHKey) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *SSHKey) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *SSHKey) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetTags + +`func (o *SSHKey) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SSHKey) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *SSHKey) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *SSHKey) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SSHKeyCreateInput.md b/services/metalv1/docs/SSHKeyCreateInput.md new file mode 100644 index 00000000..86cfba7c --- /dev/null +++ b/services/metalv1/docs/SSHKeyCreateInput.md @@ -0,0 +1,134 @@ +# SSHKeyCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**InstancesIds** | Pointer to **[]string** | List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging to entity will be included | [optional] +**Key** | Pointer to **string** | | [optional] +**Label** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewSSHKeyCreateInput + +`func NewSSHKeyCreateInput() *SSHKeyCreateInput` + +NewSSHKeyCreateInput instantiates a new SSHKeyCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSSHKeyCreateInputWithDefaults + +`func NewSSHKeyCreateInputWithDefaults() *SSHKeyCreateInput` + +NewSSHKeyCreateInputWithDefaults instantiates a new SSHKeyCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetInstancesIds + +`func (o *SSHKeyCreateInput) GetInstancesIds() []string` + +GetInstancesIds returns the InstancesIds field if non-nil, zero value otherwise. + +### GetInstancesIdsOk + +`func (o *SSHKeyCreateInput) GetInstancesIdsOk() (*[]string, bool)` + +GetInstancesIdsOk returns a tuple with the InstancesIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstancesIds + +`func (o *SSHKeyCreateInput) SetInstancesIds(v []string)` + +SetInstancesIds sets InstancesIds field to given value. + +### HasInstancesIds + +`func (o *SSHKeyCreateInput) HasInstancesIds() bool` + +HasInstancesIds returns a boolean if a field has been set. + +### GetKey + +`func (o *SSHKeyCreateInput) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *SSHKeyCreateInput) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *SSHKeyCreateInput) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *SSHKeyCreateInput) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetLabel + +`func (o *SSHKeyCreateInput) GetLabel() string` + +GetLabel returns the Label field if non-nil, zero value otherwise. + +### GetLabelOk + +`func (o *SSHKeyCreateInput) GetLabelOk() (*string, bool)` + +GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabel + +`func (o *SSHKeyCreateInput) SetLabel(v string)` + +SetLabel sets Label field to given value. + +### HasLabel + +`func (o *SSHKeyCreateInput) HasLabel() bool` + +HasLabel returns a boolean if a field has been set. + +### GetTags + +`func (o *SSHKeyCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SSHKeyCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *SSHKeyCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *SSHKeyCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SSHKeyInput.md b/services/metalv1/docs/SSHKeyInput.md new file mode 100644 index 00000000..b8a90ffa --- /dev/null +++ b/services/metalv1/docs/SSHKeyInput.md @@ -0,0 +1,108 @@ +# SSHKeyInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | Pointer to **string** | | [optional] +**Label** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewSSHKeyInput + +`func NewSSHKeyInput() *SSHKeyInput` + +NewSSHKeyInput instantiates a new SSHKeyInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSSHKeyInputWithDefaults + +`func NewSSHKeyInputWithDefaults() *SSHKeyInput` + +NewSSHKeyInputWithDefaults instantiates a new SSHKeyInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKey + +`func (o *SSHKeyInput) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *SSHKeyInput) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *SSHKeyInput) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *SSHKeyInput) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetLabel + +`func (o *SSHKeyInput) GetLabel() string` + +GetLabel returns the Label field if non-nil, zero value otherwise. + +### GetLabelOk + +`func (o *SSHKeyInput) GetLabelOk() (*string, bool)` + +GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabel + +`func (o *SSHKeyInput) SetLabel(v string)` + +SetLabel sets Label field to given value. + +### HasLabel + +`func (o *SSHKeyInput) HasLabel() bool` + +HasLabel returns a boolean if a field has been set. + +### GetTags + +`func (o *SSHKeyInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SSHKeyInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *SSHKeyInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *SSHKeyInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SSHKeyList.md b/services/metalv1/docs/SSHKeyList.md new file mode 100644 index 00000000..9f3220a0 --- /dev/null +++ b/services/metalv1/docs/SSHKeyList.md @@ -0,0 +1,56 @@ +# SSHKeyList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SshKeys** | Pointer to [**[]SSHKey**](SSHKey.md) | | [optional] + +## Methods + +### NewSSHKeyList + +`func NewSSHKeyList() *SSHKeyList` + +NewSSHKeyList instantiates a new SSHKeyList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSSHKeyListWithDefaults + +`func NewSSHKeyListWithDefaults() *SSHKeyList` + +NewSSHKeyListWithDefaults instantiates a new SSHKeyList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSshKeys + +`func (o *SSHKeyList) GetSshKeys() []SSHKey` + +GetSshKeys returns the SshKeys field if non-nil, zero value otherwise. + +### GetSshKeysOk + +`func (o *SSHKeyList) GetSshKeysOk() (*[]SSHKey, bool)` + +GetSshKeysOk returns a tuple with the SshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSshKeys + +`func (o *SSHKeyList) SetSshKeys(v []SSHKey)` + +SetSshKeys sets SshKeys field to given value. + +### HasSshKeys + +`func (o *SSHKeyList) HasSshKeys() bool` + +HasSshKeys returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SSHKeysApi.md b/services/metalv1/docs/SSHKeysApi.md new file mode 100644 index 00000000..37fe2f3d --- /dev/null +++ b/services/metalv1/docs/SSHKeysApi.md @@ -0,0 +1,588 @@ +# \SSHKeysApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateProjectSSHKey**](SSHKeysApi.md#CreateProjectSSHKey) | **Post** /projects/{id}/ssh-keys | Create a ssh key for the given project +[**CreateSSHKey**](SSHKeysApi.md#CreateSSHKey) | **Post** /ssh-keys | Create a ssh key for the current user +[**DeleteSSHKey**](SSHKeysApi.md#DeleteSSHKey) | **Delete** /ssh-keys/{id} | Delete the ssh key +[**FindDeviceSSHKeys**](SSHKeysApi.md#FindDeviceSSHKeys) | **Get** /devices/{id}/ssh-keys | Retrieve a device's ssh keys +[**FindProjectSSHKeys**](SSHKeysApi.md#FindProjectSSHKeys) | **Get** /projects/{id}/ssh-keys | Retrieve a project's ssh keys +[**FindSSHKeyById**](SSHKeysApi.md#FindSSHKeyById) | **Get** /ssh-keys/{id} | Retrieve a ssh key +[**FindSSHKeys**](SSHKeysApi.md#FindSSHKeys) | **Get** /ssh-keys | Retrieve all ssh keys +[**UpdateSSHKey**](SSHKeysApi.md#UpdateSSHKey) | **Put** /ssh-keys/{id} | Update the ssh key + + + +## CreateProjectSSHKey + +> SSHKey CreateProjectSSHKey(ctx, id).SSHKeyCreateInput(sSHKeyCreateInput).Include(include).Execute() + +Create a ssh key for the given project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + sSHKeyCreateInput := *openapiclient.NewSSHKeyCreateInput() // SSHKeyCreateInput | ssh key to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.CreateProjectSSHKey(context.Background(), id).SSHKeyCreateInput(sSHKeyCreateInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.CreateProjectSSHKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateProjectSSHKey`: SSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.CreateProjectSSHKey`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateProjectSSHKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **sSHKeyCreateInput** | [**SSHKeyCreateInput**](SSHKeyCreateInput.md) | ssh key to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateSSHKey + +> SSHKey CreateSSHKey(ctx).SSHKeyCreateInput(sSHKeyCreateInput).Include(include).Execute() + +Create a ssh key for the current user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + sSHKeyCreateInput := *openapiclient.NewSSHKeyCreateInput() // SSHKeyCreateInput | ssh key to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.CreateSSHKey(context.Background()).SSHKeyCreateInput(sSHKeyCreateInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.CreateSSHKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateSSHKey`: SSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.CreateSSHKey`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateSSHKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sSHKeyCreateInput** | [**SSHKeyCreateInput**](SSHKeyCreateInput.md) | ssh key to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteSSHKey + +> DeleteSSHKey(ctx, id).Execute() + +Delete the ssh key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ssh key UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.SSHKeysApi.DeleteSSHKey(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.DeleteSSHKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | ssh key UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteSSHKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindDeviceSSHKeys + +> SSHKeyList FindDeviceSSHKeys(ctx, id).SearchString(searchString).Include(include).Execute() + +Retrieve a device's ssh keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + searchString := "searchString_example" // string | Search by key, label, or fingerprint (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.FindDeviceSSHKeys(context.Background(), id).SearchString(searchString).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.FindDeviceSSHKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceSSHKeys`: SSHKeyList + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.FindDeviceSSHKeys`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceSSHKeysRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **searchString** | **string** | Search by key, label, or fingerprint | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectSSHKeys + +> SSHKeyList FindProjectSSHKeys(ctx, id).Query(query).Include(include).Execute() + +Retrieve a project's ssh keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + query := "query_example" // string | Search by key, label, or fingerprint (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.FindProjectSSHKeys(context.Background(), id).Query(query).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.FindProjectSSHKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectSSHKeys`: SSHKeyList + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.FindProjectSSHKeys`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectSSHKeysRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **query** | **string** | Search by key, label, or fingerprint | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSSHKeyById + +> SSHKey FindSSHKeyById(ctx, id).Include(include).Execute() + +Retrieve a ssh key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | SSH Key UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.FindSSHKeyById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.FindSSHKeyById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSSHKeyById`: SSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.FindSSHKeyById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | SSH Key UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSSHKeyByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSSHKeys + +> SSHKeyList FindSSHKeys(ctx).Search(search).Include(include).Execute() + +Retrieve all ssh keys + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + search := "search_example" // string | Search by key, label, or fingerprint (optional) + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.FindSSHKeys(context.Background()).Search(search).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.FindSSHKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSSHKeys`: SSHKeyList + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.FindSSHKeys`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSSHKeysRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search** | **string** | Search by key, label, or fingerprint | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKeyList**](SSHKeyList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateSSHKey + +> SSHKey UpdateSSHKey(ctx, id).SSHKeyInput(sSHKeyInput).Include(include).Execute() + +Update the ssh key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | SSH Key UUID + sSHKeyInput := *openapiclient.NewSSHKeyInput() // SSHKeyInput | ssh key to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SSHKeysApi.UpdateSSHKey(context.Background(), id).SSHKeyInput(sSHKeyInput).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SSHKeysApi.UpdateSSHKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateSSHKey`: SSHKey + fmt.Fprintf(os.Stdout, "Response from `SSHKeysApi.UpdateSSHKey`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | SSH Key UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateSSHKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **sSHKeyInput** | [**SSHKeyInput**](SSHKeyInput.md) | ssh key to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SSHKey**](SSHKey.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/SelfServiceReservationItemRequest.md b/services/metalv1/docs/SelfServiceReservationItemRequest.md new file mode 100644 index 00000000..124685a3 --- /dev/null +++ b/services/metalv1/docs/SelfServiceReservationItemRequest.md @@ -0,0 +1,160 @@ +# SelfServiceReservationItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**MetroId** | Pointer to **string** | | [optional] +**PlanId** | Pointer to **string** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**Term** | Pointer to **string** | | [optional] + +## Methods + +### NewSelfServiceReservationItemRequest + +`func NewSelfServiceReservationItemRequest() *SelfServiceReservationItemRequest` + +NewSelfServiceReservationItemRequest instantiates a new SelfServiceReservationItemRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSelfServiceReservationItemRequestWithDefaults + +`func NewSelfServiceReservationItemRequestWithDefaults() *SelfServiceReservationItemRequest` + +NewSelfServiceReservationItemRequestWithDefaults instantiates a new SelfServiceReservationItemRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *SelfServiceReservationItemRequest) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *SelfServiceReservationItemRequest) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *SelfServiceReservationItemRequest) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *SelfServiceReservationItemRequest) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetMetroId + +`func (o *SelfServiceReservationItemRequest) GetMetroId() string` + +GetMetroId returns the MetroId field if non-nil, zero value otherwise. + +### GetMetroIdOk + +`func (o *SelfServiceReservationItemRequest) GetMetroIdOk() (*string, bool)` + +GetMetroIdOk returns a tuple with the MetroId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetroId + +`func (o *SelfServiceReservationItemRequest) SetMetroId(v string)` + +SetMetroId sets MetroId field to given value. + +### HasMetroId + +`func (o *SelfServiceReservationItemRequest) HasMetroId() bool` + +HasMetroId returns a boolean if a field has been set. + +### GetPlanId + +`func (o *SelfServiceReservationItemRequest) GetPlanId() string` + +GetPlanId returns the PlanId field if non-nil, zero value otherwise. + +### GetPlanIdOk + +`func (o *SelfServiceReservationItemRequest) GetPlanIdOk() (*string, bool)` + +GetPlanIdOk returns a tuple with the PlanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanId + +`func (o *SelfServiceReservationItemRequest) SetPlanId(v string)` + +SetPlanId sets PlanId field to given value. + +### HasPlanId + +`func (o *SelfServiceReservationItemRequest) HasPlanId() bool` + +HasPlanId returns a boolean if a field has been set. + +### GetQuantity + +`func (o *SelfServiceReservationItemRequest) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *SelfServiceReservationItemRequest) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *SelfServiceReservationItemRequest) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *SelfServiceReservationItemRequest) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetTerm + +`func (o *SelfServiceReservationItemRequest) GetTerm() string` + +GetTerm returns the Term field if non-nil, zero value otherwise. + +### GetTermOk + +`func (o *SelfServiceReservationItemRequest) GetTermOk() (*string, bool)` + +GetTermOk returns a tuple with the Term field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerm + +`func (o *SelfServiceReservationItemRequest) SetTerm(v string)` + +SetTerm sets Term field to given value. + +### HasTerm + +`func (o *SelfServiceReservationItemRequest) HasTerm() bool` + +HasTerm returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SelfServiceReservationItemResponse.md b/services/metalv1/docs/SelfServiceReservationItemResponse.md new file mode 100644 index 00000000..63e5de24 --- /dev/null +++ b/services/metalv1/docs/SelfServiceReservationItemResponse.md @@ -0,0 +1,316 @@ +# SelfServiceReservationItemResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Amount** | Pointer to **float32** | | [optional] +**Id** | Pointer to **string** | | [optional] +**MetroCode** | Pointer to **string** | | [optional] +**MetroId** | Pointer to **string** | | [optional] +**MetroName** | Pointer to **string** | | [optional] +**PlanId** | Pointer to **string** | | [optional] +**PlanName** | Pointer to **string** | | [optional] +**PlanSlug** | Pointer to **string** | | [optional] +**PlanCategories** | Pointer to **[]string** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**Term** | Pointer to **string** | | [optional] + +## Methods + +### NewSelfServiceReservationItemResponse + +`func NewSelfServiceReservationItemResponse() *SelfServiceReservationItemResponse` + +NewSelfServiceReservationItemResponse instantiates a new SelfServiceReservationItemResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSelfServiceReservationItemResponseWithDefaults + +`func NewSelfServiceReservationItemResponseWithDefaults() *SelfServiceReservationItemResponse` + +NewSelfServiceReservationItemResponseWithDefaults instantiates a new SelfServiceReservationItemResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAmount + +`func (o *SelfServiceReservationItemResponse) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *SelfServiceReservationItemResponse) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *SelfServiceReservationItemResponse) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + +### HasAmount + +`func (o *SelfServiceReservationItemResponse) HasAmount() bool` + +HasAmount returns a boolean if a field has been set. + +### GetId + +`func (o *SelfServiceReservationItemResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SelfServiceReservationItemResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SelfServiceReservationItemResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SelfServiceReservationItemResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMetroCode + +`func (o *SelfServiceReservationItemResponse) GetMetroCode() string` + +GetMetroCode returns the MetroCode field if non-nil, zero value otherwise. + +### GetMetroCodeOk + +`func (o *SelfServiceReservationItemResponse) GetMetroCodeOk() (*string, bool)` + +GetMetroCodeOk returns a tuple with the MetroCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetroCode + +`func (o *SelfServiceReservationItemResponse) SetMetroCode(v string)` + +SetMetroCode sets MetroCode field to given value. + +### HasMetroCode + +`func (o *SelfServiceReservationItemResponse) HasMetroCode() bool` + +HasMetroCode returns a boolean if a field has been set. + +### GetMetroId + +`func (o *SelfServiceReservationItemResponse) GetMetroId() string` + +GetMetroId returns the MetroId field if non-nil, zero value otherwise. + +### GetMetroIdOk + +`func (o *SelfServiceReservationItemResponse) GetMetroIdOk() (*string, bool)` + +GetMetroIdOk returns a tuple with the MetroId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetroId + +`func (o *SelfServiceReservationItemResponse) SetMetroId(v string)` + +SetMetroId sets MetroId field to given value. + +### HasMetroId + +`func (o *SelfServiceReservationItemResponse) HasMetroId() bool` + +HasMetroId returns a boolean if a field has been set. + +### GetMetroName + +`func (o *SelfServiceReservationItemResponse) GetMetroName() string` + +GetMetroName returns the MetroName field if non-nil, zero value otherwise. + +### GetMetroNameOk + +`func (o *SelfServiceReservationItemResponse) GetMetroNameOk() (*string, bool)` + +GetMetroNameOk returns a tuple with the MetroName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetroName + +`func (o *SelfServiceReservationItemResponse) SetMetroName(v string)` + +SetMetroName sets MetroName field to given value. + +### HasMetroName + +`func (o *SelfServiceReservationItemResponse) HasMetroName() bool` + +HasMetroName returns a boolean if a field has been set. + +### GetPlanId + +`func (o *SelfServiceReservationItemResponse) GetPlanId() string` + +GetPlanId returns the PlanId field if non-nil, zero value otherwise. + +### GetPlanIdOk + +`func (o *SelfServiceReservationItemResponse) GetPlanIdOk() (*string, bool)` + +GetPlanIdOk returns a tuple with the PlanId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanId + +`func (o *SelfServiceReservationItemResponse) SetPlanId(v string)` + +SetPlanId sets PlanId field to given value. + +### HasPlanId + +`func (o *SelfServiceReservationItemResponse) HasPlanId() bool` + +HasPlanId returns a boolean if a field has been set. + +### GetPlanName + +`func (o *SelfServiceReservationItemResponse) GetPlanName() string` + +GetPlanName returns the PlanName field if non-nil, zero value otherwise. + +### GetPlanNameOk + +`func (o *SelfServiceReservationItemResponse) GetPlanNameOk() (*string, bool)` + +GetPlanNameOk returns a tuple with the PlanName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanName + +`func (o *SelfServiceReservationItemResponse) SetPlanName(v string)` + +SetPlanName sets PlanName field to given value. + +### HasPlanName + +`func (o *SelfServiceReservationItemResponse) HasPlanName() bool` + +HasPlanName returns a boolean if a field has been set. + +### GetPlanSlug + +`func (o *SelfServiceReservationItemResponse) GetPlanSlug() string` + +GetPlanSlug returns the PlanSlug field if non-nil, zero value otherwise. + +### GetPlanSlugOk + +`func (o *SelfServiceReservationItemResponse) GetPlanSlugOk() (*string, bool)` + +GetPlanSlugOk returns a tuple with the PlanSlug field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanSlug + +`func (o *SelfServiceReservationItemResponse) SetPlanSlug(v string)` + +SetPlanSlug sets PlanSlug field to given value. + +### HasPlanSlug + +`func (o *SelfServiceReservationItemResponse) HasPlanSlug() bool` + +HasPlanSlug returns a boolean if a field has been set. + +### GetPlanCategories + +`func (o *SelfServiceReservationItemResponse) GetPlanCategories() []string` + +GetPlanCategories returns the PlanCategories field if non-nil, zero value otherwise. + +### GetPlanCategoriesOk + +`func (o *SelfServiceReservationItemResponse) GetPlanCategoriesOk() (*[]string, bool)` + +GetPlanCategoriesOk returns a tuple with the PlanCategories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlanCategories + +`func (o *SelfServiceReservationItemResponse) SetPlanCategories(v []string)` + +SetPlanCategories sets PlanCategories field to given value. + +### HasPlanCategories + +`func (o *SelfServiceReservationItemResponse) HasPlanCategories() bool` + +HasPlanCategories returns a boolean if a field has been set. + +### GetQuantity + +`func (o *SelfServiceReservationItemResponse) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *SelfServiceReservationItemResponse) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *SelfServiceReservationItemResponse) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *SelfServiceReservationItemResponse) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetTerm + +`func (o *SelfServiceReservationItemResponse) GetTerm() string` + +GetTerm returns the Term field if non-nil, zero value otherwise. + +### GetTermOk + +`func (o *SelfServiceReservationItemResponse) GetTermOk() (*string, bool)` + +GetTermOk returns a tuple with the Term field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerm + +`func (o *SelfServiceReservationItemResponse) SetTerm(v string)` + +SetTerm sets Term field to given value. + +### HasTerm + +`func (o *SelfServiceReservationItemResponse) HasTerm() bool` + +HasTerm returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SelfServiceReservationList.md b/services/metalv1/docs/SelfServiceReservationList.md new file mode 100644 index 00000000..7b65bfa5 --- /dev/null +++ b/services/metalv1/docs/SelfServiceReservationList.md @@ -0,0 +1,56 @@ +# SelfServiceReservationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Reservations** | Pointer to [**[]SelfServiceReservationResponse**](SelfServiceReservationResponse.md) | | [optional] + +## Methods + +### NewSelfServiceReservationList + +`func NewSelfServiceReservationList() *SelfServiceReservationList` + +NewSelfServiceReservationList instantiates a new SelfServiceReservationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSelfServiceReservationListWithDefaults + +`func NewSelfServiceReservationListWithDefaults() *SelfServiceReservationList` + +NewSelfServiceReservationListWithDefaults instantiates a new SelfServiceReservationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReservations + +`func (o *SelfServiceReservationList) GetReservations() []SelfServiceReservationResponse` + +GetReservations returns the Reservations field if non-nil, zero value otherwise. + +### GetReservationsOk + +`func (o *SelfServiceReservationList) GetReservationsOk() (*[]SelfServiceReservationResponse, bool)` + +GetReservationsOk returns a tuple with the Reservations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReservations + +`func (o *SelfServiceReservationList) SetReservations(v []SelfServiceReservationResponse)` + +SetReservations sets Reservations field to given value. + +### HasReservations + +`func (o *SelfServiceReservationList) HasReservations() bool` + +HasReservations returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SelfServiceReservationResponse.md b/services/metalv1/docs/SelfServiceReservationResponse.md new file mode 100644 index 00000000..5114f81d --- /dev/null +++ b/services/metalv1/docs/SelfServiceReservationResponse.md @@ -0,0 +1,316 @@ +# SelfServiceReservationResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Item** | Pointer to [**[]SelfServiceReservationItemResponse**](SelfServiceReservationItemResponse.md) | | [optional] +**Notes** | Pointer to **string** | | [optional] +**Organization** | Pointer to **string** | | [optional] +**OrganizationId** | Pointer to **string** | | [optional] +**Period** | Pointer to [**CreateSelfServiceReservationRequestPeriod**](CreateSelfServiceReservationRequestPeriod.md) | | [optional] +**Project** | Pointer to **string** | | [optional] +**ProjectId** | Pointer to **string** | | [optional] +**StartDate** | Pointer to **time.Time** | | [optional] +**Status** | Pointer to **string** | | [optional] +**TotalCost** | Pointer to **int32** | | [optional] + +## Methods + +### NewSelfServiceReservationResponse + +`func NewSelfServiceReservationResponse() *SelfServiceReservationResponse` + +NewSelfServiceReservationResponse instantiates a new SelfServiceReservationResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSelfServiceReservationResponseWithDefaults + +`func NewSelfServiceReservationResponseWithDefaults() *SelfServiceReservationResponse` + +NewSelfServiceReservationResponseWithDefaults instantiates a new SelfServiceReservationResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *SelfServiceReservationResponse) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SelfServiceReservationResponse) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *SelfServiceReservationResponse) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *SelfServiceReservationResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetItem + +`func (o *SelfServiceReservationResponse) GetItem() []SelfServiceReservationItemResponse` + +GetItem returns the Item field if non-nil, zero value otherwise. + +### GetItemOk + +`func (o *SelfServiceReservationResponse) GetItemOk() (*[]SelfServiceReservationItemResponse, bool)` + +GetItemOk returns a tuple with the Item field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItem + +`func (o *SelfServiceReservationResponse) SetItem(v []SelfServiceReservationItemResponse)` + +SetItem sets Item field to given value. + +### HasItem + +`func (o *SelfServiceReservationResponse) HasItem() bool` + +HasItem returns a boolean if a field has been set. + +### GetNotes + +`func (o *SelfServiceReservationResponse) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *SelfServiceReservationResponse) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *SelfServiceReservationResponse) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *SelfServiceReservationResponse) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + +### GetOrganization + +`func (o *SelfServiceReservationResponse) GetOrganization() string` + +GetOrganization returns the Organization field if non-nil, zero value otherwise. + +### GetOrganizationOk + +`func (o *SelfServiceReservationResponse) GetOrganizationOk() (*string, bool)` + +GetOrganizationOk returns a tuple with the Organization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganization + +`func (o *SelfServiceReservationResponse) SetOrganization(v string)` + +SetOrganization sets Organization field to given value. + +### HasOrganization + +`func (o *SelfServiceReservationResponse) HasOrganization() bool` + +HasOrganization returns a boolean if a field has been set. + +### GetOrganizationId + +`func (o *SelfServiceReservationResponse) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *SelfServiceReservationResponse) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *SelfServiceReservationResponse) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *SelfServiceReservationResponse) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetPeriod + +`func (o *SelfServiceReservationResponse) GetPeriod() CreateSelfServiceReservationRequestPeriod` + +GetPeriod returns the Period field if non-nil, zero value otherwise. + +### GetPeriodOk + +`func (o *SelfServiceReservationResponse) GetPeriodOk() (*CreateSelfServiceReservationRequestPeriod, bool)` + +GetPeriodOk returns a tuple with the Period field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriod + +`func (o *SelfServiceReservationResponse) SetPeriod(v CreateSelfServiceReservationRequestPeriod)` + +SetPeriod sets Period field to given value. + +### HasPeriod + +`func (o *SelfServiceReservationResponse) HasPeriod() bool` + +HasPeriod returns a boolean if a field has been set. + +### GetProject + +`func (o *SelfServiceReservationResponse) GetProject() string` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *SelfServiceReservationResponse) GetProjectOk() (*string, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *SelfServiceReservationResponse) SetProject(v string)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *SelfServiceReservationResponse) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetProjectId + +`func (o *SelfServiceReservationResponse) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *SelfServiceReservationResponse) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *SelfServiceReservationResponse) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + +### HasProjectId + +`func (o *SelfServiceReservationResponse) HasProjectId() bool` + +HasProjectId returns a boolean if a field has been set. + +### GetStartDate + +`func (o *SelfServiceReservationResponse) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *SelfServiceReservationResponse) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *SelfServiceReservationResponse) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *SelfServiceReservationResponse) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### GetStatus + +`func (o *SelfServiceReservationResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *SelfServiceReservationResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *SelfServiceReservationResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *SelfServiceReservationResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTotalCost + +`func (o *SelfServiceReservationResponse) GetTotalCost() int32` + +GetTotalCost returns the TotalCost field if non-nil, zero value otherwise. + +### GetTotalCostOk + +`func (o *SelfServiceReservationResponse) GetTotalCostOk() (*int32, bool)` + +GetTotalCostOk returns a tuple with the TotalCost field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCost + +`func (o *SelfServiceReservationResponse) SetTotalCost(v int32)` + +SetTotalCost sets TotalCost field to given value. + +### HasTotalCost + +`func (o *SelfServiceReservationResponse) HasTotalCost() bool` + +HasTotalCost returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SelfServiceReservationsApi.md b/services/metalv1/docs/SelfServiceReservationsApi.md new file mode 100644 index 00000000..e3ad399b --- /dev/null +++ b/services/metalv1/docs/SelfServiceReservationsApi.md @@ -0,0 +1,232 @@ +# \SelfServiceReservationsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSelfServiceReservation**](SelfServiceReservationsApi.md#CreateSelfServiceReservation) | **Post** /projects/{project_id}/self-service/reservations | Create a reservation +[**FindSelfServiceReservation**](SelfServiceReservationsApi.md#FindSelfServiceReservation) | **Get** /projects/{project_id}/self-service/reservations/{id} | Retrieve a reservation +[**FindSelfServiceReservations**](SelfServiceReservationsApi.md#FindSelfServiceReservations) | **Get** /projects/{project_id}/self-service/reservations | Retrieve all reservations + + + +## CreateSelfServiceReservation + +> SelfServiceReservationResponse CreateSelfServiceReservation(ctx, projectId).CreateSelfServiceReservationRequest(createSelfServiceReservationRequest).Execute() + +Create a reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + createSelfServiceReservationRequest := *openapiclient.NewCreateSelfServiceReservationRequest() // CreateSelfServiceReservationRequest | reservation to create + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SelfServiceReservationsApi.CreateSelfServiceReservation(context.Background(), projectId).CreateSelfServiceReservationRequest(createSelfServiceReservationRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SelfServiceReservationsApi.CreateSelfServiceReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateSelfServiceReservation`: SelfServiceReservationResponse + fmt.Fprintf(os.Stdout, "Response from `SelfServiceReservationsApi.CreateSelfServiceReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateSelfServiceReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createSelfServiceReservationRequest** | [**CreateSelfServiceReservationRequest**](CreateSelfServiceReservationRequest.md) | reservation to create | + +### Return type + +[**SelfServiceReservationResponse**](SelfServiceReservationResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSelfServiceReservation + +> SelfServiceReservationResponse FindSelfServiceReservation(ctx, id, projectId).Execute() + +Retrieve a reservation + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Reservation short_id + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SelfServiceReservationsApi.FindSelfServiceReservation(context.Background(), id, projectId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SelfServiceReservationsApi.FindSelfServiceReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSelfServiceReservation`: SelfServiceReservationResponse + fmt.Fprintf(os.Stdout, "Response from `SelfServiceReservationsApi.FindSelfServiceReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Reservation short_id | +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSelfServiceReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**SelfServiceReservationResponse**](SelfServiceReservationResponse.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSelfServiceReservations + +> SelfServiceReservationList FindSelfServiceReservations(ctx, projectId).Page(page).PerPage(perPage).Categories(categories).Execute() + +Retrieve all reservations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + projectId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + categories := []openapiclient.FindOrganizationDevicesCategoriesParameterInner{openapiclient.findOrganizationDevices_categories_parameter_inner("compute")} // []FindOrganizationDevicesCategoriesParameterInner | Filter reservations by items category (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SelfServiceReservationsApi.FindSelfServiceReservations(context.Background(), projectId).Page(page).PerPage(perPage).Categories(categories).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SelfServiceReservationsApi.FindSelfServiceReservations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSelfServiceReservations`: SelfServiceReservationList + fmt.Fprintf(os.Stdout, "Response from `SelfServiceReservationsApi.FindSelfServiceReservations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**projectId** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSelfServiceReservationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + **categories** | [**[]FindOrganizationDevicesCategoriesParameterInner**](FindOrganizationDevicesCategoriesParameterInner.md) | Filter reservations by items category | + +### Return type + +[**SelfServiceReservationList**](SelfServiceReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/ServerInfo.md b/services/metalv1/docs/ServerInfo.md new file mode 100644 index 00000000..6b707d58 --- /dev/null +++ b/services/metalv1/docs/ServerInfo.md @@ -0,0 +1,134 @@ +# ServerInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Facility** | Pointer to **string** | | [optional] +**Metro** | Pointer to **string** | The metro ID or code to check the capacity in. | [optional] +**Plan** | Pointer to **string** | The plan ID or slug to check the capacity of. | [optional] +**Quantity** | Pointer to **string** | The number of servers to check the capacity of. | [optional] + +## Methods + +### NewServerInfo + +`func NewServerInfo() *ServerInfo` + +NewServerInfo instantiates a new ServerInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServerInfoWithDefaults + +`func NewServerInfoWithDefaults() *ServerInfo` + +NewServerInfoWithDefaults instantiates a new ServerInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetFacility + +`func (o *ServerInfo) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *ServerInfo) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *ServerInfo) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *ServerInfo) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetMetro + +`func (o *ServerInfo) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *ServerInfo) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *ServerInfo) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *ServerInfo) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetPlan + +`func (o *ServerInfo) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *ServerInfo) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *ServerInfo) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *ServerInfo) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetQuantity + +`func (o *ServerInfo) GetQuantity() string` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *ServerInfo) GetQuantityOk() (*string, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *ServerInfo) SetQuantity(v string)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *ServerInfo) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketApi.md b/services/metalv1/docs/SpotMarketApi.md new file mode 100644 index 00000000..177ff4b6 --- /dev/null +++ b/services/metalv1/docs/SpotMarketApi.md @@ -0,0 +1,509 @@ +# \SpotMarketApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateSpotMarketRequest**](SpotMarketApi.md#CreateSpotMarketRequest) | **Post** /projects/{id}/spot-market-requests | Create a spot market request +[**DeleteSpotMarketRequest**](SpotMarketApi.md#DeleteSpotMarketRequest) | **Delete** /spot-market-requests/{id} | Delete the spot market request +[**FindMetroSpotMarketPrices**](SpotMarketApi.md#FindMetroSpotMarketPrices) | **Get** /market/spot/prices/metros | Get current spot market prices for metros +[**FindSpotMarketPrices**](SpotMarketApi.md#FindSpotMarketPrices) | **Get** /market/spot/prices | Get current spot market prices +[**FindSpotMarketPricesHistory**](SpotMarketApi.md#FindSpotMarketPricesHistory) | **Get** /market/spot/prices/history | Get spot market prices for a given period of time +[**FindSpotMarketRequestById**](SpotMarketApi.md#FindSpotMarketRequestById) | **Get** /spot-market-requests/{id} | Retrieve a spot market request +[**ListSpotMarketRequests**](SpotMarketApi.md#ListSpotMarketRequests) | **Get** /projects/{id}/spot-market-requests | List spot market requests + + + +## CreateSpotMarketRequest + +> SpotMarketRequest CreateSpotMarketRequest(ctx, id).SpotMarketRequestCreateInput(spotMarketRequestCreateInput).Execute() + +Create a spot market request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + spotMarketRequestCreateInput := *openapiclient.NewSpotMarketRequestCreateInput() // SpotMarketRequestCreateInput | Spot Market Request to create + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.CreateSpotMarketRequest(context.Background(), id).SpotMarketRequestCreateInput(spotMarketRequestCreateInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.CreateSpotMarketRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateSpotMarketRequest`: SpotMarketRequest + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.CreateSpotMarketRequest`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateSpotMarketRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **spotMarketRequestCreateInput** | [**SpotMarketRequestCreateInput**](SpotMarketRequestCreateInput.md) | Spot Market Request to create | + +### Return type + +[**SpotMarketRequest**](SpotMarketRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteSpotMarketRequest + +> DeleteSpotMarketRequest(ctx, id).ForceTermination(forceTermination).Execute() + +Delete the spot market request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | SpotMarketRequest UUID + forceTermination := true // bool | Terminate associated spot instances (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.SpotMarketApi.DeleteSpotMarketRequest(context.Background(), id).ForceTermination(forceTermination).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.DeleteSpotMarketRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | SpotMarketRequest UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteSpotMarketRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **forceTermination** | **bool** | Terminate associated spot instances | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindMetroSpotMarketPrices + +> SpotMarketPricesPerMetroList FindMetroSpotMarketPrices(ctx).Metro(metro).Plan(plan).Execute() + +Get current spot market prices for metros + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + metro := "metro_example" // string | Metro to filter spot market prices (optional) + plan := "plan_example" // string | Plan to filter spot market prices (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.FindMetroSpotMarketPrices(context.Background()).Metro(metro).Plan(plan).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.FindMetroSpotMarketPrices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindMetroSpotMarketPrices`: SpotMarketPricesPerMetroList + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.FindMetroSpotMarketPrices`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindMetroSpotMarketPricesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **metro** | **string** | Metro to filter spot market prices | + **plan** | **string** | Plan to filter spot market prices | + +### Return type + +[**SpotMarketPricesPerMetroList**](SpotMarketPricesPerMetroList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSpotMarketPrices + +> SpotMarketPricesList FindSpotMarketPrices(ctx).Facility(facility).Plan(plan).Execute() + +Get current spot market prices + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + facility := "facility_example" // string | Facility to check spot market prices (optional) + plan := "plan_example" // string | Plan to check spot market prices (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.FindSpotMarketPrices(context.Background()).Facility(facility).Plan(plan).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.FindSpotMarketPrices``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSpotMarketPrices`: SpotMarketPricesList + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.FindSpotMarketPrices`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSpotMarketPricesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facility** | **string** | Facility to check spot market prices | + **plan** | **string** | Plan to check spot market prices | + +### Return type + +[**SpotMarketPricesList**](SpotMarketPricesList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSpotMarketPricesHistory + +> SpotPricesHistoryReport FindSpotMarketPricesHistory(ctx).Facility(facility).Plan(plan).From(from).Until(until).Metro(metro).Execute() + +Get spot market prices for a given period of time + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + facility := "facility_example" // string | Facility to check spot market prices + plan := "plan_example" // string | Plan to check spot market prices + from := "from_example" // string | Timestamp from range + until := "until_example" // string | Timestamp to range + metro := "metro_example" // string | Metro to check spot market price history (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.FindSpotMarketPricesHistory(context.Background()).Facility(facility).Plan(plan).From(from).Until(until).Metro(metro).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.FindSpotMarketPricesHistory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSpotMarketPricesHistory`: SpotPricesHistoryReport + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.FindSpotMarketPricesHistory`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSpotMarketPricesHistoryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **facility** | **string** | Facility to check spot market prices | + **plan** | **string** | Plan to check spot market prices | + **from** | **string** | Timestamp from range | + **until** | **string** | Timestamp to range | + **metro** | **string** | Metro to check spot market price history | + +### Return type + +[**SpotPricesHistoryReport**](SpotPricesHistoryReport.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindSpotMarketRequestById + +> SpotMarketRequest FindSpotMarketRequestById(ctx, id).Include(include).Execute() + +Retrieve a spot market request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | SpotMarketRequest UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.FindSpotMarketRequestById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.FindSpotMarketRequestById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindSpotMarketRequestById`: SpotMarketRequest + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.FindSpotMarketRequestById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | SpotMarketRequest UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindSpotMarketRequestByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**SpotMarketRequest**](SpotMarketRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListSpotMarketRequests + +> SpotMarketRequestList ListSpotMarketRequests(ctx, id).Execute() + +List spot market requests + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SpotMarketApi.ListSpotMarketRequests(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SpotMarketApi.ListSpotMarketRequests``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListSpotMarketRequests`: SpotMarketRequestList + fmt.Fprintf(os.Stdout, "Response from `SpotMarketApi.ListSpotMarketRequests`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListSpotMarketRequestsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**SpotMarketRequestList**](SpotMarketRequestList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/SpotMarketPricesList.md b/services/metalv1/docs/SpotMarketPricesList.md new file mode 100644 index 00000000..17bc03b7 --- /dev/null +++ b/services/metalv1/docs/SpotMarketPricesList.md @@ -0,0 +1,56 @@ +# SpotMarketPricesList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpotMarketPrices** | Pointer to [**SpotPricesReport**](SpotPricesReport.md) | | [optional] + +## Methods + +### NewSpotMarketPricesList + +`func NewSpotMarketPricesList() *SpotMarketPricesList` + +NewSpotMarketPricesList instantiates a new SpotMarketPricesList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketPricesListWithDefaults + +`func NewSpotMarketPricesListWithDefaults() *SpotMarketPricesList` + +NewSpotMarketPricesListWithDefaults instantiates a new SpotMarketPricesList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpotMarketPrices + +`func (o *SpotMarketPricesList) GetSpotMarketPrices() SpotPricesReport` + +GetSpotMarketPrices returns the SpotMarketPrices field if non-nil, zero value otherwise. + +### GetSpotMarketPricesOk + +`func (o *SpotMarketPricesList) GetSpotMarketPricesOk() (*SpotPricesReport, bool)` + +GetSpotMarketPricesOk returns a tuple with the SpotMarketPrices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotMarketPrices + +`func (o *SpotMarketPricesList) SetSpotMarketPrices(v SpotPricesReport)` + +SetSpotMarketPrices sets SpotMarketPrices field to given value. + +### HasSpotMarketPrices + +`func (o *SpotMarketPricesList) HasSpotMarketPrices() bool` + +HasSpotMarketPrices returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketPricesPerMetroList.md b/services/metalv1/docs/SpotMarketPricesPerMetroList.md new file mode 100644 index 00000000..21ff6629 --- /dev/null +++ b/services/metalv1/docs/SpotMarketPricesPerMetroList.md @@ -0,0 +1,56 @@ +# SpotMarketPricesPerMetroList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpotMarketPrices** | Pointer to [**SpotMarketPricesPerMetroReport**](SpotMarketPricesPerMetroReport.md) | | [optional] + +## Methods + +### NewSpotMarketPricesPerMetroList + +`func NewSpotMarketPricesPerMetroList() *SpotMarketPricesPerMetroList` + +NewSpotMarketPricesPerMetroList instantiates a new SpotMarketPricesPerMetroList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketPricesPerMetroListWithDefaults + +`func NewSpotMarketPricesPerMetroListWithDefaults() *SpotMarketPricesPerMetroList` + +NewSpotMarketPricesPerMetroListWithDefaults instantiates a new SpotMarketPricesPerMetroList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpotMarketPrices + +`func (o *SpotMarketPricesPerMetroList) GetSpotMarketPrices() SpotMarketPricesPerMetroReport` + +GetSpotMarketPrices returns the SpotMarketPrices field if non-nil, zero value otherwise. + +### GetSpotMarketPricesOk + +`func (o *SpotMarketPricesPerMetroList) GetSpotMarketPricesOk() (*SpotMarketPricesPerMetroReport, bool)` + +GetSpotMarketPricesOk returns a tuple with the SpotMarketPrices field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotMarketPrices + +`func (o *SpotMarketPricesPerMetroList) SetSpotMarketPrices(v SpotMarketPricesPerMetroReport)` + +SetSpotMarketPrices sets SpotMarketPrices field to given value. + +### HasSpotMarketPrices + +`func (o *SpotMarketPricesPerMetroList) HasSpotMarketPrices() bool` + +HasSpotMarketPrices returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketPricesPerMetroReport.md b/services/metalv1/docs/SpotMarketPricesPerMetroReport.md new file mode 100644 index 00000000..88d1c019 --- /dev/null +++ b/services/metalv1/docs/SpotMarketPricesPerMetroReport.md @@ -0,0 +1,212 @@ +# SpotMarketPricesPerMetroReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Am** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Ch** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Da** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**La** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Ny** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Sg** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Sv** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] + +## Methods + +### NewSpotMarketPricesPerMetroReport + +`func NewSpotMarketPricesPerMetroReport() *SpotMarketPricesPerMetroReport` + +NewSpotMarketPricesPerMetroReport instantiates a new SpotMarketPricesPerMetroReport object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketPricesPerMetroReportWithDefaults + +`func NewSpotMarketPricesPerMetroReportWithDefaults() *SpotMarketPricesPerMetroReport` + +NewSpotMarketPricesPerMetroReportWithDefaults instantiates a new SpotMarketPricesPerMetroReport object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAm + +`func (o *SpotMarketPricesPerMetroReport) GetAm() SpotPricesPerFacility` + +GetAm returns the Am field if non-nil, zero value otherwise. + +### GetAmOk + +`func (o *SpotMarketPricesPerMetroReport) GetAmOk() (*SpotPricesPerFacility, bool)` + +GetAmOk returns a tuple with the Am field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAm + +`func (o *SpotMarketPricesPerMetroReport) SetAm(v SpotPricesPerFacility)` + +SetAm sets Am field to given value. + +### HasAm + +`func (o *SpotMarketPricesPerMetroReport) HasAm() bool` + +HasAm returns a boolean if a field has been set. + +### GetCh + +`func (o *SpotMarketPricesPerMetroReport) GetCh() SpotPricesPerFacility` + +GetCh returns the Ch field if non-nil, zero value otherwise. + +### GetChOk + +`func (o *SpotMarketPricesPerMetroReport) GetChOk() (*SpotPricesPerFacility, bool)` + +GetChOk returns a tuple with the Ch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCh + +`func (o *SpotMarketPricesPerMetroReport) SetCh(v SpotPricesPerFacility)` + +SetCh sets Ch field to given value. + +### HasCh + +`func (o *SpotMarketPricesPerMetroReport) HasCh() bool` + +HasCh returns a boolean if a field has been set. + +### GetDa + +`func (o *SpotMarketPricesPerMetroReport) GetDa() SpotPricesPerFacility` + +GetDa returns the Da field if non-nil, zero value otherwise. + +### GetDaOk + +`func (o *SpotMarketPricesPerMetroReport) GetDaOk() (*SpotPricesPerFacility, bool)` + +GetDaOk returns a tuple with the Da field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDa + +`func (o *SpotMarketPricesPerMetroReport) SetDa(v SpotPricesPerFacility)` + +SetDa sets Da field to given value. + +### HasDa + +`func (o *SpotMarketPricesPerMetroReport) HasDa() bool` + +HasDa returns a boolean if a field has been set. + +### GetLa + +`func (o *SpotMarketPricesPerMetroReport) GetLa() SpotPricesPerFacility` + +GetLa returns the La field if non-nil, zero value otherwise. + +### GetLaOk + +`func (o *SpotMarketPricesPerMetroReport) GetLaOk() (*SpotPricesPerFacility, bool)` + +GetLaOk returns a tuple with the La field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLa + +`func (o *SpotMarketPricesPerMetroReport) SetLa(v SpotPricesPerFacility)` + +SetLa sets La field to given value. + +### HasLa + +`func (o *SpotMarketPricesPerMetroReport) HasLa() bool` + +HasLa returns a boolean if a field has been set. + +### GetNy + +`func (o *SpotMarketPricesPerMetroReport) GetNy() SpotPricesPerFacility` + +GetNy returns the Ny field if non-nil, zero value otherwise. + +### GetNyOk + +`func (o *SpotMarketPricesPerMetroReport) GetNyOk() (*SpotPricesPerFacility, bool)` + +GetNyOk returns a tuple with the Ny field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNy + +`func (o *SpotMarketPricesPerMetroReport) SetNy(v SpotPricesPerFacility)` + +SetNy sets Ny field to given value. + +### HasNy + +`func (o *SpotMarketPricesPerMetroReport) HasNy() bool` + +HasNy returns a boolean if a field has been set. + +### GetSg + +`func (o *SpotMarketPricesPerMetroReport) GetSg() SpotPricesPerFacility` + +GetSg returns the Sg field if non-nil, zero value otherwise. + +### GetSgOk + +`func (o *SpotMarketPricesPerMetroReport) GetSgOk() (*SpotPricesPerFacility, bool)` + +GetSgOk returns a tuple with the Sg field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSg + +`func (o *SpotMarketPricesPerMetroReport) SetSg(v SpotPricesPerFacility)` + +SetSg sets Sg field to given value. + +### HasSg + +`func (o *SpotMarketPricesPerMetroReport) HasSg() bool` + +HasSg returns a boolean if a field has been set. + +### GetSv + +`func (o *SpotMarketPricesPerMetroReport) GetSv() SpotPricesPerFacility` + +GetSv returns the Sv field if non-nil, zero value otherwise. + +### GetSvOk + +`func (o *SpotMarketPricesPerMetroReport) GetSvOk() (*SpotPricesPerFacility, bool)` + +GetSvOk returns a tuple with the Sv field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSv + +`func (o *SpotMarketPricesPerMetroReport) SetSv(v SpotPricesPerFacility)` + +SetSv sets Sv field to given value. + +### HasSv + +`func (o *SpotMarketPricesPerMetroReport) HasSv() bool` + +HasSv returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketRequest.md b/services/metalv1/docs/SpotMarketRequest.md new file mode 100644 index 00000000..bd0ca40c --- /dev/null +++ b/services/metalv1/docs/SpotMarketRequest.md @@ -0,0 +1,316 @@ +# SpotMarketRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**DevicesMax** | Pointer to **int32** | | [optional] +**DevicesMin** | Pointer to **int32** | | [optional] +**EndAt** | Pointer to **time.Time** | | [optional] +**Facilities** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Instances** | Pointer to [**Href**](Href.md) | | [optional] +**MaxBidPrice** | Pointer to **float32** | | [optional] +**Metro** | Pointer to [**SpotMarketRequestMetro**](SpotMarketRequestMetro.md) | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] + +## Methods + +### NewSpotMarketRequest + +`func NewSpotMarketRequest() *SpotMarketRequest` + +NewSpotMarketRequest instantiates a new SpotMarketRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketRequestWithDefaults + +`func NewSpotMarketRequestWithDefaults() *SpotMarketRequest` + +NewSpotMarketRequestWithDefaults instantiates a new SpotMarketRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *SpotMarketRequest) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SpotMarketRequest) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *SpotMarketRequest) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *SpotMarketRequest) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDevicesMax + +`func (o *SpotMarketRequest) GetDevicesMax() int32` + +GetDevicesMax returns the DevicesMax field if non-nil, zero value otherwise. + +### GetDevicesMaxOk + +`func (o *SpotMarketRequest) GetDevicesMaxOk() (*int32, bool)` + +GetDevicesMaxOk returns a tuple with the DevicesMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevicesMax + +`func (o *SpotMarketRequest) SetDevicesMax(v int32)` + +SetDevicesMax sets DevicesMax field to given value. + +### HasDevicesMax + +`func (o *SpotMarketRequest) HasDevicesMax() bool` + +HasDevicesMax returns a boolean if a field has been set. + +### GetDevicesMin + +`func (o *SpotMarketRequest) GetDevicesMin() int32` + +GetDevicesMin returns the DevicesMin field if non-nil, zero value otherwise. + +### GetDevicesMinOk + +`func (o *SpotMarketRequest) GetDevicesMinOk() (*int32, bool)` + +GetDevicesMinOk returns a tuple with the DevicesMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevicesMin + +`func (o *SpotMarketRequest) SetDevicesMin(v int32)` + +SetDevicesMin sets DevicesMin field to given value. + +### HasDevicesMin + +`func (o *SpotMarketRequest) HasDevicesMin() bool` + +HasDevicesMin returns a boolean if a field has been set. + +### GetEndAt + +`func (o *SpotMarketRequest) GetEndAt() time.Time` + +GetEndAt returns the EndAt field if non-nil, zero value otherwise. + +### GetEndAtOk + +`func (o *SpotMarketRequest) GetEndAtOk() (*time.Time, bool)` + +GetEndAtOk returns a tuple with the EndAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndAt + +`func (o *SpotMarketRequest) SetEndAt(v time.Time)` + +SetEndAt sets EndAt field to given value. + +### HasEndAt + +`func (o *SpotMarketRequest) HasEndAt() bool` + +HasEndAt returns a boolean if a field has been set. + +### GetFacilities + +`func (o *SpotMarketRequest) GetFacilities() Href` + +GetFacilities returns the Facilities field if non-nil, zero value otherwise. + +### GetFacilitiesOk + +`func (o *SpotMarketRequest) GetFacilitiesOk() (*Href, bool)` + +GetFacilitiesOk returns a tuple with the Facilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacilities + +`func (o *SpotMarketRequest) SetFacilities(v Href)` + +SetFacilities sets Facilities field to given value. + +### HasFacilities + +`func (o *SpotMarketRequest) HasFacilities() bool` + +HasFacilities returns a boolean if a field has been set. + +### GetHref + +`func (o *SpotMarketRequest) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *SpotMarketRequest) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *SpotMarketRequest) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *SpotMarketRequest) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *SpotMarketRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SpotMarketRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SpotMarketRequest) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SpotMarketRequest) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInstances + +`func (o *SpotMarketRequest) GetInstances() Href` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *SpotMarketRequest) GetInstancesOk() (*Href, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *SpotMarketRequest) SetInstances(v Href)` + +SetInstances sets Instances field to given value. + +### HasInstances + +`func (o *SpotMarketRequest) HasInstances() bool` + +HasInstances returns a boolean if a field has been set. + +### GetMaxBidPrice + +`func (o *SpotMarketRequest) GetMaxBidPrice() float32` + +GetMaxBidPrice returns the MaxBidPrice field if non-nil, zero value otherwise. + +### GetMaxBidPriceOk + +`func (o *SpotMarketRequest) GetMaxBidPriceOk() (*float32, bool)` + +GetMaxBidPriceOk returns a tuple with the MaxBidPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxBidPrice + +`func (o *SpotMarketRequest) SetMaxBidPrice(v float32)` + +SetMaxBidPrice sets MaxBidPrice field to given value. + +### HasMaxBidPrice + +`func (o *SpotMarketRequest) HasMaxBidPrice() bool` + +HasMaxBidPrice returns a boolean if a field has been set. + +### GetMetro + +`func (o *SpotMarketRequest) GetMetro() SpotMarketRequestMetro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *SpotMarketRequest) GetMetroOk() (*SpotMarketRequestMetro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *SpotMarketRequest) SetMetro(v SpotMarketRequestMetro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *SpotMarketRequest) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetProject + +`func (o *SpotMarketRequest) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *SpotMarketRequest) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *SpotMarketRequest) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *SpotMarketRequest) HasProject() bool` + +HasProject returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketRequestCreateInput.md b/services/metalv1/docs/SpotMarketRequestCreateInput.md new file mode 100644 index 00000000..b164e6ed --- /dev/null +++ b/services/metalv1/docs/SpotMarketRequestCreateInput.md @@ -0,0 +1,212 @@ +# SpotMarketRequestCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DevicesMax** | Pointer to **int32** | | [optional] +**DevicesMin** | Pointer to **int32** | | [optional] +**EndAt** | Pointer to **time.Time** | | [optional] +**Facilities** | Pointer to **[]string** | | [optional] +**InstanceParameters** | Pointer to [**SpotMarketRequestCreateInputInstanceParameters**](SpotMarketRequestCreateInputInstanceParameters.md) | | [optional] +**MaxBidPrice** | Pointer to **float32** | | [optional] +**Metro** | Pointer to **string** | The metro ID or code the spot market request will be created in. | [optional] + +## Methods + +### NewSpotMarketRequestCreateInput + +`func NewSpotMarketRequestCreateInput() *SpotMarketRequestCreateInput` + +NewSpotMarketRequestCreateInput instantiates a new SpotMarketRequestCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketRequestCreateInputWithDefaults + +`func NewSpotMarketRequestCreateInputWithDefaults() *SpotMarketRequestCreateInput` + +NewSpotMarketRequestCreateInputWithDefaults instantiates a new SpotMarketRequestCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDevicesMax + +`func (o *SpotMarketRequestCreateInput) GetDevicesMax() int32` + +GetDevicesMax returns the DevicesMax field if non-nil, zero value otherwise. + +### GetDevicesMaxOk + +`func (o *SpotMarketRequestCreateInput) GetDevicesMaxOk() (*int32, bool)` + +GetDevicesMaxOk returns a tuple with the DevicesMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevicesMax + +`func (o *SpotMarketRequestCreateInput) SetDevicesMax(v int32)` + +SetDevicesMax sets DevicesMax field to given value. + +### HasDevicesMax + +`func (o *SpotMarketRequestCreateInput) HasDevicesMax() bool` + +HasDevicesMax returns a boolean if a field has been set. + +### GetDevicesMin + +`func (o *SpotMarketRequestCreateInput) GetDevicesMin() int32` + +GetDevicesMin returns the DevicesMin field if non-nil, zero value otherwise. + +### GetDevicesMinOk + +`func (o *SpotMarketRequestCreateInput) GetDevicesMinOk() (*int32, bool)` + +GetDevicesMinOk returns a tuple with the DevicesMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevicesMin + +`func (o *SpotMarketRequestCreateInput) SetDevicesMin(v int32)` + +SetDevicesMin sets DevicesMin field to given value. + +### HasDevicesMin + +`func (o *SpotMarketRequestCreateInput) HasDevicesMin() bool` + +HasDevicesMin returns a boolean if a field has been set. + +### GetEndAt + +`func (o *SpotMarketRequestCreateInput) GetEndAt() time.Time` + +GetEndAt returns the EndAt field if non-nil, zero value otherwise. + +### GetEndAtOk + +`func (o *SpotMarketRequestCreateInput) GetEndAtOk() (*time.Time, bool)` + +GetEndAtOk returns a tuple with the EndAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndAt + +`func (o *SpotMarketRequestCreateInput) SetEndAt(v time.Time)` + +SetEndAt sets EndAt field to given value. + +### HasEndAt + +`func (o *SpotMarketRequestCreateInput) HasEndAt() bool` + +HasEndAt returns a boolean if a field has been set. + +### GetFacilities + +`func (o *SpotMarketRequestCreateInput) GetFacilities() []string` + +GetFacilities returns the Facilities field if non-nil, zero value otherwise. + +### GetFacilitiesOk + +`func (o *SpotMarketRequestCreateInput) GetFacilitiesOk() (*[]string, bool)` + +GetFacilitiesOk returns a tuple with the Facilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacilities + +`func (o *SpotMarketRequestCreateInput) SetFacilities(v []string)` + +SetFacilities sets Facilities field to given value. + +### HasFacilities + +`func (o *SpotMarketRequestCreateInput) HasFacilities() bool` + +HasFacilities returns a boolean if a field has been set. + +### GetInstanceParameters + +`func (o *SpotMarketRequestCreateInput) GetInstanceParameters() SpotMarketRequestCreateInputInstanceParameters` + +GetInstanceParameters returns the InstanceParameters field if non-nil, zero value otherwise. + +### GetInstanceParametersOk + +`func (o *SpotMarketRequestCreateInput) GetInstanceParametersOk() (*SpotMarketRequestCreateInputInstanceParameters, bool)` + +GetInstanceParametersOk returns a tuple with the InstanceParameters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceParameters + +`func (o *SpotMarketRequestCreateInput) SetInstanceParameters(v SpotMarketRequestCreateInputInstanceParameters)` + +SetInstanceParameters sets InstanceParameters field to given value. + +### HasInstanceParameters + +`func (o *SpotMarketRequestCreateInput) HasInstanceParameters() bool` + +HasInstanceParameters returns a boolean if a field has been set. + +### GetMaxBidPrice + +`func (o *SpotMarketRequestCreateInput) GetMaxBidPrice() float32` + +GetMaxBidPrice returns the MaxBidPrice field if non-nil, zero value otherwise. + +### GetMaxBidPriceOk + +`func (o *SpotMarketRequestCreateInput) GetMaxBidPriceOk() (*float32, bool)` + +GetMaxBidPriceOk returns a tuple with the MaxBidPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxBidPrice + +`func (o *SpotMarketRequestCreateInput) SetMaxBidPrice(v float32)` + +SetMaxBidPrice sets MaxBidPrice field to given value. + +### HasMaxBidPrice + +`func (o *SpotMarketRequestCreateInput) HasMaxBidPrice() bool` + +HasMaxBidPrice returns a boolean if a field has been set. + +### GetMetro + +`func (o *SpotMarketRequestCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *SpotMarketRequestCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *SpotMarketRequestCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *SpotMarketRequestCreateInput) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md b/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md new file mode 100644 index 00000000..4f6c26ce --- /dev/null +++ b/services/metalv1/docs/SpotMarketRequestCreateInputInstanceParameters.md @@ -0,0 +1,498 @@ +# SpotMarketRequestCreateInputInstanceParameters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AlwaysPxe** | Pointer to **bool** | | [optional] +**BillingCycle** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Description** | Pointer to **string** | | [optional] +**Features** | Pointer to **[]string** | | [optional] +**Hostname** | Pointer to **string** | | [optional] +**Hostnames** | Pointer to **[]string** | | [optional] +**Locked** | Pointer to **bool** | Whether the device should be locked, preventing accidental deletion. | [optional] +**NoSshKeys** | Pointer to **bool** | | [optional] +**OperatingSystem** | Pointer to **string** | | [optional] +**Plan** | Pointer to **string** | | [optional] +**PrivateIpv4SubnetSize** | Pointer to **int32** | | [optional] +**ProjectSshKeys** | Pointer to **[]string** | | [optional] +**PublicIpv4SubnetSize** | Pointer to **int32** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**TerminationTime** | Pointer to **time.Time** | | [optional] +**UserSshKeys** | Pointer to **[]string** | The UUIDs of users whose SSH keys should be included on the provisioned device. | [optional] +**Userdata** | Pointer to **string** | | [optional] + +## Methods + +### NewSpotMarketRequestCreateInputInstanceParameters + +`func NewSpotMarketRequestCreateInputInstanceParameters() *SpotMarketRequestCreateInputInstanceParameters` + +NewSpotMarketRequestCreateInputInstanceParameters instantiates a new SpotMarketRequestCreateInputInstanceParameters object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketRequestCreateInputInstanceParametersWithDefaults + +`func NewSpotMarketRequestCreateInputInstanceParametersWithDefaults() *SpotMarketRequestCreateInputInstanceParameters` + +NewSpotMarketRequestCreateInputInstanceParametersWithDefaults instantiates a new SpotMarketRequestCreateInputInstanceParameters object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAlwaysPxe + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetAlwaysPxe() bool` + +GetAlwaysPxe returns the AlwaysPxe field if non-nil, zero value otherwise. + +### GetAlwaysPxeOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetAlwaysPxeOk() (*bool, bool)` + +GetAlwaysPxeOk returns a tuple with the AlwaysPxe field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlwaysPxe + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetAlwaysPxe(v bool)` + +SetAlwaysPxe sets AlwaysPxe field to given value. + +### HasAlwaysPxe + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasAlwaysPxe() bool` + +HasAlwaysPxe returns a boolean if a field has been set. + +### GetBillingCycle + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetBillingCycle() string` + +GetBillingCycle returns the BillingCycle field if non-nil, zero value otherwise. + +### GetBillingCycleOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetBillingCycleOk() (*string, bool)` + +GetBillingCycleOk returns a tuple with the BillingCycle field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingCycle + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetBillingCycle(v string)` + +SetBillingCycle sets BillingCycle field to given value. + +### HasBillingCycle + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasBillingCycle() bool` + +HasBillingCycle returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDescription + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFeatures + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetFeatures() []string` + +GetFeatures returns the Features field if non-nil, zero value otherwise. + +### GetFeaturesOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetFeaturesOk() (*[]string, bool)` + +GetFeaturesOk returns a tuple with the Features field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatures + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetFeatures(v []string)` + +SetFeatures sets Features field to given value. + +### HasFeatures + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasFeatures() bool` + +HasFeatures returns a boolean if a field has been set. + +### GetHostname + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetHostnames + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnames() []string` + +GetHostnames returns the Hostnames field if non-nil, zero value otherwise. + +### GetHostnamesOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnamesOk() (*[]string, bool)` + +GetHostnamesOk returns a tuple with the Hostnames field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostnames + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetHostnames(v []string)` + +SetHostnames sets Hostnames field to given value. + +### HasHostnames + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasHostnames() bool` + +HasHostnames returns a boolean if a field has been set. + +### GetLocked + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetLocked() bool` + +GetLocked returns the Locked field if non-nil, zero value otherwise. + +### GetLockedOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetLockedOk() (*bool, bool)` + +GetLockedOk returns a tuple with the Locked field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocked + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetLocked(v bool)` + +SetLocked sets Locked field to given value. + +### HasLocked + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasLocked() bool` + +HasLocked returns a boolean if a field has been set. + +### GetNoSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetNoSshKeys() bool` + +GetNoSshKeys returns the NoSshKeys field if non-nil, zero value otherwise. + +### GetNoSshKeysOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetNoSshKeysOk() (*bool, bool)` + +GetNoSshKeysOk returns a tuple with the NoSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNoSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetNoSshKeys(v bool)` + +SetNoSshKeys sets NoSshKeys field to given value. + +### HasNoSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasNoSshKeys() bool` + +HasNoSshKeys returns a boolean if a field has been set. + +### GetOperatingSystem + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetOperatingSystem() string` + +GetOperatingSystem returns the OperatingSystem field if non-nil, zero value otherwise. + +### GetOperatingSystemOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetOperatingSystemOk() (*string, bool)` + +GetOperatingSystemOk returns a tuple with the OperatingSystem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperatingSystem + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetOperatingSystem(v string)` + +SetOperatingSystem sets OperatingSystem field to given value. + +### HasOperatingSystem + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasOperatingSystem() bool` + +HasOperatingSystem returns a boolean if a field has been set. + +### GetPlan + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPlan() string` + +GetPlan returns the Plan field if non-nil, zero value otherwise. + +### GetPlanOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPlanOk() (*string, bool)` + +GetPlanOk returns a tuple with the Plan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlan + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetPlan(v string)` + +SetPlan sets Plan field to given value. + +### HasPlan + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasPlan() bool` + +HasPlan returns a boolean if a field has been set. + +### GetPrivateIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPrivateIpv4SubnetSize() int32` + +GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPrivateIpv4SubnetSizeOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPrivateIpv4SubnetSizeOk() (*int32, bool)` + +GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrivateIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetPrivateIpv4SubnetSize(v int32)` + +SetPrivateIpv4SubnetSize sets PrivateIpv4SubnetSize field to given value. + +### HasPrivateIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasPrivateIpv4SubnetSize() bool` + +HasPrivateIpv4SubnetSize returns a boolean if a field has been set. + +### GetProjectSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetProjectSshKeys() []string` + +GetProjectSshKeys returns the ProjectSshKeys field if non-nil, zero value otherwise. + +### GetProjectSshKeysOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetProjectSshKeysOk() (*[]string, bool)` + +GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetProjectSshKeys(v []string)` + +SetProjectSshKeys sets ProjectSshKeys field to given value. + +### HasProjectSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasProjectSshKeys() bool` + +HasProjectSshKeys returns a boolean if a field has been set. + +### GetPublicIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPublicIpv4SubnetSize() int32` + +GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field if non-nil, zero value otherwise. + +### GetPublicIpv4SubnetSizeOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetPublicIpv4SubnetSizeOk() (*int32, bool)` + +GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetPublicIpv4SubnetSize(v int32)` + +SetPublicIpv4SubnetSize sets PublicIpv4SubnetSize field to given value. + +### HasPublicIpv4SubnetSize + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasPublicIpv4SubnetSize() bool` + +HasPublicIpv4SubnetSize returns a boolean if a field has been set. + +### GetTags + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetTerminationTime + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetTerminationTime() time.Time` + +GetTerminationTime returns the TerminationTime field if non-nil, zero value otherwise. + +### GetTerminationTimeOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetTerminationTimeOk() (*time.Time, bool)` + +GetTerminationTimeOk returns a tuple with the TerminationTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTerminationTime + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetTerminationTime(v time.Time)` + +SetTerminationTime sets TerminationTime field to given value. + +### HasTerminationTime + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasTerminationTime() bool` + +HasTerminationTime returns a boolean if a field has been set. + +### GetUserSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserSshKeys() []string` + +GetUserSshKeys returns the UserSshKeys field if non-nil, zero value otherwise. + +### GetUserSshKeysOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserSshKeysOk() (*[]string, bool)` + +GetUserSshKeysOk returns a tuple with the UserSshKeys field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetUserSshKeys(v []string)` + +SetUserSshKeys sets UserSshKeys field to given value. + +### HasUserSshKeys + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasUserSshKeys() bool` + +HasUserSshKeys returns a boolean if a field has been set. + +### GetUserdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *SpotMarketRequestCreateInputInstanceParameters) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketRequestList.md b/services/metalv1/docs/SpotMarketRequestList.md new file mode 100644 index 00000000..3600fada --- /dev/null +++ b/services/metalv1/docs/SpotMarketRequestList.md @@ -0,0 +1,56 @@ +# SpotMarketRequestList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpotMarketRequests** | Pointer to [**[]SpotMarketRequest**](SpotMarketRequest.md) | | [optional] + +## Methods + +### NewSpotMarketRequestList + +`func NewSpotMarketRequestList() *SpotMarketRequestList` + +NewSpotMarketRequestList instantiates a new SpotMarketRequestList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketRequestListWithDefaults + +`func NewSpotMarketRequestListWithDefaults() *SpotMarketRequestList` + +NewSpotMarketRequestListWithDefaults instantiates a new SpotMarketRequestList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpotMarketRequests + +`func (o *SpotMarketRequestList) GetSpotMarketRequests() []SpotMarketRequest` + +GetSpotMarketRequests returns the SpotMarketRequests field if non-nil, zero value otherwise. + +### GetSpotMarketRequestsOk + +`func (o *SpotMarketRequestList) GetSpotMarketRequestsOk() (*[]SpotMarketRequest, bool)` + +GetSpotMarketRequestsOk returns a tuple with the SpotMarketRequests field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpotMarketRequests + +`func (o *SpotMarketRequestList) SetSpotMarketRequests(v []SpotMarketRequest)` + +SetSpotMarketRequests sets SpotMarketRequests field to given value. + +### HasSpotMarketRequests + +`func (o *SpotMarketRequestList) HasSpotMarketRequests() bool` + +HasSpotMarketRequests returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotMarketRequestMetro.md b/services/metalv1/docs/SpotMarketRequestMetro.md new file mode 100644 index 00000000..b7f412d4 --- /dev/null +++ b/services/metalv1/docs/SpotMarketRequestMetro.md @@ -0,0 +1,134 @@ +# SpotMarketRequestMetro + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | | [optional] +**Country** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewSpotMarketRequestMetro + +`func NewSpotMarketRequestMetro() *SpotMarketRequestMetro` + +NewSpotMarketRequestMetro instantiates a new SpotMarketRequestMetro object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotMarketRequestMetroWithDefaults + +`func NewSpotMarketRequestMetroWithDefaults() *SpotMarketRequestMetro` + +NewSpotMarketRequestMetroWithDefaults instantiates a new SpotMarketRequestMetro object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *SpotMarketRequestMetro) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *SpotMarketRequestMetro) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *SpotMarketRequestMetro) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *SpotMarketRequestMetro) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetCountry + +`func (o *SpotMarketRequestMetro) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *SpotMarketRequestMetro) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *SpotMarketRequestMetro) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *SpotMarketRequestMetro) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetId + +`func (o *SpotMarketRequestMetro) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SpotMarketRequestMetro) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SpotMarketRequestMetro) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SpotMarketRequestMetro) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *SpotMarketRequestMetro) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SpotMarketRequestMetro) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SpotMarketRequestMetro) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *SpotMarketRequestMetro) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesDatapoints.md b/services/metalv1/docs/SpotPricesDatapoints.md new file mode 100644 index 00000000..f5b3f420 --- /dev/null +++ b/services/metalv1/docs/SpotPricesDatapoints.md @@ -0,0 +1,56 @@ +# SpotPricesDatapoints + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Datapoints** | Pointer to **[][]float32** | | [optional] + +## Methods + +### NewSpotPricesDatapoints + +`func NewSpotPricesDatapoints() *SpotPricesDatapoints` + +NewSpotPricesDatapoints instantiates a new SpotPricesDatapoints object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesDatapointsWithDefaults + +`func NewSpotPricesDatapointsWithDefaults() *SpotPricesDatapoints` + +NewSpotPricesDatapointsWithDefaults instantiates a new SpotPricesDatapoints object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDatapoints + +`func (o *SpotPricesDatapoints) GetDatapoints() [][]float32` + +GetDatapoints returns the Datapoints field if non-nil, zero value otherwise. + +### GetDatapointsOk + +`func (o *SpotPricesDatapoints) GetDatapointsOk() (*[][]float32, bool)` + +GetDatapointsOk returns a tuple with the Datapoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatapoints + +`func (o *SpotPricesDatapoints) SetDatapoints(v [][]float32)` + +SetDatapoints sets Datapoints field to given value. + +### HasDatapoints + +`func (o *SpotPricesDatapoints) HasDatapoints() bool` + +HasDatapoints returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesHistoryReport.md b/services/metalv1/docs/SpotPricesHistoryReport.md new file mode 100644 index 00000000..cb99a3f9 --- /dev/null +++ b/services/metalv1/docs/SpotPricesHistoryReport.md @@ -0,0 +1,56 @@ +# SpotPricesHistoryReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PricesHistory** | Pointer to [**SpotPricesDatapoints**](SpotPricesDatapoints.md) | | [optional] + +## Methods + +### NewSpotPricesHistoryReport + +`func NewSpotPricesHistoryReport() *SpotPricesHistoryReport` + +NewSpotPricesHistoryReport instantiates a new SpotPricesHistoryReport object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesHistoryReportWithDefaults + +`func NewSpotPricesHistoryReportWithDefaults() *SpotPricesHistoryReport` + +NewSpotPricesHistoryReportWithDefaults instantiates a new SpotPricesHistoryReport object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPricesHistory + +`func (o *SpotPricesHistoryReport) GetPricesHistory() SpotPricesDatapoints` + +GetPricesHistory returns the PricesHistory field if non-nil, zero value otherwise. + +### GetPricesHistoryOk + +`func (o *SpotPricesHistoryReport) GetPricesHistoryOk() (*SpotPricesDatapoints, bool)` + +GetPricesHistoryOk returns a tuple with the PricesHistory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPricesHistory + +`func (o *SpotPricesHistoryReport) SetPricesHistory(v SpotPricesDatapoints)` + +SetPricesHistory sets PricesHistory field to given value. + +### HasPricesHistory + +`func (o *SpotPricesHistoryReport) HasPricesHistory() bool` + +HasPricesHistory returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesPerBaremetal.md b/services/metalv1/docs/SpotPricesPerBaremetal.md new file mode 100644 index 00000000..6c2703c7 --- /dev/null +++ b/services/metalv1/docs/SpotPricesPerBaremetal.md @@ -0,0 +1,56 @@ +# SpotPricesPerBaremetal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Price** | Pointer to **float32** | | [optional] + +## Methods + +### NewSpotPricesPerBaremetal + +`func NewSpotPricesPerBaremetal() *SpotPricesPerBaremetal` + +NewSpotPricesPerBaremetal instantiates a new SpotPricesPerBaremetal object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesPerBaremetalWithDefaults + +`func NewSpotPricesPerBaremetalWithDefaults() *SpotPricesPerBaremetal` + +NewSpotPricesPerBaremetalWithDefaults instantiates a new SpotPricesPerBaremetal object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPrice + +`func (o *SpotPricesPerBaremetal) GetPrice() float32` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *SpotPricesPerBaremetal) GetPriceOk() (*float32, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *SpotPricesPerBaremetal) SetPrice(v float32)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *SpotPricesPerBaremetal) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesPerFacility.md b/services/metalv1/docs/SpotPricesPerFacility.md new file mode 100644 index 00000000..6f284b85 --- /dev/null +++ b/services/metalv1/docs/SpotPricesPerFacility.md @@ -0,0 +1,264 @@ +# SpotPricesPerFacility + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Baremetal0** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**Baremetal1** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**Baremetal2** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**Baremetal2a** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**Baremetal2a2** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**Baremetal3** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**BaremetalS** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**C2MediumX86** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] +**M2XlargeX86** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] + +## Methods + +### NewSpotPricesPerFacility + +`func NewSpotPricesPerFacility() *SpotPricesPerFacility` + +NewSpotPricesPerFacility instantiates a new SpotPricesPerFacility object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesPerFacilityWithDefaults + +`func NewSpotPricesPerFacilityWithDefaults() *SpotPricesPerFacility` + +NewSpotPricesPerFacilityWithDefaults instantiates a new SpotPricesPerFacility object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaremetal0 + +`func (o *SpotPricesPerFacility) GetBaremetal0() SpotPricesPerBaremetal` + +GetBaremetal0 returns the Baremetal0 field if non-nil, zero value otherwise. + +### GetBaremetal0Ok + +`func (o *SpotPricesPerFacility) GetBaremetal0Ok() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal0Ok returns a tuple with the Baremetal0 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal0 + +`func (o *SpotPricesPerFacility) SetBaremetal0(v SpotPricesPerBaremetal)` + +SetBaremetal0 sets Baremetal0 field to given value. + +### HasBaremetal0 + +`func (o *SpotPricesPerFacility) HasBaremetal0() bool` + +HasBaremetal0 returns a boolean if a field has been set. + +### GetBaremetal1 + +`func (o *SpotPricesPerFacility) GetBaremetal1() SpotPricesPerBaremetal` + +GetBaremetal1 returns the Baremetal1 field if non-nil, zero value otherwise. + +### GetBaremetal1Ok + +`func (o *SpotPricesPerFacility) GetBaremetal1Ok() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal1Ok returns a tuple with the Baremetal1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal1 + +`func (o *SpotPricesPerFacility) SetBaremetal1(v SpotPricesPerBaremetal)` + +SetBaremetal1 sets Baremetal1 field to given value. + +### HasBaremetal1 + +`func (o *SpotPricesPerFacility) HasBaremetal1() bool` + +HasBaremetal1 returns a boolean if a field has been set. + +### GetBaremetal2 + +`func (o *SpotPricesPerFacility) GetBaremetal2() SpotPricesPerBaremetal` + +GetBaremetal2 returns the Baremetal2 field if non-nil, zero value otherwise. + +### GetBaremetal2Ok + +`func (o *SpotPricesPerFacility) GetBaremetal2Ok() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal2Ok returns a tuple with the Baremetal2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal2 + +`func (o *SpotPricesPerFacility) SetBaremetal2(v SpotPricesPerBaremetal)` + +SetBaremetal2 sets Baremetal2 field to given value. + +### HasBaremetal2 + +`func (o *SpotPricesPerFacility) HasBaremetal2() bool` + +HasBaremetal2 returns a boolean if a field has been set. + +### GetBaremetal2a + +`func (o *SpotPricesPerFacility) GetBaremetal2a() SpotPricesPerBaremetal` + +GetBaremetal2a returns the Baremetal2a field if non-nil, zero value otherwise. + +### GetBaremetal2aOk + +`func (o *SpotPricesPerFacility) GetBaremetal2aOk() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal2aOk returns a tuple with the Baremetal2a field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal2a + +`func (o *SpotPricesPerFacility) SetBaremetal2a(v SpotPricesPerBaremetal)` + +SetBaremetal2a sets Baremetal2a field to given value. + +### HasBaremetal2a + +`func (o *SpotPricesPerFacility) HasBaremetal2a() bool` + +HasBaremetal2a returns a boolean if a field has been set. + +### GetBaremetal2a2 + +`func (o *SpotPricesPerFacility) GetBaremetal2a2() SpotPricesPerBaremetal` + +GetBaremetal2a2 returns the Baremetal2a2 field if non-nil, zero value otherwise. + +### GetBaremetal2a2Ok + +`func (o *SpotPricesPerFacility) GetBaremetal2a2Ok() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal2a2Ok returns a tuple with the Baremetal2a2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal2a2 + +`func (o *SpotPricesPerFacility) SetBaremetal2a2(v SpotPricesPerBaremetal)` + +SetBaremetal2a2 sets Baremetal2a2 field to given value. + +### HasBaremetal2a2 + +`func (o *SpotPricesPerFacility) HasBaremetal2a2() bool` + +HasBaremetal2a2 returns a boolean if a field has been set. + +### GetBaremetal3 + +`func (o *SpotPricesPerFacility) GetBaremetal3() SpotPricesPerBaremetal` + +GetBaremetal3 returns the Baremetal3 field if non-nil, zero value otherwise. + +### GetBaremetal3Ok + +`func (o *SpotPricesPerFacility) GetBaremetal3Ok() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal3Ok returns a tuple with the Baremetal3 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal3 + +`func (o *SpotPricesPerFacility) SetBaremetal3(v SpotPricesPerBaremetal)` + +SetBaremetal3 sets Baremetal3 field to given value. + +### HasBaremetal3 + +`func (o *SpotPricesPerFacility) HasBaremetal3() bool` + +HasBaremetal3 returns a boolean if a field has been set. + +### GetBaremetalS + +`func (o *SpotPricesPerFacility) GetBaremetalS() SpotPricesPerBaremetal` + +GetBaremetalS returns the BaremetalS field if non-nil, zero value otherwise. + +### GetBaremetalSOk + +`func (o *SpotPricesPerFacility) GetBaremetalSOk() (*SpotPricesPerBaremetal, bool)` + +GetBaremetalSOk returns a tuple with the BaremetalS field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetalS + +`func (o *SpotPricesPerFacility) SetBaremetalS(v SpotPricesPerBaremetal)` + +SetBaremetalS sets BaremetalS field to given value. + +### HasBaremetalS + +`func (o *SpotPricesPerFacility) HasBaremetalS() bool` + +HasBaremetalS returns a boolean if a field has been set. + +### GetC2MediumX86 + +`func (o *SpotPricesPerFacility) GetC2MediumX86() SpotPricesPerBaremetal` + +GetC2MediumX86 returns the C2MediumX86 field if non-nil, zero value otherwise. + +### GetC2MediumX86Ok + +`func (o *SpotPricesPerFacility) GetC2MediumX86Ok() (*SpotPricesPerBaremetal, bool)` + +GetC2MediumX86Ok returns a tuple with the C2MediumX86 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetC2MediumX86 + +`func (o *SpotPricesPerFacility) SetC2MediumX86(v SpotPricesPerBaremetal)` + +SetC2MediumX86 sets C2MediumX86 field to given value. + +### HasC2MediumX86 + +`func (o *SpotPricesPerFacility) HasC2MediumX86() bool` + +HasC2MediumX86 returns a boolean if a field has been set. + +### GetM2XlargeX86 + +`func (o *SpotPricesPerFacility) GetM2XlargeX86() SpotPricesPerBaremetal` + +GetM2XlargeX86 returns the M2XlargeX86 field if non-nil, zero value otherwise. + +### GetM2XlargeX86Ok + +`func (o *SpotPricesPerFacility) GetM2XlargeX86Ok() (*SpotPricesPerBaremetal, bool)` + +GetM2XlargeX86Ok returns a tuple with the M2XlargeX86 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetM2XlargeX86 + +`func (o *SpotPricesPerFacility) SetM2XlargeX86(v SpotPricesPerBaremetal)` + +SetM2XlargeX86 sets M2XlargeX86 field to given value. + +### HasM2XlargeX86 + +`func (o *SpotPricesPerFacility) HasM2XlargeX86() bool` + +HasM2XlargeX86 returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesPerNewFacility.md b/services/metalv1/docs/SpotPricesPerNewFacility.md new file mode 100644 index 00000000..e995b625 --- /dev/null +++ b/services/metalv1/docs/SpotPricesPerNewFacility.md @@ -0,0 +1,56 @@ +# SpotPricesPerNewFacility + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Baremetal1e** | Pointer to [**SpotPricesPerBaremetal**](SpotPricesPerBaremetal.md) | | [optional] + +## Methods + +### NewSpotPricesPerNewFacility + +`func NewSpotPricesPerNewFacility() *SpotPricesPerNewFacility` + +NewSpotPricesPerNewFacility instantiates a new SpotPricesPerNewFacility object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesPerNewFacilityWithDefaults + +`func NewSpotPricesPerNewFacilityWithDefaults() *SpotPricesPerNewFacility` + +NewSpotPricesPerNewFacilityWithDefaults instantiates a new SpotPricesPerNewFacility object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBaremetal1e + +`func (o *SpotPricesPerNewFacility) GetBaremetal1e() SpotPricesPerBaremetal` + +GetBaremetal1e returns the Baremetal1e field if non-nil, zero value otherwise. + +### GetBaremetal1eOk + +`func (o *SpotPricesPerNewFacility) GetBaremetal1eOk() (*SpotPricesPerBaremetal, bool)` + +GetBaremetal1eOk returns a tuple with the Baremetal1e field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBaremetal1e + +`func (o *SpotPricesPerNewFacility) SetBaremetal1e(v SpotPricesPerBaremetal)` + +SetBaremetal1e sets Baremetal1e field to given value. + +### HasBaremetal1e + +`func (o *SpotPricesPerNewFacility) HasBaremetal1e() bool` + +HasBaremetal1e returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SpotPricesReport.md b/services/metalv1/docs/SpotPricesReport.md new file mode 100644 index 00000000..8e3588e3 --- /dev/null +++ b/services/metalv1/docs/SpotPricesReport.md @@ -0,0 +1,394 @@ +# SpotPricesReport + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ams1** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Atl1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Dfw1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Ewr1** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Fra1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Iad1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Lax1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Nrt1** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Ord1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Sea1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Sin1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Sjc1** | Pointer to [**SpotPricesPerFacility**](SpotPricesPerFacility.md) | | [optional] +**Syd1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] +**Yyz1** | Pointer to [**SpotPricesPerNewFacility**](SpotPricesPerNewFacility.md) | | [optional] + +## Methods + +### NewSpotPricesReport + +`func NewSpotPricesReport() *SpotPricesReport` + +NewSpotPricesReport instantiates a new SpotPricesReport object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpotPricesReportWithDefaults + +`func NewSpotPricesReportWithDefaults() *SpotPricesReport` + +NewSpotPricesReportWithDefaults instantiates a new SpotPricesReport object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAms1 + +`func (o *SpotPricesReport) GetAms1() SpotPricesPerFacility` + +GetAms1 returns the Ams1 field if non-nil, zero value otherwise. + +### GetAms1Ok + +`func (o *SpotPricesReport) GetAms1Ok() (*SpotPricesPerFacility, bool)` + +GetAms1Ok returns a tuple with the Ams1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAms1 + +`func (o *SpotPricesReport) SetAms1(v SpotPricesPerFacility)` + +SetAms1 sets Ams1 field to given value. + +### HasAms1 + +`func (o *SpotPricesReport) HasAms1() bool` + +HasAms1 returns a boolean if a field has been set. + +### GetAtl1 + +`func (o *SpotPricesReport) GetAtl1() SpotPricesPerNewFacility` + +GetAtl1 returns the Atl1 field if non-nil, zero value otherwise. + +### GetAtl1Ok + +`func (o *SpotPricesReport) GetAtl1Ok() (*SpotPricesPerNewFacility, bool)` + +GetAtl1Ok returns a tuple with the Atl1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAtl1 + +`func (o *SpotPricesReport) SetAtl1(v SpotPricesPerNewFacility)` + +SetAtl1 sets Atl1 field to given value. + +### HasAtl1 + +`func (o *SpotPricesReport) HasAtl1() bool` + +HasAtl1 returns a boolean if a field has been set. + +### GetDfw1 + +`func (o *SpotPricesReport) GetDfw1() SpotPricesPerNewFacility` + +GetDfw1 returns the Dfw1 field if non-nil, zero value otherwise. + +### GetDfw1Ok + +`func (o *SpotPricesReport) GetDfw1Ok() (*SpotPricesPerNewFacility, bool)` + +GetDfw1Ok returns a tuple with the Dfw1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDfw1 + +`func (o *SpotPricesReport) SetDfw1(v SpotPricesPerNewFacility)` + +SetDfw1 sets Dfw1 field to given value. + +### HasDfw1 + +`func (o *SpotPricesReport) HasDfw1() bool` + +HasDfw1 returns a boolean if a field has been set. + +### GetEwr1 + +`func (o *SpotPricesReport) GetEwr1() SpotPricesPerFacility` + +GetEwr1 returns the Ewr1 field if non-nil, zero value otherwise. + +### GetEwr1Ok + +`func (o *SpotPricesReport) GetEwr1Ok() (*SpotPricesPerFacility, bool)` + +GetEwr1Ok returns a tuple with the Ewr1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwr1 + +`func (o *SpotPricesReport) SetEwr1(v SpotPricesPerFacility)` + +SetEwr1 sets Ewr1 field to given value. + +### HasEwr1 + +`func (o *SpotPricesReport) HasEwr1() bool` + +HasEwr1 returns a boolean if a field has been set. + +### GetFra1 + +`func (o *SpotPricesReport) GetFra1() SpotPricesPerNewFacility` + +GetFra1 returns the Fra1 field if non-nil, zero value otherwise. + +### GetFra1Ok + +`func (o *SpotPricesReport) GetFra1Ok() (*SpotPricesPerNewFacility, bool)` + +GetFra1Ok returns a tuple with the Fra1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFra1 + +`func (o *SpotPricesReport) SetFra1(v SpotPricesPerNewFacility)` + +SetFra1 sets Fra1 field to given value. + +### HasFra1 + +`func (o *SpotPricesReport) HasFra1() bool` + +HasFra1 returns a boolean if a field has been set. + +### GetIad1 + +`func (o *SpotPricesReport) GetIad1() SpotPricesPerNewFacility` + +GetIad1 returns the Iad1 field if non-nil, zero value otherwise. + +### GetIad1Ok + +`func (o *SpotPricesReport) GetIad1Ok() (*SpotPricesPerNewFacility, bool)` + +GetIad1Ok returns a tuple with the Iad1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIad1 + +`func (o *SpotPricesReport) SetIad1(v SpotPricesPerNewFacility)` + +SetIad1 sets Iad1 field to given value. + +### HasIad1 + +`func (o *SpotPricesReport) HasIad1() bool` + +HasIad1 returns a boolean if a field has been set. + +### GetLax1 + +`func (o *SpotPricesReport) GetLax1() SpotPricesPerNewFacility` + +GetLax1 returns the Lax1 field if non-nil, zero value otherwise. + +### GetLax1Ok + +`func (o *SpotPricesReport) GetLax1Ok() (*SpotPricesPerNewFacility, bool)` + +GetLax1Ok returns a tuple with the Lax1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLax1 + +`func (o *SpotPricesReport) SetLax1(v SpotPricesPerNewFacility)` + +SetLax1 sets Lax1 field to given value. + +### HasLax1 + +`func (o *SpotPricesReport) HasLax1() bool` + +HasLax1 returns a boolean if a field has been set. + +### GetNrt1 + +`func (o *SpotPricesReport) GetNrt1() SpotPricesPerFacility` + +GetNrt1 returns the Nrt1 field if non-nil, zero value otherwise. + +### GetNrt1Ok + +`func (o *SpotPricesReport) GetNrt1Ok() (*SpotPricesPerFacility, bool)` + +GetNrt1Ok returns a tuple with the Nrt1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNrt1 + +`func (o *SpotPricesReport) SetNrt1(v SpotPricesPerFacility)` + +SetNrt1 sets Nrt1 field to given value. + +### HasNrt1 + +`func (o *SpotPricesReport) HasNrt1() bool` + +HasNrt1 returns a boolean if a field has been set. + +### GetOrd1 + +`func (o *SpotPricesReport) GetOrd1() SpotPricesPerNewFacility` + +GetOrd1 returns the Ord1 field if non-nil, zero value otherwise. + +### GetOrd1Ok + +`func (o *SpotPricesReport) GetOrd1Ok() (*SpotPricesPerNewFacility, bool)` + +GetOrd1Ok returns a tuple with the Ord1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrd1 + +`func (o *SpotPricesReport) SetOrd1(v SpotPricesPerNewFacility)` + +SetOrd1 sets Ord1 field to given value. + +### HasOrd1 + +`func (o *SpotPricesReport) HasOrd1() bool` + +HasOrd1 returns a boolean if a field has been set. + +### GetSea1 + +`func (o *SpotPricesReport) GetSea1() SpotPricesPerNewFacility` + +GetSea1 returns the Sea1 field if non-nil, zero value otherwise. + +### GetSea1Ok + +`func (o *SpotPricesReport) GetSea1Ok() (*SpotPricesPerNewFacility, bool)` + +GetSea1Ok returns a tuple with the Sea1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSea1 + +`func (o *SpotPricesReport) SetSea1(v SpotPricesPerNewFacility)` + +SetSea1 sets Sea1 field to given value. + +### HasSea1 + +`func (o *SpotPricesReport) HasSea1() bool` + +HasSea1 returns a boolean if a field has been set. + +### GetSin1 + +`func (o *SpotPricesReport) GetSin1() SpotPricesPerNewFacility` + +GetSin1 returns the Sin1 field if non-nil, zero value otherwise. + +### GetSin1Ok + +`func (o *SpotPricesReport) GetSin1Ok() (*SpotPricesPerNewFacility, bool)` + +GetSin1Ok returns a tuple with the Sin1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSin1 + +`func (o *SpotPricesReport) SetSin1(v SpotPricesPerNewFacility)` + +SetSin1 sets Sin1 field to given value. + +### HasSin1 + +`func (o *SpotPricesReport) HasSin1() bool` + +HasSin1 returns a boolean if a field has been set. + +### GetSjc1 + +`func (o *SpotPricesReport) GetSjc1() SpotPricesPerFacility` + +GetSjc1 returns the Sjc1 field if non-nil, zero value otherwise. + +### GetSjc1Ok + +`func (o *SpotPricesReport) GetSjc1Ok() (*SpotPricesPerFacility, bool)` + +GetSjc1Ok returns a tuple with the Sjc1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSjc1 + +`func (o *SpotPricesReport) SetSjc1(v SpotPricesPerFacility)` + +SetSjc1 sets Sjc1 field to given value. + +### HasSjc1 + +`func (o *SpotPricesReport) HasSjc1() bool` + +HasSjc1 returns a boolean if a field has been set. + +### GetSyd1 + +`func (o *SpotPricesReport) GetSyd1() SpotPricesPerNewFacility` + +GetSyd1 returns the Syd1 field if non-nil, zero value otherwise. + +### GetSyd1Ok + +`func (o *SpotPricesReport) GetSyd1Ok() (*SpotPricesPerNewFacility, bool)` + +GetSyd1Ok returns a tuple with the Syd1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSyd1 + +`func (o *SpotPricesReport) SetSyd1(v SpotPricesPerNewFacility)` + +SetSyd1 sets Syd1 field to given value. + +### HasSyd1 + +`func (o *SpotPricesReport) HasSyd1() bool` + +HasSyd1 returns a boolean if a field has been set. + +### GetYyz1 + +`func (o *SpotPricesReport) GetYyz1() SpotPricesPerNewFacility` + +GetYyz1 returns the Yyz1 field if non-nil, zero value otherwise. + +### GetYyz1Ok + +`func (o *SpotPricesReport) GetYyz1Ok() (*SpotPricesPerNewFacility, bool)` + +GetYyz1Ok returns a tuple with the Yyz1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetYyz1 + +`func (o *SpotPricesReport) SetYyz1(v SpotPricesPerNewFacility)` + +SetYyz1 sets Yyz1 field to given value. + +### HasYyz1 + +`func (o *SpotPricesReport) HasYyz1() bool` + +HasYyz1 returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Storage.md b/services/metalv1/docs/Storage.md new file mode 100644 index 00000000..833c69ac --- /dev/null +++ b/services/metalv1/docs/Storage.md @@ -0,0 +1,108 @@ +# Storage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Disks** | Pointer to [**[]Disk**](Disk.md) | | [optional] +**Raid** | Pointer to [**[]Raid**](Raid.md) | | [optional] +**Filesystems** | Pointer to [**[]Filesystem**](Filesystem.md) | | [optional] + +## Methods + +### NewStorage + +`func NewStorage() *Storage` + +NewStorage instantiates a new Storage object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStorageWithDefaults + +`func NewStorageWithDefaults() *Storage` + +NewStorageWithDefaults instantiates a new Storage object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDisks + +`func (o *Storage) GetDisks() []Disk` + +GetDisks returns the Disks field if non-nil, zero value otherwise. + +### GetDisksOk + +`func (o *Storage) GetDisksOk() (*[]Disk, bool)` + +GetDisksOk returns a tuple with the Disks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisks + +`func (o *Storage) SetDisks(v []Disk)` + +SetDisks sets Disks field to given value. + +### HasDisks + +`func (o *Storage) HasDisks() bool` + +HasDisks returns a boolean if a field has been set. + +### GetRaid + +`func (o *Storage) GetRaid() []Raid` + +GetRaid returns the Raid field if non-nil, zero value otherwise. + +### GetRaidOk + +`func (o *Storage) GetRaidOk() (*[]Raid, bool)` + +GetRaidOk returns a tuple with the Raid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRaid + +`func (o *Storage) SetRaid(v []Raid)` + +SetRaid sets Raid field to given value. + +### HasRaid + +`func (o *Storage) HasRaid() bool` + +HasRaid returns a boolean if a field has been set. + +### GetFilesystems + +`func (o *Storage) GetFilesystems() []Filesystem` + +GetFilesystems returns the Filesystems field if non-nil, zero value otherwise. + +### GetFilesystemsOk + +`func (o *Storage) GetFilesystemsOk() (*[]Filesystem, bool)` + +GetFilesystemsOk returns a tuple with the Filesystems field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilesystems + +`func (o *Storage) SetFilesystems(v []Filesystem)` + +SetFilesystems sets Filesystems field to given value. + +### HasFilesystems + +`func (o *Storage) HasFilesystems() bool` + +HasFilesystems returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SupportRequestApi.md b/services/metalv1/docs/SupportRequestApi.md new file mode 100644 index 00000000..863600fe --- /dev/null +++ b/services/metalv1/docs/SupportRequestApi.md @@ -0,0 +1,73 @@ +# \SupportRequestApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RequestSuppert**](SupportRequestApi.md#RequestSuppert) | **Post** /support-requests | Create a support ticket + + + +## RequestSuppert + +> RequestSuppert(ctx).SupportRequestInput(supportRequestInput).Execute() + +Create a support ticket + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + supportRequestInput := *openapiclient.NewSupportRequestInput("Message_example", "Subject_example") // SupportRequestInput | Support Request to create + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.SupportRequestApi.RequestSuppert(context.Background()).SupportRequestInput(supportRequestInput).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SupportRequestApi.RequestSuppert``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRequestSuppertRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **supportRequestInput** | [**SupportRequestInput**](SupportRequestInput.md) | Support Request to create | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/SupportRequestInput.md b/services/metalv1/docs/SupportRequestInput.md new file mode 100644 index 00000000..62bd47ca --- /dev/null +++ b/services/metalv1/docs/SupportRequestInput.md @@ -0,0 +1,150 @@ +# SupportRequestInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceId** | Pointer to **string** | | [optional] +**Message** | **string** | | +**Priority** | Pointer to [**SupportRequestInputPriority**](SupportRequestInputPriority.md) | | [optional] +**ProjectId** | Pointer to **string** | | [optional] +**Subject** | **string** | | + +## Methods + +### NewSupportRequestInput + +`func NewSupportRequestInput(message string, subject string, ) *SupportRequestInput` + +NewSupportRequestInput instantiates a new SupportRequestInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSupportRequestInputWithDefaults + +`func NewSupportRequestInputWithDefaults() *SupportRequestInput` + +NewSupportRequestInputWithDefaults instantiates a new SupportRequestInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeviceId + +`func (o *SupportRequestInput) GetDeviceId() string` + +GetDeviceId returns the DeviceId field if non-nil, zero value otherwise. + +### GetDeviceIdOk + +`func (o *SupportRequestInput) GetDeviceIdOk() (*string, bool)` + +GetDeviceIdOk returns a tuple with the DeviceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeviceId + +`func (o *SupportRequestInput) SetDeviceId(v string)` + +SetDeviceId sets DeviceId field to given value. + +### HasDeviceId + +`func (o *SupportRequestInput) HasDeviceId() bool` + +HasDeviceId returns a boolean if a field has been set. + +### GetMessage + +`func (o *SupportRequestInput) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *SupportRequestInput) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *SupportRequestInput) SetMessage(v string)` + +SetMessage sets Message field to given value. + + +### GetPriority + +`func (o *SupportRequestInput) GetPriority() SupportRequestInputPriority` + +GetPriority returns the Priority field if non-nil, zero value otherwise. + +### GetPriorityOk + +`func (o *SupportRequestInput) GetPriorityOk() (*SupportRequestInputPriority, bool)` + +GetPriorityOk returns a tuple with the Priority field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriority + +`func (o *SupportRequestInput) SetPriority(v SupportRequestInputPriority)` + +SetPriority sets Priority field to given value. + +### HasPriority + +`func (o *SupportRequestInput) HasPriority() bool` + +HasPriority returns a boolean if a field has been set. + +### GetProjectId + +`func (o *SupportRequestInput) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *SupportRequestInput) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *SupportRequestInput) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + +### HasProjectId + +`func (o *SupportRequestInput) HasProjectId() bool` + +HasProjectId returns a boolean if a field has been set. + +### GetSubject + +`func (o *SupportRequestInput) GetSubject() string` + +GetSubject returns the Subject field if non-nil, zero value otherwise. + +### GetSubjectOk + +`func (o *SupportRequestInput) GetSubjectOk() (*string, bool)` + +GetSubjectOk returns a tuple with the Subject field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubject + +`func (o *SupportRequestInput) SetSubject(v string)` + +SetSubject sets Subject field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/SupportRequestInputPriority.md b/services/metalv1/docs/SupportRequestInputPriority.md new file mode 100644 index 00000000..6cb8b287 --- /dev/null +++ b/services/metalv1/docs/SupportRequestInputPriority.md @@ -0,0 +1,17 @@ +# SupportRequestInputPriority + +## Enum + + +* `URGENT` (value: `"urgent"`) + +* `HIGH` (value: `"high"`) + +* `MEDIUM` (value: `"medium"`) + +* `LOW` (value: `"low"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/TransferRequest.md b/services/metalv1/docs/TransferRequest.md new file mode 100644 index 00000000..df67438f --- /dev/null +++ b/services/metalv1/docs/TransferRequest.md @@ -0,0 +1,186 @@ +# TransferRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**TargetOrganization** | Pointer to [**Href**](Href.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewTransferRequest + +`func NewTransferRequest() *TransferRequest` + +NewTransferRequest instantiates a new TransferRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransferRequestWithDefaults + +`func NewTransferRequestWithDefaults() *TransferRequest` + +NewTransferRequestWithDefaults instantiates a new TransferRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *TransferRequest) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *TransferRequest) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *TransferRequest) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *TransferRequest) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetHref + +`func (o *TransferRequest) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *TransferRequest) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *TransferRequest) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *TransferRequest) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *TransferRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *TransferRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *TransferRequest) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *TransferRequest) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetProject + +`func (o *TransferRequest) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *TransferRequest) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *TransferRequest) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *TransferRequest) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetTargetOrganization + +`func (o *TransferRequest) GetTargetOrganization() Href` + +GetTargetOrganization returns the TargetOrganization field if non-nil, zero value otherwise. + +### GetTargetOrganizationOk + +`func (o *TransferRequest) GetTargetOrganizationOk() (*Href, bool)` + +GetTargetOrganizationOk returns a tuple with the TargetOrganization field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetOrganization + +`func (o *TransferRequest) SetTargetOrganization(v Href)` + +SetTargetOrganization sets TargetOrganization field to given value. + +### HasTargetOrganization + +`func (o *TransferRequest) HasTargetOrganization() bool` + +HasTargetOrganization returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *TransferRequest) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *TransferRequest) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *TransferRequest) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *TransferRequest) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/TransferRequestInput.md b/services/metalv1/docs/TransferRequestInput.md new file mode 100644 index 00000000..7ca4ca83 --- /dev/null +++ b/services/metalv1/docs/TransferRequestInput.md @@ -0,0 +1,56 @@ +# TransferRequestInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TargetOrganizationId** | Pointer to **string** | | [optional] + +## Methods + +### NewTransferRequestInput + +`func NewTransferRequestInput() *TransferRequestInput` + +NewTransferRequestInput instantiates a new TransferRequestInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransferRequestInputWithDefaults + +`func NewTransferRequestInputWithDefaults() *TransferRequestInput` + +NewTransferRequestInputWithDefaults instantiates a new TransferRequestInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTargetOrganizationId + +`func (o *TransferRequestInput) GetTargetOrganizationId() string` + +GetTargetOrganizationId returns the TargetOrganizationId field if non-nil, zero value otherwise. + +### GetTargetOrganizationIdOk + +`func (o *TransferRequestInput) GetTargetOrganizationIdOk() (*string, bool)` + +GetTargetOrganizationIdOk returns a tuple with the TargetOrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetOrganizationId + +`func (o *TransferRequestInput) SetTargetOrganizationId(v string)` + +SetTargetOrganizationId sets TargetOrganizationId field to given value. + +### HasTargetOrganizationId + +`func (o *TransferRequestInput) HasTargetOrganizationId() bool` + +HasTargetOrganizationId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/TransferRequestList.md b/services/metalv1/docs/TransferRequestList.md new file mode 100644 index 00000000..260d1be6 --- /dev/null +++ b/services/metalv1/docs/TransferRequestList.md @@ -0,0 +1,56 @@ +# TransferRequestList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Transfers** | Pointer to [**[]TransferRequest**](TransferRequest.md) | | [optional] + +## Methods + +### NewTransferRequestList + +`func NewTransferRequestList() *TransferRequestList` + +NewTransferRequestList instantiates a new TransferRequestList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTransferRequestListWithDefaults + +`func NewTransferRequestListWithDefaults() *TransferRequestList` + +NewTransferRequestListWithDefaults instantiates a new TransferRequestList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTransfers + +`func (o *TransferRequestList) GetTransfers() []TransferRequest` + +GetTransfers returns the Transfers field if non-nil, zero value otherwise. + +### GetTransfersOk + +`func (o *TransferRequestList) GetTransfersOk() (*[]TransferRequest, bool)` + +GetTransfersOk returns a tuple with the Transfers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTransfers + +`func (o *TransferRequestList) SetTransfers(v []TransferRequest)` + +SetTransfers sets Transfers field to given value. + +### HasTransfers + +`func (o *TransferRequestList) HasTransfers() bool` + +HasTransfers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/TransferRequestsApi.md b/services/metalv1/docs/TransferRequestsApi.md new file mode 100644 index 00000000..cf592770 --- /dev/null +++ b/services/metalv1/docs/TransferRequestsApi.md @@ -0,0 +1,219 @@ +# \TransferRequestsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AcceptTransferRequest**](TransferRequestsApi.md#AcceptTransferRequest) | **Put** /transfers/{id} | Accept a transfer request +[**DeclineTransferRequest**](TransferRequestsApi.md#DeclineTransferRequest) | **Delete** /transfers/{id} | Decline a transfer request +[**FindTransferRequestById**](TransferRequestsApi.md#FindTransferRequestById) | **Get** /transfers/{id} | View a transfer request + + + +## AcceptTransferRequest + +> AcceptTransferRequest(ctx, id).Execute() + +Accept a transfer request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Transfer request UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TransferRequestsApi.AcceptTransferRequest(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TransferRequestsApi.AcceptTransferRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Transfer request UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAcceptTransferRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeclineTransferRequest + +> DeclineTransferRequest(ctx, id).Execute() + +Decline a transfer request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Transfer request UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TransferRequestsApi.DeclineTransferRequest(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TransferRequestsApi.DeclineTransferRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Transfer request UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeclineTransferRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindTransferRequestById + +> TransferRequest FindTransferRequestById(ctx, id).Include(include).Execute() + +View a transfer request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Transfer request UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TransferRequestsApi.FindTransferRequestById(context.Background(), id).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TransferRequestsApi.FindTransferRequestById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindTransferRequestById`: TransferRequest + fmt.Fprintf(os.Stdout, "Response from `TransferRequestsApi.FindTransferRequestById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Transfer request UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindTransferRequestByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + +[**TransferRequest**](TransferRequest.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/TwoFactorAuthApi.md b/services/metalv1/docs/TwoFactorAuthApi.md new file mode 100644 index 00000000..def60ffd --- /dev/null +++ b/services/metalv1/docs/TwoFactorAuthApi.md @@ -0,0 +1,248 @@ +# \TwoFactorAuthApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DisableTfaApp**](TwoFactorAuthApi.md#DisableTfaApp) | **Delete** /user/otp/app | Disable two factor authentication +[**DisableTfaSms**](TwoFactorAuthApi.md#DisableTfaSms) | **Delete** /user/otp/sms | Disable two factor authentication +[**EnableTfaApp**](TwoFactorAuthApi.md#EnableTfaApp) | **Post** /user/otp/app | Enable two factor auth using app +[**EnableTfaSms**](TwoFactorAuthApi.md#EnableTfaSms) | **Post** /user/otp/sms | Enable two factor auth using sms + + + +## DisableTfaApp + +> DisableTfaApp(ctx).Execute() + +Disable two factor authentication + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TwoFactorAuthApi.DisableTfaApp(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TwoFactorAuthApi.DisableTfaApp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiDisableTfaAppRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DisableTfaSms + +> DisableTfaSms(ctx).Execute() + +Disable two factor authentication + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TwoFactorAuthApi.DisableTfaSms(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TwoFactorAuthApi.DisableTfaSms``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiDisableTfaSmsRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## EnableTfaApp + +> EnableTfaApp(ctx).Execute() + +Enable two factor auth using app + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TwoFactorAuthApi.EnableTfaApp(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TwoFactorAuthApi.EnableTfaApp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiEnableTfaAppRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## EnableTfaSms + +> EnableTfaSms(ctx).Execute() + +Enable two factor auth using sms + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.TwoFactorAuthApi.EnableTfaSms(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TwoFactorAuthApi.EnableTfaSms``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiEnableTfaSmsRequest struct via the builder pattern + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/UpdateEmailInput.md b/services/metalv1/docs/UpdateEmailInput.md new file mode 100644 index 00000000..bd467f2b --- /dev/null +++ b/services/metalv1/docs/UpdateEmailInput.md @@ -0,0 +1,56 @@ +# UpdateEmailInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Default** | Pointer to **bool** | | [optional] + +## Methods + +### NewUpdateEmailInput + +`func NewUpdateEmailInput() *UpdateEmailInput` + +NewUpdateEmailInput instantiates a new UpdateEmailInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateEmailInputWithDefaults + +`func NewUpdateEmailInputWithDefaults() *UpdateEmailInput` + +NewUpdateEmailInputWithDefaults instantiates a new UpdateEmailInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDefault + +`func (o *UpdateEmailInput) GetDefault() bool` + +GetDefault returns the Default field if non-nil, zero value otherwise. + +### GetDefaultOk + +`func (o *UpdateEmailInput) GetDefaultOk() (*bool, bool)` + +GetDefaultOk returns a tuple with the Default field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefault + +`func (o *UpdateEmailInput) SetDefault(v bool)` + +SetDefault sets Default field to given value. + +### HasDefault + +`func (o *UpdateEmailInput) HasDefault() bool` + +HasDefault returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UsagesApi.md b/services/metalv1/docs/UsagesApi.md new file mode 100644 index 00000000..851fc2d3 --- /dev/null +++ b/services/metalv1/docs/UsagesApi.md @@ -0,0 +1,158 @@ +# \UsagesApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FindDeviceUsages**](UsagesApi.md#FindDeviceUsages) | **Get** /devices/{id}/usages | Retrieve all usages for device +[**FindProjectUsage**](UsagesApi.md#FindProjectUsage) | **Get** /projects/{id}/usages | Retrieve all usages for project + + + +## FindDeviceUsages + +> DeviceUsageList FindDeviceUsages(ctx, id).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Execute() + +Retrieve all usages for device + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Device UUID + createdAfter := "createdAfter_example" // string | Filter usages created after this date (optional) + createdBefore := "createdBefore_example" // string | Filter usages created before this date (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsagesApi.FindDeviceUsages(context.Background(), id).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsagesApi.FindDeviceUsages``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindDeviceUsages`: DeviceUsageList + fmt.Fprintf(os.Stdout, "Response from `UsagesApi.FindDeviceUsages`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Device UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindDeviceUsagesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createdAfter** | **string** | Filter usages created after this date | + **createdBefore** | **string** | Filter usages created before this date | + +### Return type + +[**DeviceUsageList**](DeviceUsageList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindProjectUsage + +> ProjectUsageList FindProjectUsage(ctx, id).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Execute() + +Retrieve all usages for project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + createdAfter := "createdAfter_example" // string | Filter usages created after this date (optional) + createdBefore := "createdBefore_example" // string | Filter usages created before this date (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsagesApi.FindProjectUsage(context.Background(), id).CreatedAfter(createdAfter).CreatedBefore(createdBefore).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsagesApi.FindProjectUsage``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindProjectUsage`: ProjectUsageList + fmt.Fprintf(os.Stdout, "Response from `UsagesApi.FindProjectUsage`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindProjectUsageRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **createdAfter** | **string** | Filter usages created after this date | + **createdBefore** | **string** | Filter usages created before this date | + +### Return type + +[**ProjectUsageList**](ProjectUsageList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/User.md b/services/metalv1/docs/User.md new file mode 100644 index 00000000..66a87d34 --- /dev/null +++ b/services/metalv1/docs/User.md @@ -0,0 +1,602 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvatarThumbUrl** | Pointer to **string** | | [optional] +**AvatarUrl** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**DefaultOrganizationId** | Pointer to **string** | | [optional] +**DefaultProjectId** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Emails** | Pointer to [**[]Href**](Href.md) | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**FraudScore** | Pointer to **string** | | [optional] +**FullName** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**LastLoginAt** | Pointer to **time.Time** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**MaxOrganizations** | Pointer to **int32** | | [optional] +**MaxProjects** | Pointer to **int32** | | [optional] +**PhoneNumber** | Pointer to **string** | | [optional] +**ShortId** | Pointer to **string** | | [optional] +**Timezone** | Pointer to **string** | | [optional] +**TwoFactorAuth** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatarThumbUrl + +`func (o *User) GetAvatarThumbUrl() string` + +GetAvatarThumbUrl returns the AvatarThumbUrl field if non-nil, zero value otherwise. + +### GetAvatarThumbUrlOk + +`func (o *User) GetAvatarThumbUrlOk() (*string, bool)` + +GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarThumbUrl + +`func (o *User) SetAvatarThumbUrl(v string)` + +SetAvatarThumbUrl sets AvatarThumbUrl field to given value. + +### HasAvatarThumbUrl + +`func (o *User) HasAvatarThumbUrl() bool` + +HasAvatarThumbUrl returns a boolean if a field has been set. + +### GetAvatarUrl + +`func (o *User) GetAvatarUrl() string` + +GetAvatarUrl returns the AvatarUrl field if non-nil, zero value otherwise. + +### GetAvatarUrlOk + +`func (o *User) GetAvatarUrlOk() (*string, bool)` + +GetAvatarUrlOk returns a tuple with the AvatarUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarUrl + +`func (o *User) SetAvatarUrl(v string)` + +SetAvatarUrl sets AvatarUrl field to given value. + +### HasAvatarUrl + +`func (o *User) HasAvatarUrl() bool` + +HasAvatarUrl returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *User) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *User) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *User) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *User) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *User) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *User) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *User) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *User) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDefaultOrganizationId + +`func (o *User) GetDefaultOrganizationId() string` + +GetDefaultOrganizationId returns the DefaultOrganizationId field if non-nil, zero value otherwise. + +### GetDefaultOrganizationIdOk + +`func (o *User) GetDefaultOrganizationIdOk() (*string, bool)` + +GetDefaultOrganizationIdOk returns a tuple with the DefaultOrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultOrganizationId + +`func (o *User) SetDefaultOrganizationId(v string)` + +SetDefaultOrganizationId sets DefaultOrganizationId field to given value. + +### HasDefaultOrganizationId + +`func (o *User) HasDefaultOrganizationId() bool` + +HasDefaultOrganizationId returns a boolean if a field has been set. + +### GetDefaultProjectId + +`func (o *User) GetDefaultProjectId() string` + +GetDefaultProjectId returns the DefaultProjectId field if non-nil, zero value otherwise. + +### GetDefaultProjectIdOk + +`func (o *User) GetDefaultProjectIdOk() (*string, bool)` + +GetDefaultProjectIdOk returns a tuple with the DefaultProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDefaultProjectId + +`func (o *User) SetDefaultProjectId(v string)` + +SetDefaultProjectId sets DefaultProjectId field to given value. + +### HasDefaultProjectId + +`func (o *User) HasDefaultProjectId() bool` + +HasDefaultProjectId returns a boolean if a field has been set. + +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetEmails + +`func (o *User) GetEmails() []Href` + +GetEmails returns the Emails field if non-nil, zero value otherwise. + +### GetEmailsOk + +`func (o *User) GetEmailsOk() (*[]Href, bool)` + +GetEmailsOk returns a tuple with the Emails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmails + +`func (o *User) SetEmails(v []Href)` + +SetEmails sets Emails field to given value. + +### HasEmails + +`func (o *User) HasEmails() bool` + +HasEmails returns a boolean if a field has been set. + +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetFraudScore + +`func (o *User) GetFraudScore() string` + +GetFraudScore returns the FraudScore field if non-nil, zero value otherwise. + +### GetFraudScoreOk + +`func (o *User) GetFraudScoreOk() (*string, bool)` + +GetFraudScoreOk returns a tuple with the FraudScore field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFraudScore + +`func (o *User) SetFraudScore(v string)` + +SetFraudScore sets FraudScore field to given value. + +### HasFraudScore + +`func (o *User) HasFraudScore() bool` + +HasFraudScore returns a boolean if a field has been set. + +### GetFullName + +`func (o *User) GetFullName() string` + +GetFullName returns the FullName field if non-nil, zero value otherwise. + +### GetFullNameOk + +`func (o *User) GetFullNameOk() (*string, bool)` + +GetFullNameOk returns a tuple with the FullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFullName + +`func (o *User) SetFullName(v string)` + +SetFullName sets FullName field to given value. + +### HasFullName + +`func (o *User) HasFullName() bool` + +HasFullName returns a boolean if a field has been set. + +### GetHref + +`func (o *User) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *User) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *User) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *User) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *User) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *User) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *User) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *User) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLastLoginAt + +`func (o *User) GetLastLoginAt() time.Time` + +GetLastLoginAt returns the LastLoginAt field if non-nil, zero value otherwise. + +### GetLastLoginAtOk + +`func (o *User) GetLastLoginAtOk() (*time.Time, bool)` + +GetLastLoginAtOk returns a tuple with the LastLoginAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastLoginAt + +`func (o *User) SetLastLoginAt(v time.Time)` + +SetLastLoginAt sets LastLoginAt field to given value. + +### HasLastLoginAt + +`func (o *User) HasLastLoginAt() bool` + +HasLastLoginAt returns a boolean if a field has been set. + +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetMaxOrganizations + +`func (o *User) GetMaxOrganizations() int32` + +GetMaxOrganizations returns the MaxOrganizations field if non-nil, zero value otherwise. + +### GetMaxOrganizationsOk + +`func (o *User) GetMaxOrganizationsOk() (*int32, bool)` + +GetMaxOrganizationsOk returns a tuple with the MaxOrganizations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxOrganizations + +`func (o *User) SetMaxOrganizations(v int32)` + +SetMaxOrganizations sets MaxOrganizations field to given value. + +### HasMaxOrganizations + +`func (o *User) HasMaxOrganizations() bool` + +HasMaxOrganizations returns a boolean if a field has been set. + +### GetMaxProjects + +`func (o *User) GetMaxProjects() int32` + +GetMaxProjects returns the MaxProjects field if non-nil, zero value otherwise. + +### GetMaxProjectsOk + +`func (o *User) GetMaxProjectsOk() (*int32, bool)` + +GetMaxProjectsOk returns a tuple with the MaxProjects field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxProjects + +`func (o *User) SetMaxProjects(v int32)` + +SetMaxProjects sets MaxProjects field to given value. + +### HasMaxProjects + +`func (o *User) HasMaxProjects() bool` + +HasMaxProjects returns a boolean if a field has been set. + +### GetPhoneNumber + +`func (o *User) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *User) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *User) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *User) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### GetShortId + +`func (o *User) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *User) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *User) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + +### HasShortId + +`func (o *User) HasShortId() bool` + +HasShortId returns a boolean if a field has been set. + +### GetTimezone + +`func (o *User) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *User) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *User) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *User) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + +### GetTwoFactorAuth + +`func (o *User) GetTwoFactorAuth() string` + +GetTwoFactorAuth returns the TwoFactorAuth field if non-nil, zero value otherwise. + +### GetTwoFactorAuthOk + +`func (o *User) GetTwoFactorAuthOk() (*string, bool)` + +GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwoFactorAuth + +`func (o *User) SetTwoFactorAuth(v string)` + +SetTwoFactorAuth sets TwoFactorAuth field to given value. + +### HasTwoFactorAuth + +`func (o *User) HasTwoFactorAuth() bool` + +HasTwoFactorAuth returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *User) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *User) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *User) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *User) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserCreateInput.md b/services/metalv1/docs/UserCreateInput.md new file mode 100644 index 00000000..49efa769 --- /dev/null +++ b/services/metalv1/docs/UserCreateInput.md @@ -0,0 +1,457 @@ +# UserCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Avatar** | Pointer to ***os.File** | | [optional] +**CompanyName** | Pointer to **string** | | [optional] +**CompanyUrl** | Pointer to **string** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Emails** | [**[]EmailInput**](EmailInput.md) | | +**FirstName** | **string** | | +**LastName** | **string** | | +**Level** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**PhoneNumber** | Pointer to **string** | | [optional] +**SocialAccounts** | Pointer to **map[string]interface{}** | | [optional] +**Timezone** | Pointer to **string** | | [optional] +**Title** | Pointer to **string** | | [optional] +**TwoFactorAuth** | Pointer to **string** | | [optional] +**VerifiedAt** | Pointer to **time.Time** | | [optional] +**InvitationId** | Pointer to **string** | | [optional] +**Nonce** | Pointer to **string** | | [optional] + +## Methods + +### NewUserCreateInput + +`func NewUserCreateInput(emails []EmailInput, firstName string, lastName string, ) *UserCreateInput` + +NewUserCreateInput instantiates a new UserCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserCreateInputWithDefaults + +`func NewUserCreateInputWithDefaults() *UserCreateInput` + +NewUserCreateInputWithDefaults instantiates a new UserCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatar + +`func (o *UserCreateInput) GetAvatar() *os.File` + +GetAvatar returns the Avatar field if non-nil, zero value otherwise. + +### GetAvatarOk + +`func (o *UserCreateInput) GetAvatarOk() (**os.File, bool)` + +GetAvatarOk returns a tuple with the Avatar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatar + +`func (o *UserCreateInput) SetAvatar(v *os.File)` + +SetAvatar sets Avatar field to given value. + +### HasAvatar + +`func (o *UserCreateInput) HasAvatar() bool` + +HasAvatar returns a boolean if a field has been set. + +### GetCompanyName + +`func (o *UserCreateInput) GetCompanyName() string` + +GetCompanyName returns the CompanyName field if non-nil, zero value otherwise. + +### GetCompanyNameOk + +`func (o *UserCreateInput) GetCompanyNameOk() (*string, bool)` + +GetCompanyNameOk returns a tuple with the CompanyName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompanyName + +`func (o *UserCreateInput) SetCompanyName(v string)` + +SetCompanyName sets CompanyName field to given value. + +### HasCompanyName + +`func (o *UserCreateInput) HasCompanyName() bool` + +HasCompanyName returns a boolean if a field has been set. + +### GetCompanyUrl + +`func (o *UserCreateInput) GetCompanyUrl() string` + +GetCompanyUrl returns the CompanyUrl field if non-nil, zero value otherwise. + +### GetCompanyUrlOk + +`func (o *UserCreateInput) GetCompanyUrlOk() (*string, bool)` + +GetCompanyUrlOk returns a tuple with the CompanyUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompanyUrl + +`func (o *UserCreateInput) SetCompanyUrl(v string)` + +SetCompanyUrl sets CompanyUrl field to given value. + +### HasCompanyUrl + +`func (o *UserCreateInput) HasCompanyUrl() bool` + +HasCompanyUrl returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *UserCreateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *UserCreateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *UserCreateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *UserCreateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetEmails + +`func (o *UserCreateInput) GetEmails() []EmailInput` + +GetEmails returns the Emails field if non-nil, zero value otherwise. + +### GetEmailsOk + +`func (o *UserCreateInput) GetEmailsOk() (*[]EmailInput, bool)` + +GetEmailsOk returns a tuple with the Emails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmails + +`func (o *UserCreateInput) SetEmails(v []EmailInput)` + +SetEmails sets Emails field to given value. + + +### GetFirstName + +`func (o *UserCreateInput) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *UserCreateInput) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *UserCreateInput) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + + +### GetLastName + +`func (o *UserCreateInput) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *UserCreateInput) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *UserCreateInput) SetLastName(v string)` + +SetLastName sets LastName field to given value. + + +### GetLevel + +`func (o *UserCreateInput) GetLevel() string` + +GetLevel returns the Level field if non-nil, zero value otherwise. + +### GetLevelOk + +`func (o *UserCreateInput) GetLevelOk() (*string, bool)` + +GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLevel + +`func (o *UserCreateInput) SetLevel(v string)` + +SetLevel sets Level field to given value. + +### HasLevel + +`func (o *UserCreateInput) HasLevel() bool` + +HasLevel returns a boolean if a field has been set. + +### GetPassword + +`func (o *UserCreateInput) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *UserCreateInput) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *UserCreateInput) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *UserCreateInput) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetPhoneNumber + +`func (o *UserCreateInput) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *UserCreateInput) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *UserCreateInput) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *UserCreateInput) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### GetSocialAccounts + +`func (o *UserCreateInput) GetSocialAccounts() map[string]interface{}` + +GetSocialAccounts returns the SocialAccounts field if non-nil, zero value otherwise. + +### GetSocialAccountsOk + +`func (o *UserCreateInput) GetSocialAccountsOk() (*map[string]interface{}, bool)` + +GetSocialAccountsOk returns a tuple with the SocialAccounts field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSocialAccounts + +`func (o *UserCreateInput) SetSocialAccounts(v map[string]interface{})` + +SetSocialAccounts sets SocialAccounts field to given value. + +### HasSocialAccounts + +`func (o *UserCreateInput) HasSocialAccounts() bool` + +HasSocialAccounts returns a boolean if a field has been set. + +### GetTimezone + +`func (o *UserCreateInput) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *UserCreateInput) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *UserCreateInput) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *UserCreateInput) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + +### GetTitle + +`func (o *UserCreateInput) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *UserCreateInput) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *UserCreateInput) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *UserCreateInput) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### GetTwoFactorAuth + +`func (o *UserCreateInput) GetTwoFactorAuth() string` + +GetTwoFactorAuth returns the TwoFactorAuth field if non-nil, zero value otherwise. + +### GetTwoFactorAuthOk + +`func (o *UserCreateInput) GetTwoFactorAuthOk() (*string, bool)` + +GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTwoFactorAuth + +`func (o *UserCreateInput) SetTwoFactorAuth(v string)` + +SetTwoFactorAuth sets TwoFactorAuth field to given value. + +### HasTwoFactorAuth + +`func (o *UserCreateInput) HasTwoFactorAuth() bool` + +HasTwoFactorAuth returns a boolean if a field has been set. + +### GetVerifiedAt + +`func (o *UserCreateInput) GetVerifiedAt() time.Time` + +GetVerifiedAt returns the VerifiedAt field if non-nil, zero value otherwise. + +### GetVerifiedAtOk + +`func (o *UserCreateInput) GetVerifiedAtOk() (*time.Time, bool)` + +GetVerifiedAtOk returns a tuple with the VerifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVerifiedAt + +`func (o *UserCreateInput) SetVerifiedAt(v time.Time)` + +SetVerifiedAt sets VerifiedAt field to given value. + +### HasVerifiedAt + +`func (o *UserCreateInput) HasVerifiedAt() bool` + +HasVerifiedAt returns a boolean if a field has been set. + +### GetInvitationId + +`func (o *UserCreateInput) GetInvitationId() string` + +GetInvitationId returns the InvitationId field if non-nil, zero value otherwise. + +### GetInvitationIdOk + +`func (o *UserCreateInput) GetInvitationIdOk() (*string, bool)` + +GetInvitationIdOk returns a tuple with the InvitationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvitationId + +`func (o *UserCreateInput) SetInvitationId(v string)` + +SetInvitationId sets InvitationId field to given value. + +### HasInvitationId + +`func (o *UserCreateInput) HasInvitationId() bool` + +HasInvitationId returns a boolean if a field has been set. + +### GetNonce + +`func (o *UserCreateInput) GetNonce() string` + +GetNonce returns the Nonce field if non-nil, zero value otherwise. + +### GetNonceOk + +`func (o *UserCreateInput) GetNonceOk() (*string, bool)` + +GetNonceOk returns a tuple with the Nonce field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonce + +`func (o *UserCreateInput) SetNonce(v string)` + +SetNonce sets Nonce field to given value. + +### HasNonce + +`func (o *UserCreateInput) HasNonce() bool` + +HasNonce returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserLimited.md b/services/metalv1/docs/UserLimited.md new file mode 100644 index 00000000..2a888143 --- /dev/null +++ b/services/metalv1/docs/UserLimited.md @@ -0,0 +1,155 @@ +# UserLimited + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvatarThumbUrl** | Pointer to **string** | Avatar thumbnail URL of the User | [optional] +**AvatarUrl** | Pointer to **string** | Avatar URL of the User | [optional] +**FullName** | Pointer to **string** | Full name of the User | [optional] +**Href** | Pointer to **string** | API URL uniquely representing the User | [optional] +**Id** | **string** | ID of the User | + +## Methods + +### NewUserLimited + +`func NewUserLimited(id string, ) *UserLimited` + +NewUserLimited instantiates a new UserLimited object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserLimitedWithDefaults + +`func NewUserLimitedWithDefaults() *UserLimited` + +NewUserLimitedWithDefaults instantiates a new UserLimited object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatarThumbUrl + +`func (o *UserLimited) GetAvatarThumbUrl() string` + +GetAvatarThumbUrl returns the AvatarThumbUrl field if non-nil, zero value otherwise. + +### GetAvatarThumbUrlOk + +`func (o *UserLimited) GetAvatarThumbUrlOk() (*string, bool)` + +GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarThumbUrl + +`func (o *UserLimited) SetAvatarThumbUrl(v string)` + +SetAvatarThumbUrl sets AvatarThumbUrl field to given value. + +### HasAvatarThumbUrl + +`func (o *UserLimited) HasAvatarThumbUrl() bool` + +HasAvatarThumbUrl returns a boolean if a field has been set. + +### GetAvatarUrl + +`func (o *UserLimited) GetAvatarUrl() string` + +GetAvatarUrl returns the AvatarUrl field if non-nil, zero value otherwise. + +### GetAvatarUrlOk + +`func (o *UserLimited) GetAvatarUrlOk() (*string, bool)` + +GetAvatarUrlOk returns a tuple with the AvatarUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarUrl + +`func (o *UserLimited) SetAvatarUrl(v string)` + +SetAvatarUrl sets AvatarUrl field to given value. + +### HasAvatarUrl + +`func (o *UserLimited) HasAvatarUrl() bool` + +HasAvatarUrl returns a boolean if a field has been set. + +### GetFullName + +`func (o *UserLimited) GetFullName() string` + +GetFullName returns the FullName field if non-nil, zero value otherwise. + +### GetFullNameOk + +`func (o *UserLimited) GetFullNameOk() (*string, bool)` + +GetFullNameOk returns a tuple with the FullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFullName + +`func (o *UserLimited) SetFullName(v string)` + +SetFullName sets FullName field to given value. + +### HasFullName + +`func (o *UserLimited) HasFullName() bool` + +HasFullName returns a boolean if a field has been set. + +### GetHref + +`func (o *UserLimited) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *UserLimited) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *UserLimited) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *UserLimited) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *UserLimited) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UserLimited) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UserLimited) SetId(v string)` + +SetId sets Id field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserList.md b/services/metalv1/docs/UserList.md new file mode 100644 index 00000000..70192636 --- /dev/null +++ b/services/metalv1/docs/UserList.md @@ -0,0 +1,82 @@ +# UserList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] +**Users** | Pointer to [**[]User**](User.md) | | [optional] + +## Methods + +### NewUserList + +`func NewUserList() *UserList` + +NewUserList instantiates a new UserList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserListWithDefaults + +`func NewUserListWithDefaults() *UserList` + +NewUserListWithDefaults instantiates a new UserList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMeta + +`func (o *UserList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *UserList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *UserList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *UserList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetUsers + +`func (o *UserList) GetUsers() []User` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *UserList) GetUsersOk() (*[]User, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *UserList) SetUsers(v []User)` + +SetUsers sets Users field to given value. + +### HasUsers + +`func (o *UserList) HasUsers() bool` + +HasUsers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserLite.md b/services/metalv1/docs/UserLite.md new file mode 100644 index 00000000..adb20086 --- /dev/null +++ b/services/metalv1/docs/UserLite.md @@ -0,0 +1,280 @@ +# UserLite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AvatarThumbUrl** | Pointer to **string** | Avatar thumbnail URL of the User | [optional] +**CreatedAt** | Pointer to **time.Time** | When the user was created | [optional] +**Email** | Pointer to **string** | Primary email address of the User | [optional] +**FirstName** | Pointer to **string** | First name of the User | [optional] +**FullName** | Pointer to **string** | Full name of the User | [optional] +**Href** | Pointer to **string** | API URL uniquely representing the User | [optional] +**Id** | **string** | ID of the User | +**LastName** | Pointer to **string** | Last name of the User | [optional] +**ShortId** | **string** | Short ID of the User | +**UpdatedAt** | Pointer to **time.Time** | When the user details were last updated | [optional] + +## Methods + +### NewUserLite + +`func NewUserLite(id string, shortId string, ) *UserLite` + +NewUserLite instantiates a new UserLite object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserLiteWithDefaults + +`func NewUserLiteWithDefaults() *UserLite` + +NewUserLiteWithDefaults instantiates a new UserLite object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAvatarThumbUrl + +`func (o *UserLite) GetAvatarThumbUrl() string` + +GetAvatarThumbUrl returns the AvatarThumbUrl field if non-nil, zero value otherwise. + +### GetAvatarThumbUrlOk + +`func (o *UserLite) GetAvatarThumbUrlOk() (*string, bool)` + +GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvatarThumbUrl + +`func (o *UserLite) SetAvatarThumbUrl(v string)` + +SetAvatarThumbUrl sets AvatarThumbUrl field to given value. + +### HasAvatarThumbUrl + +`func (o *UserLite) HasAvatarThumbUrl() bool` + +HasAvatarThumbUrl returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *UserLite) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *UserLite) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *UserLite) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *UserLite) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetEmail + +`func (o *UserLite) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *UserLite) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *UserLite) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *UserLite) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetFirstName + +`func (o *UserLite) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *UserLite) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *UserLite) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *UserLite) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetFullName + +`func (o *UserLite) GetFullName() string` + +GetFullName returns the FullName field if non-nil, zero value otherwise. + +### GetFullNameOk + +`func (o *UserLite) GetFullNameOk() (*string, bool)` + +GetFullNameOk returns a tuple with the FullName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFullName + +`func (o *UserLite) SetFullName(v string)` + +SetFullName sets FullName field to given value. + +### HasFullName + +`func (o *UserLite) HasFullName() bool` + +HasFullName returns a boolean if a field has been set. + +### GetHref + +`func (o *UserLite) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *UserLite) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *UserLite) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *UserLite) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *UserLite) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UserLite) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UserLite) SetId(v string)` + +SetId sets Id field to given value. + + +### GetLastName + +`func (o *UserLite) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *UserLite) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *UserLite) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *UserLite) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetShortId + +`func (o *UserLite) GetShortId() string` + +GetShortId returns the ShortId field if non-nil, zero value otherwise. + +### GetShortIdOk + +`func (o *UserLite) GetShortIdOk() (*string, bool)` + +GetShortIdOk returns a tuple with the ShortId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortId + +`func (o *UserLite) SetShortId(v string)` + +SetShortId sets ShortId field to given value. + + +### GetUpdatedAt + +`func (o *UserLite) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *UserLite) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *UserLite) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *UserLite) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserUpdateInput.md b/services/metalv1/docs/UserUpdateInput.md new file mode 100644 index 00000000..37f081b7 --- /dev/null +++ b/services/metalv1/docs/UserUpdateInput.md @@ -0,0 +1,186 @@ +# UserUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**PhoneNumber** | Pointer to **string** | | [optional] +**Timezone** | Pointer to **string** | | [optional] + +## Methods + +### NewUserUpdateInput + +`func NewUserUpdateInput() *UserUpdateInput` + +NewUserUpdateInput instantiates a new UserUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserUpdateInputWithDefaults + +`func NewUserUpdateInputWithDefaults() *UserUpdateInput` + +NewUserUpdateInputWithDefaults instantiates a new UserUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomdata + +`func (o *UserUpdateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *UserUpdateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *UserUpdateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *UserUpdateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetFirstName + +`func (o *UserUpdateInput) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *UserUpdateInput) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *UserUpdateInput) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *UserUpdateInput) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastName + +`func (o *UserUpdateInput) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *UserUpdateInput) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *UserUpdateInput) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *UserUpdateInput) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetPassword + +`func (o *UserUpdateInput) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *UserUpdateInput) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *UserUpdateInput) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *UserUpdateInput) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### GetPhoneNumber + +`func (o *UserUpdateInput) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *UserUpdateInput) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *UserUpdateInput) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *UserUpdateInput) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### GetTimezone + +`func (o *UserUpdateInput) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *UserUpdateInput) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *UserUpdateInput) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *UserUpdateInput) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserVerificationTokensApi.md b/services/metalv1/docs/UserVerificationTokensApi.md new file mode 100644 index 00000000..20d4766c --- /dev/null +++ b/services/metalv1/docs/UserVerificationTokensApi.md @@ -0,0 +1,142 @@ +# \UserVerificationTokensApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ConsumeVerificationRequest**](UserVerificationTokensApi.md#ConsumeVerificationRequest) | **Put** /verify-email | Verify a user using an email verification token +[**CreateValidationRequest**](UserVerificationTokensApi.md#CreateValidationRequest) | **Post** /verify-email | Create an email verification request + + + +## ConsumeVerificationRequest + +> ConsumeVerificationRequest(ctx).VerifyEmail(verifyEmail).Include(include).Execute() + +Verify a user using an email verification token + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + verifyEmail := *openapiclient.NewVerifyEmail("UserToken_example") // VerifyEmail | Email to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserVerificationTokensApi.ConsumeVerificationRequest(context.Background()).VerifyEmail(verifyEmail).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserVerificationTokensApi.ConsumeVerificationRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiConsumeVerificationRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **verifyEmail** | [**VerifyEmail**](VerifyEmail.md) | Email to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateValidationRequest + +> CreateValidationRequest(ctx).Login(login).Include(include).Execute() + +Create an email verification request + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + login := "login_example" // string | Email for verification request + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserVerificationTokensApi.CreateValidationRequest(context.Background()).Login(login).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserVerificationTokensApi.CreateValidationRequest``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateValidationRequestRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **login** | **string** | Email for verification request | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/Userdata.md b/services/metalv1/docs/Userdata.md new file mode 100644 index 00000000..87c2e4b7 --- /dev/null +++ b/services/metalv1/docs/Userdata.md @@ -0,0 +1,56 @@ +# Userdata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Userdata** | Pointer to **string** | | [optional] + +## Methods + +### NewUserdata + +`func NewUserdata() *Userdata` + +NewUserdata instantiates a new Userdata object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserdataWithDefaults + +`func NewUserdataWithDefaults() *Userdata` + +NewUserdataWithDefaults instantiates a new Userdata object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUserdata + +`func (o *Userdata) GetUserdata() string` + +GetUserdata returns the Userdata field if non-nil, zero value otherwise. + +### GetUserdataOk + +`func (o *Userdata) GetUserdataOk() (*string, bool)` + +GetUserdataOk returns a tuple with the Userdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserdata + +`func (o *Userdata) SetUserdata(v string)` + +SetUserdata sets Userdata field to given value. + +### HasUserdata + +`func (o *Userdata) HasUserdata() bool` + +HasUserdata returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/UserdataApi.md b/services/metalv1/docs/UserdataApi.md new file mode 100644 index 00000000..2a954e13 --- /dev/null +++ b/services/metalv1/docs/UserdataApi.md @@ -0,0 +1,73 @@ +# \UserdataApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ValidateUserdata**](UserdataApi.md#ValidateUserdata) | **Post** /userdata/validate | Validate user data + + + +## ValidateUserdata + +> ValidateUserdata(ctx).Userdata(userdata).Execute() + +Validate user data + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + userdata := "userdata_example" // string | Userdata to validate (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserdataApi.ValidateUserdata(context.Background()).Userdata(userdata).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserdataApi.ValidateUserdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiValidateUserdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userdata** | **string** | Userdata to validate | + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/UsersApi.md b/services/metalv1/docs/UsersApi.md new file mode 100644 index 00000000..2e851c39 --- /dev/null +++ b/services/metalv1/docs/UsersApi.md @@ -0,0 +1,508 @@ +# \UsersApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UsersApi.md#CreateUser) | **Post** /users | Create a user +[**FindCurrentUser**](UsersApi.md#FindCurrentUser) | **Get** /user | Retrieve the current user +[**FindInvitations**](UsersApi.md#FindInvitations) | **Get** /invitations | Retrieve current user invitations +[**FindUserById**](UsersApi.md#FindUserById) | **Get** /users/{id} | Retrieve a user +[**FindUserCustomdata**](UsersApi.md#FindUserCustomdata) | **Get** /users/{id}/customdata | Retrieve the custom metadata of a user +[**FindUsers**](UsersApi.md#FindUsers) | **Get** /users | Retrieve all users +[**UpdateCurrentUser**](UsersApi.md#UpdateCurrentUser) | **Put** /user | Update the current user + + + +## CreateUser + +> User CreateUser(ctx).UserCreateInput(userCreateInput).Include(include).Exclude(exclude).Execute() + +Create a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + userCreateInput := *openapiclient.NewUserCreateInput([]openapiclient.EmailInput{*openapiclient.NewEmailInput("Address_example")}, "FirstName_example", "LastName_example") // UserCreateInput | User to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.CreateUser(context.Background()).UserCreateInput(userCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.CreateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateUser`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.CreateUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userCreateInput** | [**UserCreateInput**](UserCreateInput.md) | User to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindCurrentUser + +> User FindCurrentUser(ctx).Include(include).Exclude(exclude).Execute() + +Retrieve the current user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.FindCurrentUser(context.Background()).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.FindCurrentUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindCurrentUser`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.FindCurrentUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindCurrentUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindInvitations + +> InvitationList FindInvitations(ctx).Include(include).Page(page).PerPage(perPage).Execute() + +Retrieve current user invitations + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.FindInvitations(context.Background()).Include(include).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.FindInvitations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindInvitations`: InvitationList + fmt.Fprintf(os.Stdout, "Response from `UsersApi.FindInvitations`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindInvitationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**InvitationList**](InvitationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindUserById + +> User FindUserById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | User UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.FindUserById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.FindUserById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindUserById`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.FindUserById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | User UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindUserByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindUserCustomdata + +> FindUserCustomdata(ctx, id).Execute() + +Retrieve the custom metadata of a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | User UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UsersApi.FindUserCustomdata(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.FindUserCustomdata``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | User UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindUserCustomdataRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindUsers + +> UserList FindUsers(ctx).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + +Retrieve all users + + +FindUsers is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + page := int32(56) // int32 | Page to return (optional) (default to 1) + perPage := int32(56) // int32 | Items returned per page (optional) (default to 10) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.FindUsers(context.Background()).Include(include).Exclude(exclude).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.FindUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindUsers`: UserList + fmt.Fprintf(os.Stdout, "Response from `UsersApi.FindUsers`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindUsersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **page** | **int32** | Page to return | [default to 1] + **perPage** | **int32** | Items returned per page | [default to 10] + +### Return type + +[**UserList**](UserList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateCurrentUser + +> User UpdateCurrentUser(ctx).UserUpdateInput(userUpdateInput).Include(include).Exclude(exclude).Execute() + +Update the current user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + userUpdateInput := *openapiclient.NewUserUpdateInput() // UserUpdateInput | User to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.UpdateCurrentUser(context.Background()).UserUpdateInput(userUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.UpdateCurrentUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateCurrentUser`: User + fmt.Fprintf(os.Stdout, "Response from `UsersApi.UpdateCurrentUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateCurrentUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userUpdateInput** | [**UserUpdateInput**](UserUpdateInput.md) | User to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**User**](User.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/VLANsApi.md b/services/metalv1/docs/VLANsApi.md new file mode 100644 index 00000000..2060ed57 --- /dev/null +++ b/services/metalv1/docs/VLANsApi.md @@ -0,0 +1,314 @@ +# \VLANsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateVirtualNetwork**](VLANsApi.md#CreateVirtualNetwork) | **Post** /projects/{id}/virtual-networks | Create a virtual network +[**DeleteVirtualNetwork**](VLANsApi.md#DeleteVirtualNetwork) | **Delete** /virtual-networks/{id} | Delete a virtual network +[**FindVirtualNetworks**](VLANsApi.md#FindVirtualNetworks) | **Get** /projects/{id}/virtual-networks | Retrieve all virtual networks +[**GetVirtualNetwork**](VLANsApi.md#GetVirtualNetwork) | **Get** /virtual-networks/{id} | Get a virtual network + + + +## CreateVirtualNetwork + +> VirtualNetwork CreateVirtualNetwork(ctx, id).VirtualNetworkCreateInput(virtualNetworkCreateInput).Include(include).Exclude(exclude).Execute() + +Create a virtual network + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + virtualNetworkCreateInput := *openapiclient.NewVirtualNetworkCreateInput() // VirtualNetworkCreateInput | Virtual Network to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VLANsApi.CreateVirtualNetwork(context.Background(), id).VirtualNetworkCreateInput(virtualNetworkCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VLANsApi.CreateVirtualNetwork``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateVirtualNetwork`: VirtualNetwork + fmt.Fprintf(os.Stdout, "Response from `VLANsApi.CreateVirtualNetwork`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVirtualNetworkRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **virtualNetworkCreateInput** | [**VirtualNetworkCreateInput**](VirtualNetworkCreateInput.md) | Virtual Network to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteVirtualNetwork + +> VirtualNetwork DeleteVirtualNetwork(ctx, id).Include(include).Exclude(exclude).Execute() + +Delete a virtual network + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Network UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VLANsApi.DeleteVirtualNetwork(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VLANsApi.DeleteVirtualNetwork``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteVirtualNetwork`: VirtualNetwork + fmt.Fprintf(os.Stdout, "Response from `VLANsApi.DeleteVirtualNetwork`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Network UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteVirtualNetworkRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVirtualNetworks + +> VirtualNetworkList FindVirtualNetworks(ctx, id).Include(include).Exclude(exclude).Facility(facility).Metro(metro).Execute() + +Retrieve all virtual networks + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + facility := "facility_example" // string | Filter by Facility ID (uuid) or Facility Code (optional) + metro := "metro_example" // string | Filter by Metro ID (uuid) or Metro Code (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VLANsApi.FindVirtualNetworks(context.Background(), id).Include(include).Exclude(exclude).Facility(facility).Metro(metro).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VLANsApi.FindVirtualNetworks``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVirtualNetworks`: VirtualNetworkList + fmt.Fprintf(os.Stdout, "Response from `VLANsApi.FindVirtualNetworks`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVirtualNetworksRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **facility** | **string** | Filter by Facility ID (uuid) or Facility Code | + **metro** | **string** | Filter by Metro ID (uuid) or Metro Code | + +### Return type + +[**VirtualNetworkList**](VirtualNetworkList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVirtualNetwork + +> VirtualNetwork GetVirtualNetwork(ctx, id).Include(include).Exclude(exclude).Execute() + +Get a virtual network + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Virtual Network UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VLANsApi.GetVirtualNetwork(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VLANsApi.GetVirtualNetwork``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVirtualNetwork`: VirtualNetwork + fmt.Fprintf(os.Stdout, "Response from `VLANsApi.GetVirtualNetwork`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Virtual Network UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVirtualNetworkRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VirtualNetwork**](VirtualNetwork.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/VRFsApi.md b/services/metalv1/docs/VRFsApi.md new file mode 100644 index 00000000..e575d122 --- /dev/null +++ b/services/metalv1/docs/VRFsApi.md @@ -0,0 +1,1217 @@ +# \VRFsApi + +All URIs are relative to *https://api.equinix.com/metal/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**BgpDynamicNeighborsIdGet**](VRFsApi.md#BgpDynamicNeighborsIdGet) | **Get** /bgp-dynamic-neighbors/{id} | Retrieve a BGP Dynamic Neighbor +[**CreateBgpDynamicNeighbor**](VRFsApi.md#CreateBgpDynamicNeighbor) | **Post** /metal-gateways/{id}/bgp-dynamic-neighbors | Create a VRF BGP Dynamic Neighbor range +[**CreateVrf**](VRFsApi.md#CreateVrf) | **Post** /projects/{id}/vrfs | Create a new VRF in the specified project +[**CreateVrfRoute**](VRFsApi.md#CreateVrfRoute) | **Post** /vrfs/{id}/routes | Create a VRF route +[**DeleteBgpDynamicNeighborById**](VRFsApi.md#DeleteBgpDynamicNeighborById) | **Delete** /bgp-dynamic-neighbors/{id} | Delete a VRF BGP Dynamic Neighbor +[**DeleteVrf**](VRFsApi.md#DeleteVrf) | **Delete** /vrfs/{id} | Delete the VRF +[**DeleteVrfRouteById**](VRFsApi.md#DeleteVrfRouteById) | **Delete** /routes/{id} | Delete a VRF Route +[**FindVrfById**](VRFsApi.md#FindVrfById) | **Get** /vrfs/{id} | Retrieve a VRF +[**FindVrfIpReservation**](VRFsApi.md#FindVrfIpReservation) | **Get** /vrfs/{vrf_id}/ips/{id} | Retrieve all VRF IP Reservations in the VRF +[**FindVrfIpReservations**](VRFsApi.md#FindVrfIpReservations) | **Get** /vrfs/{id}/ips | Retrieve all VRF IP Reservations in the VRF +[**FindVrfRouteById**](VRFsApi.md#FindVrfRouteById) | **Get** /routes/{id} | Retrieve a VRF Route +[**FindVrfs**](VRFsApi.md#FindVrfs) | **Get** /projects/{id}/vrfs | Retrieve all VRFs in the project +[**GetBgpDynamicNeighbors**](VRFsApi.md#GetBgpDynamicNeighbors) | **Get** /metal-gateways/{id}/bgp-dynamic-neighbors | List BGP Dynamic Neighbors +[**GetVrfRoutes**](VRFsApi.md#GetVrfRoutes) | **Get** /vrfs/{id}/routes | Retrieve all routes in the VRF +[**UpdateVrf**](VRFsApi.md#UpdateVrf) | **Put** /vrfs/{id} | Update the VRF +[**UpdateVrfRouteById**](VRFsApi.md#UpdateVrfRouteById) | **Put** /routes/{id} | Update a VRF Route + + + +## BgpDynamicNeighborsIdGet + +> BgpDynamicNeighbor BgpDynamicNeighborsIdGet(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a BGP Dynamic Neighbor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | BGP Dynamic Neighbor UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.BgpDynamicNeighborsIdGet(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.BgpDynamicNeighborsIdGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BgpDynamicNeighborsIdGet`: BgpDynamicNeighbor + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.BgpDynamicNeighborsIdGet`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | BGP Dynamic Neighbor UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiBgpDynamicNeighborsIdGetRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateBgpDynamicNeighbor + +> BgpDynamicNeighbor CreateBgpDynamicNeighbor(ctx, id).BgpDynamicNeighborCreateInput(bgpDynamicNeighborCreateInput).Include(include).Exclude(exclude).Execute() + +Create a VRF BGP Dynamic Neighbor range + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + bgpDynamicNeighborCreateInput := *openapiclient.NewBgpDynamicNeighborCreateInput("192.168.1.0/25", int32(12345)) // BgpDynamicNeighborCreateInput | + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.CreateBgpDynamicNeighbor(context.Background(), id).BgpDynamicNeighborCreateInput(bgpDynamicNeighborCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.CreateBgpDynamicNeighbor``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateBgpDynamicNeighbor`: BgpDynamicNeighbor + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.CreateBgpDynamicNeighbor`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateBgpDynamicNeighborRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **bgpDynamicNeighborCreateInput** | [**BgpDynamicNeighborCreateInput**](BgpDynamicNeighborCreateInput.md) | | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateVrf + +> Vrf CreateVrf(ctx, id).VrfCreateInput(vrfCreateInput).Include(include).Exclude(exclude).Execute() + +Create a new VRF in the specified project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + vrfCreateInput := *openapiclient.NewVrfCreateInput("Metro_example", "Name_example") // VrfCreateInput | VRF to create + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.CreateVrf(context.Background(), id).VrfCreateInput(vrfCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.CreateVrf``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateVrf`: Vrf + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.CreateVrf`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVrfRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **vrfCreateInput** | [**VrfCreateInput**](VrfCreateInput.md) | VRF to create | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateVrfRoute + +> VrfRoute CreateVrfRoute(ctx, id).VrfRouteCreateInput(vrfRouteCreateInput).Include(include).Exclude(exclude).Execute() + +Create a VRF route + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + vrfRouteCreateInput := *openapiclient.NewVrfRouteCreateInput("0.0.0.0/0", "192.168.1.254") // VrfRouteCreateInput | + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.CreateVrfRoute(context.Background(), id).VrfRouteCreateInput(vrfRouteCreateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.CreateVrfRoute``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateVrfRoute`: VrfRoute + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.CreateVrfRoute`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVrfRouteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **vrfRouteCreateInput** | [**VrfRouteCreateInput**](VrfRouteCreateInput.md) | | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteBgpDynamicNeighborById + +> BgpDynamicNeighbor DeleteBgpDynamicNeighborById(ctx, id).Include(include).Exclude(exclude).Execute() + +Delete a VRF BGP Dynamic Neighbor + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | BGP Dynamic Neighbor UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.DeleteBgpDynamicNeighborById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.DeleteBgpDynamicNeighborById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteBgpDynamicNeighborById`: BgpDynamicNeighbor + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.DeleteBgpDynamicNeighborById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | BGP Dynamic Neighbor UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteBgpDynamicNeighborByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**BgpDynamicNeighbor**](BgpDynamicNeighbor.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteVrf + +> DeleteVrf(ctx, id).Execute() + +Delete the VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.VRFsApi.DeleteVrf(context.Background(), id).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.DeleteVrf``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteVrfRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteVrfRouteById + +> VrfRoute DeleteVrfRouteById(ctx, id).Include(include).Exclude(exclude).Execute() + +Delete a VRF Route + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF Route UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.DeleteVrfRouteById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.DeleteVrfRouteById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteVrfRouteById`: VrfRoute + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.DeleteVrfRouteById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF Route UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteVrfRouteByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfById + +> Vrf FindVrfById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.FindVrfById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.FindVrfById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfById`: Vrf + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.FindVrfById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfIpReservation + +> VrfIpReservation FindVrfIpReservation(ctx, vrfId, id).Include(include).Exclude(exclude).Execute() + +Retrieve all VRF IP Reservations in the VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + vrfId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | IP UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.FindVrfIpReservation(context.Background(), vrfId, id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.FindVrfIpReservation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfIpReservation`: VrfIpReservation + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.FindVrfIpReservation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vrfId** | **string** | VRF UUID | +**id** | **string** | IP UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfIpReservationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfIpReservation**](VrfIpReservation.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfIpReservations + +> VrfIpReservationList FindVrfIpReservations(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all VRF IP Reservations in the VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.FindVrfIpReservations(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.FindVrfIpReservations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfIpReservations`: VrfIpReservationList + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.FindVrfIpReservations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfIpReservationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfIpReservationList**](VrfIpReservationList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfRouteById + +> VrfRoute FindVrfRouteById(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve a VRF Route + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF Route UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.FindVrfRouteById(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.FindVrfRouteById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfRouteById`: VrfRoute + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.FindVrfRouteById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF Route UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfRouteByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindVrfs + +> VrfList FindVrfs(ctx, id).Include(include).Exclude(exclude).Metro(metro).Execute() + +Retrieve all VRFs in the project + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Project UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + metro := "metro_example" // string | Filter by Metro ID (uuid) or Metro Code (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.FindVrfs(context.Background(), id).Include(include).Exclude(exclude).Metro(metro).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.FindVrfs``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindVrfs`: VrfList + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.FindVrfs`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Project UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiFindVrfsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + **metro** | **string** | Filter by Metro ID (uuid) or Metro Code | + +### Return type + +[**VrfList**](VrfList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetBgpDynamicNeighbors + +> BgpDynamicNeighborList GetBgpDynamicNeighbors(ctx, id).Include(include).Exclude(exclude).Execute() + +List BGP Dynamic Neighbors + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | Metal Gateway UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.GetBgpDynamicNeighbors(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.GetBgpDynamicNeighbors``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetBgpDynamicNeighbors`: BgpDynamicNeighborList + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.GetBgpDynamicNeighbors`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Metal Gateway UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetBgpDynamicNeighborsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**BgpDynamicNeighborList**](BgpDynamicNeighborList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVrfRoutes + +> VrfRouteList GetVrfRoutes(ctx, id).Include(include).Exclude(exclude).Execute() + +Retrieve all routes in the VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.GetVrfRoutes(context.Background(), id).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.GetVrfRoutes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVrfRoutes`: VrfRouteList + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.GetVrfRoutes`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVrfRoutesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfRouteList**](VrfRouteList.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateVrf + +> Vrf UpdateVrf(ctx, id).VrfUpdateInput(vrfUpdateInput).Include(include).Exclude(exclude).Execute() + +Update the VRF + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF UUID + vrfUpdateInput := *openapiclient.NewVrfUpdateInput() // VrfUpdateInput | VRF to update + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.UpdateVrf(context.Background(), id).VrfUpdateInput(vrfUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.UpdateVrf``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateVrf`: Vrf + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.UpdateVrf`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateVrfRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **vrfUpdateInput** | [**VrfUpdateInput**](VrfUpdateInput.md) | VRF to update | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**Vrf**](Vrf.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateVrfRouteById + +> VrfRoute UpdateVrfRouteById(ctx, id).VrfRouteUpdateInput(vrfRouteUpdateInput).Include(include).Exclude(exclude).Execute() + +Update a VRF Route + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" +) + +func main() { + id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | VRF Route UUID + vrfRouteUpdateInput := *openapiclient.NewVrfRouteUpdateInput() // VrfRouteUpdateInput | + include := []string{"Inner_example"} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional) + exclude := []string{"Inner_example"} // []string | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VRFsApi.UpdateVrfRouteById(context.Background(), id).VrfRouteUpdateInput(vrfRouteUpdateInput).Include(include).Exclude(exclude).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VRFsApi.UpdateVrfRouteById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateVrfRouteById`: VrfRoute + fmt.Fprintf(os.Stdout, "Response from `VRFsApi.UpdateVrfRouteById`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | VRF Route UUID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateVrfRouteByIdRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **vrfRouteUpdateInput** | [**VrfRouteUpdateInput**](VrfRouteUpdateInput.md) | | + **include** | **[]string** | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. | + **exclude** | **[]string** | Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects. | + +### Return type + +[**VrfRoute**](VrfRoute.md) + +### Authorization + +[x_auth_token](../README.md#x_auth_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/services/metalv1/docs/VerifyEmail.md b/services/metalv1/docs/VerifyEmail.md new file mode 100644 index 00000000..e62cc2ea --- /dev/null +++ b/services/metalv1/docs/VerifyEmail.md @@ -0,0 +1,51 @@ +# VerifyEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserToken** | **string** | User verification token | + +## Methods + +### NewVerifyEmail + +`func NewVerifyEmail(userToken string, ) *VerifyEmail` + +NewVerifyEmail instantiates a new VerifyEmail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVerifyEmailWithDefaults + +`func NewVerifyEmailWithDefaults() *VerifyEmail` + +NewVerifyEmailWithDefaults instantiates a new VerifyEmail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUserToken + +`func (o *VerifyEmail) GetUserToken() string` + +GetUserToken returns the UserToken field if non-nil, zero value otherwise. + +### GetUserTokenOk + +`func (o *VerifyEmail) GetUserTokenOk() (*string, bool)` + +GetUserTokenOk returns a tuple with the UserToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserToken + +`func (o *VerifyEmail) SetUserToken(v string)` + +SetUserToken sets UserToken field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualCircuit.md b/services/metalv1/docs/VirtualCircuit.md new file mode 100644 index 00000000..81e3739f --- /dev/null +++ b/services/metalv1/docs/VirtualCircuit.md @@ -0,0 +1,571 @@ +# VirtualCircuit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bill** | Pointer to **bool** | True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. | [optional] [default to false] +**Description** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**NniVlan** | Pointer to **int32** | | [optional] +**Port** | Pointer to [**Href**](Href.md) | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Speed** | Pointer to **int32** | integer representing bps speed | [optional] +**Status** | Pointer to [**VrfVirtualCircuitStatus**](VrfVirtualCircuitStatus.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | Pointer to [**VrfIpReservationType**](VrfIpReservationType.md) | | [optional] +**VirtualNetwork** | Pointer to [**Href**](Href.md) | | [optional] +**Vnid** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Md5** | Pointer to **string** | The MD5 password for the BGP peering in plaintext (not a checksum). | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**PeerAsn** | Pointer to **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**Subnet** | Pointer to **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**Vrf** | [**Vrf**](Vrf.md) | | + +## Methods + +### NewVirtualCircuit + +`func NewVirtualCircuit(vrf Vrf, ) *VirtualCircuit` + +NewVirtualCircuit instantiates a new VirtualCircuit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualCircuitWithDefaults + +`func NewVirtualCircuitWithDefaults() *VirtualCircuit` + +NewVirtualCircuitWithDefaults instantiates a new VirtualCircuit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBill + +`func (o *VirtualCircuit) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *VirtualCircuit) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *VirtualCircuit) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *VirtualCircuit) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetDescription + +`func (o *VirtualCircuit) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VirtualCircuit) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VirtualCircuit) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VirtualCircuit) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetId + +`func (o *VirtualCircuit) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VirtualCircuit) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VirtualCircuit) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VirtualCircuit) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *VirtualCircuit) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VirtualCircuit) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VirtualCircuit) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VirtualCircuit) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VirtualCircuit) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VirtualCircuit) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VirtualCircuit) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + +### HasNniVlan + +`func (o *VirtualCircuit) HasNniVlan() bool` + +HasNniVlan returns a boolean if a field has been set. + +### GetPort + +`func (o *VirtualCircuit) GetPort() Href` + +GetPort returns the Port field if non-nil, zero value otherwise. + +### GetPortOk + +`func (o *VirtualCircuit) GetPortOk() (*Href, bool)` + +GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPort + +`func (o *VirtualCircuit) SetPort(v Href)` + +SetPort sets Port field to given value. + +### HasPort + +`func (o *VirtualCircuit) HasPort() bool` + +HasPort returns a boolean if a field has been set. + +### GetProject + +`func (o *VirtualCircuit) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VirtualCircuit) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VirtualCircuit) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VirtualCircuit) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VirtualCircuit) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VirtualCircuit) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VirtualCircuit) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VirtualCircuit) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetStatus + +`func (o *VirtualCircuit) GetStatus() VrfVirtualCircuitStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *VirtualCircuit) GetStatusOk() (*VrfVirtualCircuitStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *VirtualCircuit) SetStatus(v VrfVirtualCircuitStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *VirtualCircuit) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTags + +`func (o *VirtualCircuit) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VirtualCircuit) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VirtualCircuit) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VirtualCircuit) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VirtualCircuit) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VirtualCircuit) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VirtualCircuit) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VirtualCircuit) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *VirtualCircuit) GetVirtualNetwork() Href` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *VirtualCircuit) GetVirtualNetworkOk() (*Href, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *VirtualCircuit) SetVirtualNetwork(v Href)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *VirtualCircuit) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVnid + +`func (o *VirtualCircuit) GetVnid() int32` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VirtualCircuit) GetVnidOk() (*int32, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VirtualCircuit) SetVnid(v int32)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VirtualCircuit) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *VirtualCircuit) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VirtualCircuit) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VirtualCircuit) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VirtualCircuit) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *VirtualCircuit) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *VirtualCircuit) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *VirtualCircuit) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *VirtualCircuit) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetCustomerIp + +`func (o *VirtualCircuit) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VirtualCircuit) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VirtualCircuit) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VirtualCircuit) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VirtualCircuit) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VirtualCircuit) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VirtualCircuit) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VirtualCircuit) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### GetMetalIp + +`func (o *VirtualCircuit) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VirtualCircuit) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VirtualCircuit) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VirtualCircuit) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetPeerAsn + +`func (o *VirtualCircuit) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VirtualCircuit) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VirtualCircuit) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + +### HasPeerAsn + +`func (o *VirtualCircuit) HasPeerAsn() bool` + +HasPeerAsn returns a boolean if a field has been set. + +### GetSubnet + +`func (o *VirtualCircuit) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VirtualCircuit) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VirtualCircuit) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + +### HasSubnet + +`func (o *VirtualCircuit) HasSubnet() bool` + +HasSubnet returns a boolean if a field has been set. + +### GetVrf + +`func (o *VirtualCircuit) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VirtualCircuit) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VirtualCircuit) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualCircuitCreateInput.md b/services/metalv1/docs/VirtualCircuitCreateInput.md new file mode 100644 index 00000000..1a4ffc5a --- /dev/null +++ b/services/metalv1/docs/VirtualCircuitCreateInput.md @@ -0,0 +1,353 @@ +# VirtualCircuitCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**NniVlan** | **int32** | | +**ProjectId** | **string** | | +**Speed** | Pointer to **int32** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Vnid** | Pointer to **string** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer). | [optional] +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Md5** | Pointer to **NullableString** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**PeerAsn** | **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | +**Subnet** | **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF. | +**Vrf** | **string** | The UUID of the VRF that will be associated with the Virtual Circuit. | + +## Methods + +### NewVirtualCircuitCreateInput + +`func NewVirtualCircuitCreateInput(nniVlan int32, projectId string, peerAsn int32, subnet string, vrf string, ) *VirtualCircuitCreateInput` + +NewVirtualCircuitCreateInput instantiates a new VirtualCircuitCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualCircuitCreateInputWithDefaults + +`func NewVirtualCircuitCreateInputWithDefaults() *VirtualCircuitCreateInput` + +NewVirtualCircuitCreateInputWithDefaults instantiates a new VirtualCircuitCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *VirtualCircuitCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VirtualCircuitCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VirtualCircuitCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VirtualCircuitCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *VirtualCircuitCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VirtualCircuitCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VirtualCircuitCreateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VirtualCircuitCreateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VirtualCircuitCreateInput) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VirtualCircuitCreateInput) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VirtualCircuitCreateInput) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + + +### GetProjectId + +`func (o *VirtualCircuitCreateInput) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *VirtualCircuitCreateInput) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *VirtualCircuitCreateInput) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + + +### GetSpeed + +`func (o *VirtualCircuitCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VirtualCircuitCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VirtualCircuitCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VirtualCircuitCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VirtualCircuitCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VirtualCircuitCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VirtualCircuitCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VirtualCircuitCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVnid + +`func (o *VirtualCircuitCreateInput) GetVnid() string` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VirtualCircuitCreateInput) GetVnidOk() (*string, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VirtualCircuitCreateInput) SetVnid(v string)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VirtualCircuitCreateInput) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + +### GetCustomerIp + +`func (o *VirtualCircuitCreateInput) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VirtualCircuitCreateInput) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VirtualCircuitCreateInput) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VirtualCircuitCreateInput) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VirtualCircuitCreateInput) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VirtualCircuitCreateInput) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VirtualCircuitCreateInput) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VirtualCircuitCreateInput) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### SetMd5Nil + +`func (o *VirtualCircuitCreateInput) SetMd5Nil(b bool)` + + SetMd5Nil sets the value for Md5 to be an explicit nil + +### UnsetMd5 +`func (o *VirtualCircuitCreateInput) UnsetMd5()` + +UnsetMd5 ensures that no value is present for Md5, not even an explicit nil +### GetMetalIp + +`func (o *VirtualCircuitCreateInput) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VirtualCircuitCreateInput) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VirtualCircuitCreateInput) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VirtualCircuitCreateInput) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetPeerAsn + +`func (o *VirtualCircuitCreateInput) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VirtualCircuitCreateInput) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VirtualCircuitCreateInput) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + + +### GetSubnet + +`func (o *VirtualCircuitCreateInput) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VirtualCircuitCreateInput) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VirtualCircuitCreateInput) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + + +### GetVrf + +`func (o *VirtualCircuitCreateInput) GetVrf() string` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VirtualCircuitCreateInput) GetVrfOk() (*string, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VirtualCircuitCreateInput) SetVrf(v string)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualCircuitList.md b/services/metalv1/docs/VirtualCircuitList.md new file mode 100644 index 00000000..3382f50f --- /dev/null +++ b/services/metalv1/docs/VirtualCircuitList.md @@ -0,0 +1,56 @@ +# VirtualCircuitList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VirtualCircuits** | Pointer to [**[]VirtualCircuit**](VirtualCircuit.md) | | [optional] + +## Methods + +### NewVirtualCircuitList + +`func NewVirtualCircuitList() *VirtualCircuitList` + +NewVirtualCircuitList instantiates a new VirtualCircuitList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualCircuitListWithDefaults + +`func NewVirtualCircuitListWithDefaults() *VirtualCircuitList` + +NewVirtualCircuitListWithDefaults instantiates a new VirtualCircuitList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVirtualCircuits + +`func (o *VirtualCircuitList) GetVirtualCircuits() []VirtualCircuit` + +GetVirtualCircuits returns the VirtualCircuits field if non-nil, zero value otherwise. + +### GetVirtualCircuitsOk + +`func (o *VirtualCircuitList) GetVirtualCircuitsOk() (*[]VirtualCircuit, bool)` + +GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualCircuits + +`func (o *VirtualCircuitList) SetVirtualCircuits(v []VirtualCircuit)` + +SetVirtualCircuits sets VirtualCircuits field to given value. + +### HasVirtualCircuits + +`func (o *VirtualCircuitList) HasVirtualCircuits() bool` + +HasVirtualCircuits returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualCircuitUpdateInput.md b/services/metalv1/docs/VirtualCircuitUpdateInput.md new file mode 100644 index 00000000..1aae01d4 --- /dev/null +++ b/services/metalv1/docs/VirtualCircuitUpdateInput.md @@ -0,0 +1,290 @@ +# VirtualCircuitUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Speed** | Pointer to **string** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Vnid** | Pointer to **string** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project. | [optional] +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Md5** | Pointer to **string** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**PeerAsn** | Pointer to **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**Subnet** | Pointer to **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] + +## Methods + +### NewVirtualCircuitUpdateInput + +`func NewVirtualCircuitUpdateInput() *VirtualCircuitUpdateInput` + +NewVirtualCircuitUpdateInput instantiates a new VirtualCircuitUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualCircuitUpdateInputWithDefaults + +`func NewVirtualCircuitUpdateInputWithDefaults() *VirtualCircuitUpdateInput` + +NewVirtualCircuitUpdateInputWithDefaults instantiates a new VirtualCircuitUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *VirtualCircuitUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VirtualCircuitUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VirtualCircuitUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VirtualCircuitUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *VirtualCircuitUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VirtualCircuitUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VirtualCircuitUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VirtualCircuitUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VirtualCircuitUpdateInput) GetSpeed() string` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VirtualCircuitUpdateInput) GetSpeedOk() (*string, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VirtualCircuitUpdateInput) SetSpeed(v string)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VirtualCircuitUpdateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VirtualCircuitUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VirtualCircuitUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VirtualCircuitUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VirtualCircuitUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVnid + +`func (o *VirtualCircuitUpdateInput) GetVnid() string` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VirtualCircuitUpdateInput) GetVnidOk() (*string, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VirtualCircuitUpdateInput) SetVnid(v string)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VirtualCircuitUpdateInput) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + +### GetCustomerIp + +`func (o *VirtualCircuitUpdateInput) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VirtualCircuitUpdateInput) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VirtualCircuitUpdateInput) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VirtualCircuitUpdateInput) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VirtualCircuitUpdateInput) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VirtualCircuitUpdateInput) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VirtualCircuitUpdateInput) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VirtualCircuitUpdateInput) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### GetMetalIp + +`func (o *VirtualCircuitUpdateInput) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VirtualCircuitUpdateInput) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VirtualCircuitUpdateInput) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VirtualCircuitUpdateInput) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetPeerAsn + +`func (o *VirtualCircuitUpdateInput) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VirtualCircuitUpdateInput) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VirtualCircuitUpdateInput) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + +### HasPeerAsn + +`func (o *VirtualCircuitUpdateInput) HasPeerAsn() bool` + +HasPeerAsn returns a boolean if a field has been set. + +### GetSubnet + +`func (o *VirtualCircuitUpdateInput) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VirtualCircuitUpdateInput) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VirtualCircuitUpdateInput) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + +### HasSubnet + +`func (o *VirtualCircuitUpdateInput) HasSubnet() bool` + +HasSubnet returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualNetwork.md b/services/metalv1/docs/VirtualNetwork.md new file mode 100644 index 00000000..2d466710 --- /dev/null +++ b/services/metalv1/docs/VirtualNetwork.md @@ -0,0 +1,368 @@ +# VirtualNetwork + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AssignedTo** | Pointer to [**Href**](Href.md) | | [optional] +**AssignedToVirtualCircuit** | Pointer to **bool** | True if the virtual network is attached to a virtual circuit. False if not. | [optional] +**Description** | Pointer to **string** | | [optional] +**Facility** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Instances** | Pointer to [**[]Href**](Href.md) | A list of instances with ports currently associated to this Virtual Network. | [optional] +**MetalGateways** | Pointer to [**[]MetalGatewayLite**](MetalGatewayLite.md) | A list of metal gateways currently associated to this Virtual Network. | [optional] +**Metro** | Pointer to [**Href**](Href.md) | | [optional] +**MetroCode** | Pointer to **string** | The Metro code of the metro in which this Virtual Network is defined. | [optional] +**Vxlan** | Pointer to **int32** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVirtualNetwork + +`func NewVirtualNetwork() *VirtualNetwork` + +NewVirtualNetwork instantiates a new VirtualNetwork object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualNetworkWithDefaults + +`func NewVirtualNetworkWithDefaults() *VirtualNetwork` + +NewVirtualNetworkWithDefaults instantiates a new VirtualNetwork object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAssignedTo + +`func (o *VirtualNetwork) GetAssignedTo() Href` + +GetAssignedTo returns the AssignedTo field if non-nil, zero value otherwise. + +### GetAssignedToOk + +`func (o *VirtualNetwork) GetAssignedToOk() (*Href, bool)` + +GetAssignedToOk returns a tuple with the AssignedTo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignedTo + +`func (o *VirtualNetwork) SetAssignedTo(v Href)` + +SetAssignedTo sets AssignedTo field to given value. + +### HasAssignedTo + +`func (o *VirtualNetwork) HasAssignedTo() bool` + +HasAssignedTo returns a boolean if a field has been set. + +### GetAssignedToVirtualCircuit + +`func (o *VirtualNetwork) GetAssignedToVirtualCircuit() bool` + +GetAssignedToVirtualCircuit returns the AssignedToVirtualCircuit field if non-nil, zero value otherwise. + +### GetAssignedToVirtualCircuitOk + +`func (o *VirtualNetwork) GetAssignedToVirtualCircuitOk() (*bool, bool)` + +GetAssignedToVirtualCircuitOk returns a tuple with the AssignedToVirtualCircuit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAssignedToVirtualCircuit + +`func (o *VirtualNetwork) SetAssignedToVirtualCircuit(v bool)` + +SetAssignedToVirtualCircuit sets AssignedToVirtualCircuit field to given value. + +### HasAssignedToVirtualCircuit + +`func (o *VirtualNetwork) HasAssignedToVirtualCircuit() bool` + +HasAssignedToVirtualCircuit returns a boolean if a field has been set. + +### GetDescription + +`func (o *VirtualNetwork) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VirtualNetwork) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VirtualNetwork) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VirtualNetwork) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFacility + +`func (o *VirtualNetwork) GetFacility() Href` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *VirtualNetwork) GetFacilityOk() (*Href, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *VirtualNetwork) SetFacility(v Href)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *VirtualNetwork) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetHref + +`func (o *VirtualNetwork) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *VirtualNetwork) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *VirtualNetwork) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *VirtualNetwork) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *VirtualNetwork) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VirtualNetwork) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VirtualNetwork) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VirtualNetwork) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetId + +`func (o *VirtualNetwork) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VirtualNetwork) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VirtualNetwork) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VirtualNetwork) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetInstances + +`func (o *VirtualNetwork) GetInstances() []Href` + +GetInstances returns the Instances field if non-nil, zero value otherwise. + +### GetInstancesOk + +`func (o *VirtualNetwork) GetInstancesOk() (*[]Href, bool)` + +GetInstancesOk returns a tuple with the Instances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstances + +`func (o *VirtualNetwork) SetInstances(v []Href)` + +SetInstances sets Instances field to given value. + +### HasInstances + +`func (o *VirtualNetwork) HasInstances() bool` + +HasInstances returns a boolean if a field has been set. + +### GetMetalGateways + +`func (o *VirtualNetwork) GetMetalGateways() []MetalGatewayLite` + +GetMetalGateways returns the MetalGateways field if non-nil, zero value otherwise. + +### GetMetalGatewaysOk + +`func (o *VirtualNetwork) GetMetalGatewaysOk() (*[]MetalGatewayLite, bool)` + +GetMetalGatewaysOk returns a tuple with the MetalGateways field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateways + +`func (o *VirtualNetwork) SetMetalGateways(v []MetalGatewayLite)` + +SetMetalGateways sets MetalGateways field to given value. + +### HasMetalGateways + +`func (o *VirtualNetwork) HasMetalGateways() bool` + +HasMetalGateways returns a boolean if a field has been set. + +### GetMetro + +`func (o *VirtualNetwork) GetMetro() Href` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VirtualNetwork) GetMetroOk() (*Href, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VirtualNetwork) SetMetro(v Href)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *VirtualNetwork) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetMetroCode + +`func (o *VirtualNetwork) GetMetroCode() string` + +GetMetroCode returns the MetroCode field if non-nil, zero value otherwise. + +### GetMetroCodeOk + +`func (o *VirtualNetwork) GetMetroCodeOk() (*string, bool)` + +GetMetroCodeOk returns a tuple with the MetroCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetroCode + +`func (o *VirtualNetwork) SetMetroCode(v string)` + +SetMetroCode sets MetroCode field to given value. + +### HasMetroCode + +`func (o *VirtualNetwork) HasMetroCode() bool` + +HasMetroCode returns a boolean if a field has been set. + +### GetVxlan + +`func (o *VirtualNetwork) GetVxlan() int32` + +GetVxlan returns the Vxlan field if non-nil, zero value otherwise. + +### GetVxlanOk + +`func (o *VirtualNetwork) GetVxlanOk() (*int32, bool)` + +GetVxlanOk returns a tuple with the Vxlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVxlan + +`func (o *VirtualNetwork) SetVxlan(v int32)` + +SetVxlan sets Vxlan field to given value. + +### HasVxlan + +`func (o *VirtualNetwork) HasVxlan() bool` + +HasVxlan returns a boolean if a field has been set. + +### GetTags + +`func (o *VirtualNetwork) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VirtualNetwork) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VirtualNetwork) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VirtualNetwork) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualNetworkCreateInput.md b/services/metalv1/docs/VirtualNetworkCreateInput.md new file mode 100644 index 00000000..7cadcce5 --- /dev/null +++ b/services/metalv1/docs/VirtualNetworkCreateInput.md @@ -0,0 +1,160 @@ +# VirtualNetworkCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Facility** | Pointer to **string** | The UUID (or facility code) for the Facility in which to create this Virtual network. | [optional] +**Metro** | Pointer to **string** | The UUID (or metro code) for the Metro in which to create this Virtual Network. | [optional] +**Vxlan** | Pointer to **int32** | VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected. | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVirtualNetworkCreateInput + +`func NewVirtualNetworkCreateInput() *VirtualNetworkCreateInput` + +NewVirtualNetworkCreateInput instantiates a new VirtualNetworkCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualNetworkCreateInputWithDefaults + +`func NewVirtualNetworkCreateInputWithDefaults() *VirtualNetworkCreateInput` + +NewVirtualNetworkCreateInputWithDefaults instantiates a new VirtualNetworkCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *VirtualNetworkCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VirtualNetworkCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VirtualNetworkCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VirtualNetworkCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetFacility + +`func (o *VirtualNetworkCreateInput) GetFacility() string` + +GetFacility returns the Facility field if non-nil, zero value otherwise. + +### GetFacilityOk + +`func (o *VirtualNetworkCreateInput) GetFacilityOk() (*string, bool)` + +GetFacilityOk returns a tuple with the Facility field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFacility + +`func (o *VirtualNetworkCreateInput) SetFacility(v string)` + +SetFacility sets Facility field to given value. + +### HasFacility + +`func (o *VirtualNetworkCreateInput) HasFacility() bool` + +HasFacility returns a boolean if a field has been set. + +### GetMetro + +`func (o *VirtualNetworkCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VirtualNetworkCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VirtualNetworkCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *VirtualNetworkCreateInput) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetVxlan + +`func (o *VirtualNetworkCreateInput) GetVxlan() int32` + +GetVxlan returns the Vxlan field if non-nil, zero value otherwise. + +### GetVxlanOk + +`func (o *VirtualNetworkCreateInput) GetVxlanOk() (*int32, bool)` + +GetVxlanOk returns a tuple with the Vxlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVxlan + +`func (o *VirtualNetworkCreateInput) SetVxlan(v int32)` + +SetVxlan sets Vxlan field to given value. + +### HasVxlan + +`func (o *VirtualNetworkCreateInput) HasVxlan() bool` + +HasVxlan returns a boolean if a field has been set. + +### GetTags + +`func (o *VirtualNetworkCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VirtualNetworkCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VirtualNetworkCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VirtualNetworkCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VirtualNetworkList.md b/services/metalv1/docs/VirtualNetworkList.md new file mode 100644 index 00000000..6d7f958f --- /dev/null +++ b/services/metalv1/docs/VirtualNetworkList.md @@ -0,0 +1,56 @@ +# VirtualNetworkList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**VirtualNetworks** | Pointer to [**[]VirtualNetwork**](VirtualNetwork.md) | | [optional] + +## Methods + +### NewVirtualNetworkList + +`func NewVirtualNetworkList() *VirtualNetworkList` + +NewVirtualNetworkList instantiates a new VirtualNetworkList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVirtualNetworkListWithDefaults + +`func NewVirtualNetworkListWithDefaults() *VirtualNetworkList` + +NewVirtualNetworkListWithDefaults instantiates a new VirtualNetworkList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVirtualNetworks + +`func (o *VirtualNetworkList) GetVirtualNetworks() []VirtualNetwork` + +GetVirtualNetworks returns the VirtualNetworks field if non-nil, zero value otherwise. + +### GetVirtualNetworksOk + +`func (o *VirtualNetworkList) GetVirtualNetworksOk() (*[]VirtualNetwork, bool)` + +GetVirtualNetworksOk returns a tuple with the VirtualNetworks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetworks + +`func (o *VirtualNetworkList) SetVirtualNetworks(v []VirtualNetwork)` + +SetVirtualNetworks sets VirtualNetworks field to given value. + +### HasVirtualNetworks + +`func (o *VirtualNetworkList) HasVirtualNetworks() bool` + +HasVirtualNetworks returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanFabricVcCreateInput.md b/services/metalv1/docs/VlanFabricVcCreateInput.md new file mode 100644 index 00000000..f890781e --- /dev/null +++ b/services/metalv1/docs/VlanFabricVcCreateInput.md @@ -0,0 +1,291 @@ +# VlanFabricVcCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactEmail** | Pointer to **string** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] +**Description** | Pointer to **string** | | [optional] +**Metro** | **string** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | +**Name** | **string** | | +**Project** | Pointer to **string** | | [optional] +**Redundancy** | **string** | Either 'primary' or 'redundant'. | +**ServiceTokenType** | [**VlanFabricVcCreateInputServiceTokenType**](VlanFabricVcCreateInputServiceTokenType.md) | | +**Speed** | Pointer to **int32** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VlanFabricVcCreateInputType**](VlanFabricVcCreateInputType.md) | | +**Vlans** | Pointer to **[]int32** | A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. | [optional] + +## Methods + +### NewVlanFabricVcCreateInput + +`func NewVlanFabricVcCreateInput(metro string, name string, redundancy string, serviceTokenType VlanFabricVcCreateInputServiceTokenType, type_ VlanFabricVcCreateInputType, ) *VlanFabricVcCreateInput` + +NewVlanFabricVcCreateInput instantiates a new VlanFabricVcCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVlanFabricVcCreateInputWithDefaults + +`func NewVlanFabricVcCreateInputWithDefaults() *VlanFabricVcCreateInput` + +NewVlanFabricVcCreateInputWithDefaults instantiates a new VlanFabricVcCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContactEmail + +`func (o *VlanFabricVcCreateInput) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *VlanFabricVcCreateInput) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *VlanFabricVcCreateInput) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *VlanFabricVcCreateInput) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *VlanFabricVcCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VlanFabricVcCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VlanFabricVcCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VlanFabricVcCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMetro + +`func (o *VlanFabricVcCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VlanFabricVcCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VlanFabricVcCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetName + +`func (o *VlanFabricVcCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VlanFabricVcCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VlanFabricVcCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetProject + +`func (o *VlanFabricVcCreateInput) GetProject() string` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VlanFabricVcCreateInput) GetProjectOk() (*string, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VlanFabricVcCreateInput) SetProject(v string)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VlanFabricVcCreateInput) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *VlanFabricVcCreateInput) GetRedundancy() string` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *VlanFabricVcCreateInput) GetRedundancyOk() (*string, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *VlanFabricVcCreateInput) SetRedundancy(v string)` + +SetRedundancy sets Redundancy field to given value. + + +### GetServiceTokenType + +`func (o *VlanFabricVcCreateInput) GetServiceTokenType() VlanFabricVcCreateInputServiceTokenType` + +GetServiceTokenType returns the ServiceTokenType field if non-nil, zero value otherwise. + +### GetServiceTokenTypeOk + +`func (o *VlanFabricVcCreateInput) GetServiceTokenTypeOk() (*VlanFabricVcCreateInputServiceTokenType, bool)` + +GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceTokenType + +`func (o *VlanFabricVcCreateInput) SetServiceTokenType(v VlanFabricVcCreateInputServiceTokenType)` + +SetServiceTokenType sets ServiceTokenType field to given value. + + +### GetSpeed + +`func (o *VlanFabricVcCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VlanFabricVcCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VlanFabricVcCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VlanFabricVcCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VlanFabricVcCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VlanFabricVcCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VlanFabricVcCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VlanFabricVcCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VlanFabricVcCreateInput) GetType() VlanFabricVcCreateInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VlanFabricVcCreateInput) GetTypeOk() (*VlanFabricVcCreateInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VlanFabricVcCreateInput) SetType(v VlanFabricVcCreateInputType)` + +SetType sets Type field to given value. + + +### GetVlans + +`func (o *VlanFabricVcCreateInput) GetVlans() []int32` + +GetVlans returns the Vlans field if non-nil, zero value otherwise. + +### GetVlansOk + +`func (o *VlanFabricVcCreateInput) GetVlansOk() (*[]int32, bool)` + +GetVlansOk returns a tuple with the Vlans field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVlans + +`func (o *VlanFabricVcCreateInput) SetVlans(v []int32)` + +SetVlans sets Vlans field to given value. + +### HasVlans + +`func (o *VlanFabricVcCreateInput) HasVlans() bool` + +HasVlans returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanFabricVcCreateInputServiceTokenType.md b/services/metalv1/docs/VlanFabricVcCreateInputServiceTokenType.md new file mode 100644 index 00000000..7291f546 --- /dev/null +++ b/services/metalv1/docs/VlanFabricVcCreateInputServiceTokenType.md @@ -0,0 +1,13 @@ +# VlanFabricVcCreateInputServiceTokenType + +## Enum + + +* `A_SIDE` (value: `"a_side"`) + +* `Z_SIDE` (value: `"z_side"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanFabricVcCreateInputType.md b/services/metalv1/docs/VlanFabricVcCreateInputType.md new file mode 100644 index 00000000..8b73f5ad --- /dev/null +++ b/services/metalv1/docs/VlanFabricVcCreateInputType.md @@ -0,0 +1,11 @@ +# VlanFabricVcCreateInputType + +## Enum + + +* `SHARED` (value: `"shared"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanVirtualCircuit.md b/services/metalv1/docs/VlanVirtualCircuit.md new file mode 100644 index 00000000..8ce8820f --- /dev/null +++ b/services/metalv1/docs/VlanVirtualCircuit.md @@ -0,0 +1,420 @@ +# VlanVirtualCircuit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bill** | Pointer to **bool** | True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. | [optional] [default to false] +**Description** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**NniVlan** | Pointer to **int32** | | [optional] +**Port** | Pointer to [**Href**](Href.md) | | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Speed** | Pointer to **int32** | For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | [optional] +**Status** | Pointer to [**VlanVirtualCircuitStatus**](VlanVirtualCircuitStatus.md) | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | Pointer to [**VlanVirtualCircuitType**](VlanVirtualCircuitType.md) | | [optional] +**VirtualNetwork** | Pointer to [**Href**](Href.md) | | [optional] +**Vnid** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewVlanVirtualCircuit + +`func NewVlanVirtualCircuit() *VlanVirtualCircuit` + +NewVlanVirtualCircuit instantiates a new VlanVirtualCircuit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVlanVirtualCircuitWithDefaults + +`func NewVlanVirtualCircuitWithDefaults() *VlanVirtualCircuit` + +NewVlanVirtualCircuitWithDefaults instantiates a new VlanVirtualCircuit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBill + +`func (o *VlanVirtualCircuit) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *VlanVirtualCircuit) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *VlanVirtualCircuit) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *VlanVirtualCircuit) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetDescription + +`func (o *VlanVirtualCircuit) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VlanVirtualCircuit) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VlanVirtualCircuit) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VlanVirtualCircuit) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetId + +`func (o *VlanVirtualCircuit) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VlanVirtualCircuit) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VlanVirtualCircuit) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VlanVirtualCircuit) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *VlanVirtualCircuit) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VlanVirtualCircuit) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VlanVirtualCircuit) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VlanVirtualCircuit) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VlanVirtualCircuit) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VlanVirtualCircuit) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VlanVirtualCircuit) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + +### HasNniVlan + +`func (o *VlanVirtualCircuit) HasNniVlan() bool` + +HasNniVlan returns a boolean if a field has been set. + +### GetPort + +`func (o *VlanVirtualCircuit) GetPort() Href` + +GetPort returns the Port field if non-nil, zero value otherwise. + +### GetPortOk + +`func (o *VlanVirtualCircuit) GetPortOk() (*Href, bool)` + +GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPort + +`func (o *VlanVirtualCircuit) SetPort(v Href)` + +SetPort sets Port field to given value. + +### HasPort + +`func (o *VlanVirtualCircuit) HasPort() bool` + +HasPort returns a boolean if a field has been set. + +### GetProject + +`func (o *VlanVirtualCircuit) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VlanVirtualCircuit) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VlanVirtualCircuit) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VlanVirtualCircuit) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VlanVirtualCircuit) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VlanVirtualCircuit) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VlanVirtualCircuit) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VlanVirtualCircuit) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetStatus + +`func (o *VlanVirtualCircuit) GetStatus() VlanVirtualCircuitStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *VlanVirtualCircuit) GetStatusOk() (*VlanVirtualCircuitStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *VlanVirtualCircuit) SetStatus(v VlanVirtualCircuitStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *VlanVirtualCircuit) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetTags + +`func (o *VlanVirtualCircuit) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VlanVirtualCircuit) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VlanVirtualCircuit) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VlanVirtualCircuit) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VlanVirtualCircuit) GetType() VlanVirtualCircuitType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VlanVirtualCircuit) GetTypeOk() (*VlanVirtualCircuitType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VlanVirtualCircuit) SetType(v VlanVirtualCircuitType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VlanVirtualCircuit) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *VlanVirtualCircuit) GetVirtualNetwork() Href` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *VlanVirtualCircuit) GetVirtualNetworkOk() (*Href, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *VlanVirtualCircuit) SetVirtualNetwork(v Href)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *VlanVirtualCircuit) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVnid + +`func (o *VlanVirtualCircuit) GetVnid() int32` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VlanVirtualCircuit) GetVnidOk() (*int32, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VlanVirtualCircuit) SetVnid(v int32)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VlanVirtualCircuit) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *VlanVirtualCircuit) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VlanVirtualCircuit) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VlanVirtualCircuit) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VlanVirtualCircuit) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *VlanVirtualCircuit) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *VlanVirtualCircuit) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *VlanVirtualCircuit) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *VlanVirtualCircuit) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanVirtualCircuitCreateInput.md b/services/metalv1/docs/VlanVirtualCircuitCreateInput.md new file mode 100644 index 00000000..e6277dcf --- /dev/null +++ b/services/metalv1/docs/VlanVirtualCircuitCreateInput.md @@ -0,0 +1,207 @@ +# VlanVirtualCircuitCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**NniVlan** | Pointer to **int32** | | [optional] +**ProjectId** | **string** | | +**Speed** | Pointer to **int32** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Vnid** | Pointer to **string** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer). | [optional] + +## Methods + +### NewVlanVirtualCircuitCreateInput + +`func NewVlanVirtualCircuitCreateInput(projectId string, ) *VlanVirtualCircuitCreateInput` + +NewVlanVirtualCircuitCreateInput instantiates a new VlanVirtualCircuitCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVlanVirtualCircuitCreateInputWithDefaults + +`func NewVlanVirtualCircuitCreateInputWithDefaults() *VlanVirtualCircuitCreateInput` + +NewVlanVirtualCircuitCreateInputWithDefaults instantiates a new VlanVirtualCircuitCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *VlanVirtualCircuitCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VlanVirtualCircuitCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VlanVirtualCircuitCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VlanVirtualCircuitCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *VlanVirtualCircuitCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VlanVirtualCircuitCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VlanVirtualCircuitCreateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VlanVirtualCircuitCreateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VlanVirtualCircuitCreateInput) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VlanVirtualCircuitCreateInput) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VlanVirtualCircuitCreateInput) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + +### HasNniVlan + +`func (o *VlanVirtualCircuitCreateInput) HasNniVlan() bool` + +HasNniVlan returns a boolean if a field has been set. + +### GetProjectId + +`func (o *VlanVirtualCircuitCreateInput) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *VlanVirtualCircuitCreateInput) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *VlanVirtualCircuitCreateInput) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + + +### GetSpeed + +`func (o *VlanVirtualCircuitCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VlanVirtualCircuitCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VlanVirtualCircuitCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VlanVirtualCircuitCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VlanVirtualCircuitCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VlanVirtualCircuitCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VlanVirtualCircuitCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VlanVirtualCircuitCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVnid + +`func (o *VlanVirtualCircuitCreateInput) GetVnid() string` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VlanVirtualCircuitCreateInput) GetVnidOk() (*string, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VlanVirtualCircuitCreateInput) SetVnid(v string)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VlanVirtualCircuitCreateInput) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanVirtualCircuitStatus.md b/services/metalv1/docs/VlanVirtualCircuitStatus.md new file mode 100644 index 00000000..ad5adfbb --- /dev/null +++ b/services/metalv1/docs/VlanVirtualCircuitStatus.md @@ -0,0 +1,33 @@ +# VlanVirtualCircuitStatus + +## Enum + + +* `PENDING` (value: `"pending"`) + +* `WAITING_ON_CUSTOMER_VLAN` (value: `"waiting_on_customer_vlan"`) + +* `ACTIVATING` (value: `"activating"`) + +* `CHANGING_VLAN` (value: `"changing_vlan"`) + +* `DEACTIVATING` (value: `"deactivating"`) + +* `DELETING` (value: `"deleting"`) + +* `ACTIVE` (value: `"active"`) + +* `EXPIRED` (value: `"expired"`) + +* `ACTIVATION_FAILED` (value: `"activation_failed"`) + +* `CHANGING_VLAN_FAILED` (value: `"changing_vlan_failed"`) + +* `DEACTIVATION_FAILED` (value: `"deactivation_failed"`) + +* `DELETE_FAILED` (value: `"delete_failed"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanVirtualCircuitType.md b/services/metalv1/docs/VlanVirtualCircuitType.md new file mode 100644 index 00000000..a2b854e5 --- /dev/null +++ b/services/metalv1/docs/VlanVirtualCircuitType.md @@ -0,0 +1,11 @@ +# VlanVirtualCircuitType + +## Enum + + +* `VLAN` (value: `"vlan"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md b/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md new file mode 100644 index 00000000..529f5395 --- /dev/null +++ b/services/metalv1/docs/VlanVirtualCircuitUpdateInput.md @@ -0,0 +1,160 @@ +# VlanVirtualCircuitUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Speed** | Pointer to **string** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Vnid** | Pointer to **string** | A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project. | [optional] + +## Methods + +### NewVlanVirtualCircuitUpdateInput + +`func NewVlanVirtualCircuitUpdateInput() *VlanVirtualCircuitUpdateInput` + +NewVlanVirtualCircuitUpdateInput instantiates a new VlanVirtualCircuitUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVlanVirtualCircuitUpdateInputWithDefaults + +`func NewVlanVirtualCircuitUpdateInputWithDefaults() *VlanVirtualCircuitUpdateInput` + +NewVlanVirtualCircuitUpdateInputWithDefaults instantiates a new VlanVirtualCircuitUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *VlanVirtualCircuitUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VlanVirtualCircuitUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VlanVirtualCircuitUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VlanVirtualCircuitUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *VlanVirtualCircuitUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VlanVirtualCircuitUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VlanVirtualCircuitUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VlanVirtualCircuitUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VlanVirtualCircuitUpdateInput) GetSpeed() string` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VlanVirtualCircuitUpdateInput) GetSpeedOk() (*string, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VlanVirtualCircuitUpdateInput) SetSpeed(v string)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VlanVirtualCircuitUpdateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VlanVirtualCircuitUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VlanVirtualCircuitUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VlanVirtualCircuitUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VlanVirtualCircuitUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVnid + +`func (o *VlanVirtualCircuitUpdateInput) GetVnid() string` + +GetVnid returns the Vnid field if non-nil, zero value otherwise. + +### GetVnidOk + +`func (o *VlanVirtualCircuitUpdateInput) GetVnidOk() (*string, bool)` + +GetVnidOk returns a tuple with the Vnid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVnid + +`func (o *VlanVirtualCircuitUpdateInput) SetVnid(v string)` + +SetVnid sets Vnid field to given value. + +### HasVnid + +`func (o *VlanVirtualCircuitUpdateInput) HasVnid() bool` + +HasVnid returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/Vrf.md b/services/metalv1/docs/Vrf.md new file mode 100644 index 00000000..81080dfb --- /dev/null +++ b/services/metalv1/docs/Vrf.md @@ -0,0 +1,472 @@ +# Vrf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Name** | Pointer to **string** | | [optional] +**Description** | Pointer to **string** | Optional field that can be set to describe the VRF | [optional] +**Bill** | Pointer to **bool** | True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. | [optional] [default to false] +**BgpDynamicNeighborsEnabled** | Pointer to **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**BgpDynamicNeighborsExportRouteMap** | Pointer to **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**BgpDynamicNeighborsBfdEnabled** | Pointer to **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**LocalAsn** | Pointer to **int32** | A 4-byte ASN associated with the VRF. | [optional] +**VirtualCircuits** | Pointer to [**[]VrfVirtualCircuit**](VrfVirtualCircuit.md) | Virtual circuits that are in the VRF | [optional] +**IpRanges** | Pointer to **[]string** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] +**CreatedBy** | Pointer to [**User**](User.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrf + +`func NewVrf() *Vrf` + +NewVrf instantiates a new Vrf object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfWithDefaults + +`func NewVrfWithDefaults() *Vrf` + +NewVrfWithDefaults instantiates a new Vrf object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Vrf) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Vrf) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Vrf) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *Vrf) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *Vrf) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Vrf) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Vrf) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Vrf) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetDescription + +`func (o *Vrf) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *Vrf) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *Vrf) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *Vrf) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetBill + +`func (o *Vrf) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *Vrf) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *Vrf) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *Vrf) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsEnabled + +`func (o *Vrf) GetBgpDynamicNeighborsEnabled() bool` + +GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsEnabledOk + +`func (o *Vrf) GetBgpDynamicNeighborsEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsEnabled + +`func (o *Vrf) SetBgpDynamicNeighborsEnabled(v bool)` + +SetBgpDynamicNeighborsEnabled sets BgpDynamicNeighborsEnabled field to given value. + +### HasBgpDynamicNeighborsEnabled + +`func (o *Vrf) HasBgpDynamicNeighborsEnabled() bool` + +HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsExportRouteMap + +`func (o *Vrf) GetBgpDynamicNeighborsExportRouteMap() bool` + +GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsExportRouteMapOk + +`func (o *Vrf) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool)` + +GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsExportRouteMap + +`func (o *Vrf) SetBgpDynamicNeighborsExportRouteMap(v bool)` + +SetBgpDynamicNeighborsExportRouteMap sets BgpDynamicNeighborsExportRouteMap field to given value. + +### HasBgpDynamicNeighborsExportRouteMap + +`func (o *Vrf) HasBgpDynamicNeighborsExportRouteMap() bool` + +HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsBfdEnabled + +`func (o *Vrf) GetBgpDynamicNeighborsBfdEnabled() bool` + +GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsBfdEnabledOk + +`func (o *Vrf) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsBfdEnabled + +`func (o *Vrf) SetBgpDynamicNeighborsBfdEnabled(v bool)` + +SetBgpDynamicNeighborsBfdEnabled sets BgpDynamicNeighborsBfdEnabled field to given value. + +### HasBgpDynamicNeighborsBfdEnabled + +`func (o *Vrf) HasBgpDynamicNeighborsBfdEnabled() bool` + +HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. + +### GetLocalAsn + +`func (o *Vrf) GetLocalAsn() int32` + +GetLocalAsn returns the LocalAsn field if non-nil, zero value otherwise. + +### GetLocalAsnOk + +`func (o *Vrf) GetLocalAsnOk() (*int32, bool)` + +GetLocalAsnOk returns a tuple with the LocalAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocalAsn + +`func (o *Vrf) SetLocalAsn(v int32)` + +SetLocalAsn sets LocalAsn field to given value. + +### HasLocalAsn + +`func (o *Vrf) HasLocalAsn() bool` + +HasLocalAsn returns a boolean if a field has been set. + +### GetVirtualCircuits + +`func (o *Vrf) GetVirtualCircuits() []VrfVirtualCircuit` + +GetVirtualCircuits returns the VirtualCircuits field if non-nil, zero value otherwise. + +### GetVirtualCircuitsOk + +`func (o *Vrf) GetVirtualCircuitsOk() (*[]VrfVirtualCircuit, bool)` + +GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualCircuits + +`func (o *Vrf) SetVirtualCircuits(v []VrfVirtualCircuit)` + +SetVirtualCircuits sets VirtualCircuits field to given value. + +### HasVirtualCircuits + +`func (o *Vrf) HasVirtualCircuits() bool` + +HasVirtualCircuits returns a boolean if a field has been set. + +### GetIpRanges + +`func (o *Vrf) GetIpRanges() []string` + +GetIpRanges returns the IpRanges field if non-nil, zero value otherwise. + +### GetIpRangesOk + +`func (o *Vrf) GetIpRangesOk() (*[]string, bool)` + +GetIpRangesOk returns a tuple with the IpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpRanges + +`func (o *Vrf) SetIpRanges(v []string)` + +SetIpRanges sets IpRanges field to given value. + +### HasIpRanges + +`func (o *Vrf) HasIpRanges() bool` + +HasIpRanges returns a boolean if a field has been set. + +### GetProject + +`func (o *Vrf) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *Vrf) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *Vrf) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *Vrf) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetMetro + +`func (o *Vrf) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *Vrf) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *Vrf) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *Vrf) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *Vrf) GetCreatedBy() User` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *Vrf) GetCreatedByOk() (*User, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *Vrf) SetCreatedBy(v User)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *Vrf) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetHref + +`func (o *Vrf) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *Vrf) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *Vrf) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *Vrf) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *Vrf) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *Vrf) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *Vrf) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *Vrf) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *Vrf) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *Vrf) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *Vrf) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *Vrf) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetTags + +`func (o *Vrf) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Vrf) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *Vrf) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *Vrf) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfCreateInput.md b/services/metalv1/docs/VrfCreateInput.md new file mode 100644 index 00000000..c7aff1cb --- /dev/null +++ b/services/metalv1/docs/VrfCreateInput.md @@ -0,0 +1,254 @@ +# VrfCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpDynamicNeighborsEnabled** | Pointer to **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**BgpDynamicNeighborsExportRouteMap** | Pointer to **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**BgpDynamicNeighborsBfdEnabled** | Pointer to **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**Description** | Pointer to **string** | | [optional] +**IpRanges** | Pointer to **[]string** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. | [optional] +**LocalAsn** | Pointer to **int32** | | [optional] +**Metro** | **string** | The UUID (or metro code) for the Metro in which to create this VRF. | +**Name** | **string** | | +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfCreateInput + +`func NewVrfCreateInput(metro string, name string, ) *VrfCreateInput` + +NewVrfCreateInput instantiates a new VrfCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfCreateInputWithDefaults + +`func NewVrfCreateInputWithDefaults() *VrfCreateInput` + +NewVrfCreateInputWithDefaults instantiates a new VrfCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpDynamicNeighborsEnabled + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsEnabled() bool` + +GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsEnabledOk + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsEnabled + +`func (o *VrfCreateInput) SetBgpDynamicNeighborsEnabled(v bool)` + +SetBgpDynamicNeighborsEnabled sets BgpDynamicNeighborsEnabled field to given value. + +### HasBgpDynamicNeighborsEnabled + +`func (o *VrfCreateInput) HasBgpDynamicNeighborsEnabled() bool` + +HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsExportRouteMap + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsExportRouteMap() bool` + +GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsExportRouteMapOk + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool)` + +GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsExportRouteMap + +`func (o *VrfCreateInput) SetBgpDynamicNeighborsExportRouteMap(v bool)` + +SetBgpDynamicNeighborsExportRouteMap sets BgpDynamicNeighborsExportRouteMap field to given value. + +### HasBgpDynamicNeighborsExportRouteMap + +`func (o *VrfCreateInput) HasBgpDynamicNeighborsExportRouteMap() bool` + +HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsBfdEnabled + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsBfdEnabled() bool` + +GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsBfdEnabledOk + +`func (o *VrfCreateInput) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsBfdEnabled + +`func (o *VrfCreateInput) SetBgpDynamicNeighborsBfdEnabled(v bool)` + +SetBgpDynamicNeighborsBfdEnabled sets BgpDynamicNeighborsBfdEnabled field to given value. + +### HasBgpDynamicNeighborsBfdEnabled + +`func (o *VrfCreateInput) HasBgpDynamicNeighborsBfdEnabled() bool` + +HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetIpRanges + +`func (o *VrfCreateInput) GetIpRanges() []string` + +GetIpRanges returns the IpRanges field if non-nil, zero value otherwise. + +### GetIpRangesOk + +`func (o *VrfCreateInput) GetIpRangesOk() (*[]string, bool)` + +GetIpRangesOk returns a tuple with the IpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpRanges + +`func (o *VrfCreateInput) SetIpRanges(v []string)` + +SetIpRanges sets IpRanges field to given value. + +### HasIpRanges + +`func (o *VrfCreateInput) HasIpRanges() bool` + +HasIpRanges returns a boolean if a field has been set. + +### GetLocalAsn + +`func (o *VrfCreateInput) GetLocalAsn() int32` + +GetLocalAsn returns the LocalAsn field if non-nil, zero value otherwise. + +### GetLocalAsnOk + +`func (o *VrfCreateInput) GetLocalAsnOk() (*int32, bool)` + +GetLocalAsnOk returns a tuple with the LocalAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocalAsn + +`func (o *VrfCreateInput) SetLocalAsn(v int32)` + +SetLocalAsn sets LocalAsn field to given value. + +### HasLocalAsn + +`func (o *VrfCreateInput) HasLocalAsn() bool` + +HasLocalAsn returns a boolean if a field has been set. + +### GetMetro + +`func (o *VrfCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VrfCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VrfCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetName + +`func (o *VrfCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetTags + +`func (o *VrfCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfFabricVcCreateInput.md b/services/metalv1/docs/VrfFabricVcCreateInput.md new file mode 100644 index 00000000..6dca69f7 --- /dev/null +++ b/services/metalv1/docs/VrfFabricVcCreateInput.md @@ -0,0 +1,286 @@ +# VrfFabricVcCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactEmail** | Pointer to **string** | The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. | [optional] +**Description** | Pointer to **string** | | [optional] +**Metro** | **string** | A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. | +**Name** | **string** | | +**Project** | Pointer to **string** | | [optional] +**Redundancy** | **string** | Either 'primary' or 'redundant'. | +**ServiceTokenType** | [**VlanFabricVcCreateInputServiceTokenType**](VlanFabricVcCreateInputServiceTokenType.md) | | +**Speed** | Pointer to **int32** | A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VlanFabricVcCreateInputType**](VlanFabricVcCreateInputType.md) | | +**Vrfs** | **[]string** | This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. | + +## Methods + +### NewVrfFabricVcCreateInput + +`func NewVrfFabricVcCreateInput(metro string, name string, redundancy string, serviceTokenType VlanFabricVcCreateInputServiceTokenType, type_ VlanFabricVcCreateInputType, vrfs []string, ) *VrfFabricVcCreateInput` + +NewVrfFabricVcCreateInput instantiates a new VrfFabricVcCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfFabricVcCreateInputWithDefaults + +`func NewVrfFabricVcCreateInputWithDefaults() *VrfFabricVcCreateInput` + +NewVrfFabricVcCreateInputWithDefaults instantiates a new VrfFabricVcCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContactEmail + +`func (o *VrfFabricVcCreateInput) GetContactEmail() string` + +GetContactEmail returns the ContactEmail field if non-nil, zero value otherwise. + +### GetContactEmailOk + +`func (o *VrfFabricVcCreateInput) GetContactEmailOk() (*string, bool)` + +GetContactEmailOk returns a tuple with the ContactEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContactEmail + +`func (o *VrfFabricVcCreateInput) SetContactEmail(v string)` + +SetContactEmail sets ContactEmail field to given value. + +### HasContactEmail + +`func (o *VrfFabricVcCreateInput) HasContactEmail() bool` + +HasContactEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfFabricVcCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfFabricVcCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfFabricVcCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfFabricVcCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMetro + +`func (o *VrfFabricVcCreateInput) GetMetro() string` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VrfFabricVcCreateInput) GetMetroOk() (*string, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VrfFabricVcCreateInput) SetMetro(v string)` + +SetMetro sets Metro field to given value. + + +### GetName + +`func (o *VrfFabricVcCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfFabricVcCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfFabricVcCreateInput) SetName(v string)` + +SetName sets Name field to given value. + + +### GetProject + +`func (o *VrfFabricVcCreateInput) GetProject() string` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VrfFabricVcCreateInput) GetProjectOk() (*string, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VrfFabricVcCreateInput) SetProject(v string)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VrfFabricVcCreateInput) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetRedundancy + +`func (o *VrfFabricVcCreateInput) GetRedundancy() string` + +GetRedundancy returns the Redundancy field if non-nil, zero value otherwise. + +### GetRedundancyOk + +`func (o *VrfFabricVcCreateInput) GetRedundancyOk() (*string, bool)` + +GetRedundancyOk returns a tuple with the Redundancy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedundancy + +`func (o *VrfFabricVcCreateInput) SetRedundancy(v string)` + +SetRedundancy sets Redundancy field to given value. + + +### GetServiceTokenType + +`func (o *VrfFabricVcCreateInput) GetServiceTokenType() VlanFabricVcCreateInputServiceTokenType` + +GetServiceTokenType returns the ServiceTokenType field if non-nil, zero value otherwise. + +### GetServiceTokenTypeOk + +`func (o *VrfFabricVcCreateInput) GetServiceTokenTypeOk() (*VlanFabricVcCreateInputServiceTokenType, bool)` + +GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceTokenType + +`func (o *VrfFabricVcCreateInput) SetServiceTokenType(v VlanFabricVcCreateInputServiceTokenType)` + +SetServiceTokenType sets ServiceTokenType field to given value. + + +### GetSpeed + +`func (o *VrfFabricVcCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VrfFabricVcCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VrfFabricVcCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VrfFabricVcCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfFabricVcCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfFabricVcCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfFabricVcCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfFabricVcCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VrfFabricVcCreateInput) GetType() VlanFabricVcCreateInputType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VrfFabricVcCreateInput) GetTypeOk() (*VlanFabricVcCreateInputType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VrfFabricVcCreateInput) SetType(v VlanFabricVcCreateInputType)` + +SetType sets Type field to given value. + + +### GetVrfs + +`func (o *VrfFabricVcCreateInput) GetVrfs() []string` + +GetVrfs returns the Vrfs field if non-nil, zero value otherwise. + +### GetVrfsOk + +`func (o *VrfFabricVcCreateInput) GetVrfsOk() (*[]string, bool)` + +GetVrfsOk returns a tuple with the Vrfs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrfs + +`func (o *VrfFabricVcCreateInput) SetVrfs(v []string)` + +SetVrfs sets Vrfs field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfIpReservation.md b/services/metalv1/docs/VrfIpReservation.md new file mode 100644 index 00000000..e86e717b --- /dev/null +++ b/services/metalv1/docs/VrfIpReservation.md @@ -0,0 +1,644 @@ +# VrfIpReservation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AddressFamily** | Pointer to **int32** | | [optional] +**Cidr** | Pointer to **int32** | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Details** | Pointer to **string** | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**MetalGateway** | Pointer to [**MetalGatewayLite**](MetalGatewayLite.md) | | [optional] +**Netmask** | Pointer to **string** | | [optional] +**Network** | Pointer to **string** | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**State** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | [**VrfIpReservationType**](VrfIpReservationType.md) | | +**Vrf** | [**Vrf**](Vrf.md) | | +**Public** | Pointer to **bool** | | [optional] +**Management** | Pointer to **bool** | | [optional] +**Manageable** | Pointer to **bool** | | [optional] +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Bill** | Pointer to **bool** | | [optional] +**ProjectLite** | Pointer to [**Project**](Project.md) | | [optional] +**Address** | Pointer to **string** | | [optional] +**Gateway** | Pointer to **string** | | [optional] +**Metro** | Pointer to [**Metro**](Metro.md) | | [optional] + +## Methods + +### NewVrfIpReservation + +`func NewVrfIpReservation(type_ VrfIpReservationType, vrf Vrf, ) *VrfIpReservation` + +NewVrfIpReservation instantiates a new VrfIpReservation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfIpReservationWithDefaults + +`func NewVrfIpReservationWithDefaults() *VrfIpReservation` + +NewVrfIpReservationWithDefaults instantiates a new VrfIpReservation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAddressFamily + +`func (o *VrfIpReservation) GetAddressFamily() int32` + +GetAddressFamily returns the AddressFamily field if non-nil, zero value otherwise. + +### GetAddressFamilyOk + +`func (o *VrfIpReservation) GetAddressFamilyOk() (*int32, bool)` + +GetAddressFamilyOk returns a tuple with the AddressFamily field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddressFamily + +`func (o *VrfIpReservation) SetAddressFamily(v int32)` + +SetAddressFamily sets AddressFamily field to given value. + +### HasAddressFamily + +`func (o *VrfIpReservation) HasAddressFamily() bool` + +HasAddressFamily returns a boolean if a field has been set. + +### GetCidr + +`func (o *VrfIpReservation) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *VrfIpReservation) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *VrfIpReservation) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + +### HasCidr + +`func (o *VrfIpReservation) HasCidr() bool` + +HasCidr returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *VrfIpReservation) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VrfIpReservation) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VrfIpReservation) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VrfIpReservation) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *VrfIpReservation) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *VrfIpReservation) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *VrfIpReservation) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *VrfIpReservation) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetDetails + +`func (o *VrfIpReservation) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *VrfIpReservation) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *VrfIpReservation) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *VrfIpReservation) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetHref + +`func (o *VrfIpReservation) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *VrfIpReservation) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *VrfIpReservation) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *VrfIpReservation) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *VrfIpReservation) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VrfIpReservation) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VrfIpReservation) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VrfIpReservation) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *VrfIpReservation) GetMetalGateway() MetalGatewayLite` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *VrfIpReservation) GetMetalGatewayOk() (*MetalGatewayLite, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *VrfIpReservation) SetMetalGateway(v MetalGatewayLite)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *VrfIpReservation) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetNetmask + +`func (o *VrfIpReservation) GetNetmask() string` + +GetNetmask returns the Netmask field if non-nil, zero value otherwise. + +### GetNetmaskOk + +`func (o *VrfIpReservation) GetNetmaskOk() (*string, bool)` + +GetNetmaskOk returns a tuple with the Netmask field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetmask + +`func (o *VrfIpReservation) SetNetmask(v string)` + +SetNetmask sets Netmask field to given value. + +### HasNetmask + +`func (o *VrfIpReservation) HasNetmask() bool` + +HasNetmask returns a boolean if a field has been set. + +### GetNetwork + +`func (o *VrfIpReservation) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *VrfIpReservation) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *VrfIpReservation) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + +### HasNetwork + +`func (o *VrfIpReservation) HasNetwork() bool` + +HasNetwork returns a boolean if a field has been set. + +### GetProject + +`func (o *VrfIpReservation) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VrfIpReservation) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VrfIpReservation) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VrfIpReservation) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetState + +`func (o *VrfIpReservation) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *VrfIpReservation) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *VrfIpReservation) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *VrfIpReservation) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfIpReservation) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfIpReservation) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfIpReservation) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfIpReservation) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VrfIpReservation) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VrfIpReservation) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VrfIpReservation) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + + +### GetVrf + +`func (o *VrfIpReservation) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VrfIpReservation) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VrfIpReservation) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + +### GetPublic + +`func (o *VrfIpReservation) GetPublic() bool` + +GetPublic returns the Public field if non-nil, zero value otherwise. + +### GetPublicOk + +`func (o *VrfIpReservation) GetPublicOk() (*bool, bool)` + +GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublic + +`func (o *VrfIpReservation) SetPublic(v bool)` + +SetPublic sets Public field to given value. + +### HasPublic + +`func (o *VrfIpReservation) HasPublic() bool` + +HasPublic returns a boolean if a field has been set. + +### GetManagement + +`func (o *VrfIpReservation) GetManagement() bool` + +GetManagement returns the Management field if non-nil, zero value otherwise. + +### GetManagementOk + +`func (o *VrfIpReservation) GetManagementOk() (*bool, bool)` + +GetManagementOk returns a tuple with the Management field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManagement + +`func (o *VrfIpReservation) SetManagement(v bool)` + +SetManagement sets Management field to given value. + +### HasManagement + +`func (o *VrfIpReservation) HasManagement() bool` + +HasManagement returns a boolean if a field has been set. + +### GetManageable + +`func (o *VrfIpReservation) GetManageable() bool` + +GetManageable returns the Manageable field if non-nil, zero value otherwise. + +### GetManageableOk + +`func (o *VrfIpReservation) GetManageableOk() (*bool, bool)` + +GetManageableOk returns a tuple with the Manageable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetManageable + +`func (o *VrfIpReservation) SetManageable(v bool)` + +SetManageable sets Manageable field to given value. + +### HasManageable + +`func (o *VrfIpReservation) HasManageable() bool` + +HasManageable returns a boolean if a field has been set. + +### GetCustomdata + +`func (o *VrfIpReservation) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *VrfIpReservation) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *VrfIpReservation) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *VrfIpReservation) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetBill + +`func (o *VrfIpReservation) GetBill() bool` + +GetBill returns the Bill field if non-nil, zero value otherwise. + +### GetBillOk + +`func (o *VrfIpReservation) GetBillOk() (*bool, bool)` + +GetBillOk returns a tuple with the Bill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBill + +`func (o *VrfIpReservation) SetBill(v bool)` + +SetBill sets Bill field to given value. + +### HasBill + +`func (o *VrfIpReservation) HasBill() bool` + +HasBill returns a boolean if a field has been set. + +### GetProjectLite + +`func (o *VrfIpReservation) GetProjectLite() Project` + +GetProjectLite returns the ProjectLite field if non-nil, zero value otherwise. + +### GetProjectLiteOk + +`func (o *VrfIpReservation) GetProjectLiteOk() (*Project, bool)` + +GetProjectLiteOk returns a tuple with the ProjectLite field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectLite + +`func (o *VrfIpReservation) SetProjectLite(v Project)` + +SetProjectLite sets ProjectLite field to given value. + +### HasProjectLite + +`func (o *VrfIpReservation) HasProjectLite() bool` + +HasProjectLite returns a boolean if a field has been set. + +### GetAddress + +`func (o *VrfIpReservation) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *VrfIpReservation) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *VrfIpReservation) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *VrfIpReservation) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetGateway + +`func (o *VrfIpReservation) GetGateway() string` + +GetGateway returns the Gateway field if non-nil, zero value otherwise. + +### GetGatewayOk + +`func (o *VrfIpReservation) GetGatewayOk() (*string, bool)` + +GetGatewayOk returns a tuple with the Gateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGateway + +`func (o *VrfIpReservation) SetGateway(v string)` + +SetGateway sets Gateway field to given value. + +### HasGateway + +`func (o *VrfIpReservation) HasGateway() bool` + +HasGateway returns a boolean if a field has been set. + +### GetMetro + +`func (o *VrfIpReservation) GetMetro() Metro` + +GetMetro returns the Metro field if non-nil, zero value otherwise. + +### GetMetroOk + +`func (o *VrfIpReservation) GetMetroOk() (*Metro, bool)` + +GetMetroOk returns a tuple with the Metro field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetro + +`func (o *VrfIpReservation) SetMetro(v Metro)` + +SetMetro sets Metro field to given value. + +### HasMetro + +`func (o *VrfIpReservation) HasMetro() bool` + +HasMetro returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfIpReservationCreateInput.md b/services/metalv1/docs/VrfIpReservationCreateInput.md new file mode 100644 index 00000000..c318fe8a --- /dev/null +++ b/services/metalv1/docs/VrfIpReservationCreateInput.md @@ -0,0 +1,192 @@ +# VrfIpReservationCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Cidr** | **int32** | The size of the VRF IP Reservation's subnet | +**Customdata** | Pointer to **map[string]interface{}** | | [optional] +**Details** | Pointer to **string** | | [optional] +**Network** | **string** | The starting address for this VRF IP Reservation's subnet | +**Tags** | Pointer to **[]string** | | [optional] +**Type** | **string** | Must be set to 'vrf' | +**VrfId** | **string** | The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. | + +## Methods + +### NewVrfIpReservationCreateInput + +`func NewVrfIpReservationCreateInput(cidr int32, network string, type_ string, vrfId string, ) *VrfIpReservationCreateInput` + +NewVrfIpReservationCreateInput instantiates a new VrfIpReservationCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfIpReservationCreateInputWithDefaults + +`func NewVrfIpReservationCreateInputWithDefaults() *VrfIpReservationCreateInput` + +NewVrfIpReservationCreateInputWithDefaults instantiates a new VrfIpReservationCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCidr + +`func (o *VrfIpReservationCreateInput) GetCidr() int32` + +GetCidr returns the Cidr field if non-nil, zero value otherwise. + +### GetCidrOk + +`func (o *VrfIpReservationCreateInput) GetCidrOk() (*int32, bool)` + +GetCidrOk returns a tuple with the Cidr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCidr + +`func (o *VrfIpReservationCreateInput) SetCidr(v int32)` + +SetCidr sets Cidr field to given value. + + +### GetCustomdata + +`func (o *VrfIpReservationCreateInput) GetCustomdata() map[string]interface{}` + +GetCustomdata returns the Customdata field if non-nil, zero value otherwise. + +### GetCustomdataOk + +`func (o *VrfIpReservationCreateInput) GetCustomdataOk() (*map[string]interface{}, bool)` + +GetCustomdataOk returns a tuple with the Customdata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomdata + +`func (o *VrfIpReservationCreateInput) SetCustomdata(v map[string]interface{})` + +SetCustomdata sets Customdata field to given value. + +### HasCustomdata + +`func (o *VrfIpReservationCreateInput) HasCustomdata() bool` + +HasCustomdata returns a boolean if a field has been set. + +### GetDetails + +`func (o *VrfIpReservationCreateInput) GetDetails() string` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *VrfIpReservationCreateInput) GetDetailsOk() (*string, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *VrfIpReservationCreateInput) SetDetails(v string)` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *VrfIpReservationCreateInput) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetNetwork + +`func (o *VrfIpReservationCreateInput) GetNetwork() string` + +GetNetwork returns the Network field if non-nil, zero value otherwise. + +### GetNetworkOk + +`func (o *VrfIpReservationCreateInput) GetNetworkOk() (*string, bool)` + +GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNetwork + +`func (o *VrfIpReservationCreateInput) SetNetwork(v string)` + +SetNetwork sets Network field to given value. + + +### GetTags + +`func (o *VrfIpReservationCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfIpReservationCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfIpReservationCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfIpReservationCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VrfIpReservationCreateInput) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VrfIpReservationCreateInput) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VrfIpReservationCreateInput) SetType(v string)` + +SetType sets Type field to given value. + + +### GetVrfId + +`func (o *VrfIpReservationCreateInput) GetVrfId() string` + +GetVrfId returns the VrfId field if non-nil, zero value otherwise. + +### GetVrfIdOk + +`func (o *VrfIpReservationCreateInput) GetVrfIdOk() (*string, bool)` + +GetVrfIdOk returns a tuple with the VrfId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrfId + +`func (o *VrfIpReservationCreateInput) SetVrfId(v string)` + +SetVrfId sets VrfId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfIpReservationList.md b/services/metalv1/docs/VrfIpReservationList.md new file mode 100644 index 00000000..54fc3ff0 --- /dev/null +++ b/services/metalv1/docs/VrfIpReservationList.md @@ -0,0 +1,56 @@ +# VrfIpReservationList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpAddresses** | Pointer to [**[]VrfIpReservation**](VrfIpReservation.md) | | [optional] + +## Methods + +### NewVrfIpReservationList + +`func NewVrfIpReservationList() *VrfIpReservationList` + +NewVrfIpReservationList instantiates a new VrfIpReservationList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfIpReservationListWithDefaults + +`func NewVrfIpReservationListWithDefaults() *VrfIpReservationList` + +NewVrfIpReservationListWithDefaults instantiates a new VrfIpReservationList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpAddresses + +`func (o *VrfIpReservationList) GetIpAddresses() []VrfIpReservation` + +GetIpAddresses returns the IpAddresses field if non-nil, zero value otherwise. + +### GetIpAddressesOk + +`func (o *VrfIpReservationList) GetIpAddressesOk() (*[]VrfIpReservation, bool)` + +GetIpAddressesOk returns a tuple with the IpAddresses field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpAddresses + +`func (o *VrfIpReservationList) SetIpAddresses(v []VrfIpReservation)` + +SetIpAddresses sets IpAddresses field to given value. + +### HasIpAddresses + +`func (o *VrfIpReservationList) HasIpAddresses() bool` + +HasIpAddresses returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfIpReservationType.md b/services/metalv1/docs/VrfIpReservationType.md new file mode 100644 index 00000000..7879bbd9 --- /dev/null +++ b/services/metalv1/docs/VrfIpReservationType.md @@ -0,0 +1,11 @@ +# VrfIpReservationType + +## Enum + + +* `VRF` (value: `"vrf"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfList.md b/services/metalv1/docs/VrfList.md new file mode 100644 index 00000000..a964d253 --- /dev/null +++ b/services/metalv1/docs/VrfList.md @@ -0,0 +1,56 @@ +# VrfList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Vrfs** | Pointer to [**[]Vrf**](Vrf.md) | | [optional] + +## Methods + +### NewVrfList + +`func NewVrfList() *VrfList` + +NewVrfList instantiates a new VrfList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfListWithDefaults + +`func NewVrfListWithDefaults() *VrfList` + +NewVrfListWithDefaults instantiates a new VrfList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVrfs + +`func (o *VrfList) GetVrfs() []Vrf` + +GetVrfs returns the Vrfs field if non-nil, zero value otherwise. + +### GetVrfsOk + +`func (o *VrfList) GetVrfsOk() (*[]Vrf, bool)` + +GetVrfsOk returns a tuple with the Vrfs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrfs + +`func (o *VrfList) SetVrfs(v []Vrf)` + +SetVrfs sets Vrfs field to given value. + +### HasVrfs + +`func (o *VrfList) HasVrfs() bool` + +HasVrfs returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfMetalGateway.md b/services/metalv1/docs/VrfMetalGateway.md new file mode 100644 index 00000000..75958533 --- /dev/null +++ b/services/metalv1/docs/VrfMetalGateway.md @@ -0,0 +1,290 @@ +# VrfMetalGateway + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | | [optional] +**CreatedBy** | Pointer to [**Href**](Href.md) | | [optional] +**Href** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**IpReservation** | Pointer to [**VrfIpReservation**](VrfIpReservation.md) | | [optional] +**Project** | Pointer to [**Project**](Project.md) | | [optional] +**State** | Pointer to [**MetalGatewayState**](MetalGatewayState.md) | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] +**VirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**Vrf** | Pointer to [**Vrf**](Vrf.md) | | [optional] + +## Methods + +### NewVrfMetalGateway + +`func NewVrfMetalGateway() *VrfMetalGateway` + +NewVrfMetalGateway instantiates a new VrfMetalGateway object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfMetalGatewayWithDefaults + +`func NewVrfMetalGatewayWithDefaults() *VrfMetalGateway` + +NewVrfMetalGatewayWithDefaults instantiates a new VrfMetalGateway object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *VrfMetalGateway) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VrfMetalGateway) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VrfMetalGateway) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VrfMetalGateway) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreatedBy + +`func (o *VrfMetalGateway) GetCreatedBy() Href` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *VrfMetalGateway) GetCreatedByOk() (*Href, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *VrfMetalGateway) SetCreatedBy(v Href)` + +SetCreatedBy sets CreatedBy field to given value. + +### HasCreatedBy + +`func (o *VrfMetalGateway) HasCreatedBy() bool` + +HasCreatedBy returns a boolean if a field has been set. + +### GetHref + +`func (o *VrfMetalGateway) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *VrfMetalGateway) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *VrfMetalGateway) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *VrfMetalGateway) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetId + +`func (o *VrfMetalGateway) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VrfMetalGateway) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VrfMetalGateway) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VrfMetalGateway) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetIpReservation + +`func (o *VrfMetalGateway) GetIpReservation() VrfIpReservation` + +GetIpReservation returns the IpReservation field if non-nil, zero value otherwise. + +### GetIpReservationOk + +`func (o *VrfMetalGateway) GetIpReservationOk() (*VrfIpReservation, bool)` + +GetIpReservationOk returns a tuple with the IpReservation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservation + +`func (o *VrfMetalGateway) SetIpReservation(v VrfIpReservation)` + +SetIpReservation sets IpReservation field to given value. + +### HasIpReservation + +`func (o *VrfMetalGateway) HasIpReservation() bool` + +HasIpReservation returns a boolean if a field has been set. + +### GetProject + +`func (o *VrfMetalGateway) GetProject() Project` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VrfMetalGateway) GetProjectOk() (*Project, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VrfMetalGateway) SetProject(v Project)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VrfMetalGateway) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetState + +`func (o *VrfMetalGateway) GetState() MetalGatewayState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *VrfMetalGateway) GetStateOk() (*MetalGatewayState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *VrfMetalGateway) SetState(v MetalGatewayState)` + +SetState sets State field to given value. + +### HasState + +`func (o *VrfMetalGateway) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *VrfMetalGateway) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *VrfMetalGateway) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *VrfMetalGateway) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *VrfMetalGateway) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *VrfMetalGateway) GetVirtualNetwork() VirtualNetwork` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *VrfMetalGateway) GetVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *VrfMetalGateway) SetVirtualNetwork(v VirtualNetwork)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *VrfMetalGateway) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVrf + +`func (o *VrfMetalGateway) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VrfMetalGateway) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VrfMetalGateway) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + +### HasVrf + +`func (o *VrfMetalGateway) HasVrf() bool` + +HasVrf returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfMetalGatewayCreateInput.md b/services/metalv1/docs/VrfMetalGatewayCreateInput.md new file mode 100644 index 00000000..36552f17 --- /dev/null +++ b/services/metalv1/docs/VrfMetalGatewayCreateInput.md @@ -0,0 +1,72 @@ +# VrfMetalGatewayCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IpReservationId** | **string** | The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro. | +**VirtualNetworkId** | **string** | THe UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. | + +## Methods + +### NewVrfMetalGatewayCreateInput + +`func NewVrfMetalGatewayCreateInput(ipReservationId string, virtualNetworkId string, ) *VrfMetalGatewayCreateInput` + +NewVrfMetalGatewayCreateInput instantiates a new VrfMetalGatewayCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfMetalGatewayCreateInputWithDefaults + +`func NewVrfMetalGatewayCreateInputWithDefaults() *VrfMetalGatewayCreateInput` + +NewVrfMetalGatewayCreateInputWithDefaults instantiates a new VrfMetalGatewayCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetIpReservationId + +`func (o *VrfMetalGatewayCreateInput) GetIpReservationId() string` + +GetIpReservationId returns the IpReservationId field if non-nil, zero value otherwise. + +### GetIpReservationIdOk + +`func (o *VrfMetalGatewayCreateInput) GetIpReservationIdOk() (*string, bool)` + +GetIpReservationIdOk returns a tuple with the IpReservationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpReservationId + +`func (o *VrfMetalGatewayCreateInput) SetIpReservationId(v string)` + +SetIpReservationId sets IpReservationId field to given value. + + +### GetVirtualNetworkId + +`func (o *VrfMetalGatewayCreateInput) GetVirtualNetworkId() string` + +GetVirtualNetworkId returns the VirtualNetworkId field if non-nil, zero value otherwise. + +### GetVirtualNetworkIdOk + +`func (o *VrfMetalGatewayCreateInput) GetVirtualNetworkIdOk() (*string, bool)` + +GetVirtualNetworkIdOk returns a tuple with the VirtualNetworkId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetworkId + +`func (o *VrfMetalGatewayCreateInput) SetVirtualNetworkId(v string)` + +SetVirtualNetworkId sets VirtualNetworkId field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRoute.md b/services/metalv1/docs/VrfRoute.md new file mode 100644 index 00000000..22f43272 --- /dev/null +++ b/services/metalv1/docs/VrfRoute.md @@ -0,0 +1,342 @@ +# VrfRoute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The unique identifier for the newly-created resource | [optional] [readonly] +**Status** | Pointer to [**VrfRouteStatus**](VrfRouteStatus.md) | | [optional] +**Prefix** | Pointer to **string** | The IPv4 prefix for the route, in CIDR-style notation | [optional] +**NextHop** | Pointer to **string** | The next-hop IPv4 address for the route | [optional] +**Type** | Pointer to [**VrfRouteType**](VrfRouteType.md) | | [optional] +**CreatedAt** | Pointer to **time.Time** | | [optional] [readonly] +**UpdatedAt** | Pointer to **time.Time** | | [optional] [readonly] +**MetalGateway** | Pointer to [**VrfMetalGateway**](VrfMetalGateway.md) | | [optional] +**VirtualNetwork** | Pointer to [**VirtualNetwork**](VirtualNetwork.md) | | [optional] +**Vrf** | Pointer to [**Vrf**](Vrf.md) | | [optional] +**Href** | Pointer to **string** | | [optional] [readonly] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfRoute + +`func NewVrfRoute() *VrfRoute` + +NewVrfRoute instantiates a new VrfRoute object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfRouteWithDefaults + +`func NewVrfRouteWithDefaults() *VrfRoute` + +NewVrfRouteWithDefaults instantiates a new VrfRoute object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *VrfRoute) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VrfRoute) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VrfRoute) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VrfRoute) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetStatus + +`func (o *VrfRoute) GetStatus() VrfRouteStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *VrfRoute) GetStatusOk() (*VrfRouteStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *VrfRoute) SetStatus(v VrfRouteStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *VrfRoute) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetPrefix + +`func (o *VrfRoute) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *VrfRoute) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *VrfRoute) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + +### HasPrefix + +`func (o *VrfRoute) HasPrefix() bool` + +HasPrefix returns a boolean if a field has been set. + +### GetNextHop + +`func (o *VrfRoute) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *VrfRoute) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *VrfRoute) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + +### HasNextHop + +`func (o *VrfRoute) HasNextHop() bool` + +HasNextHop returns a boolean if a field has been set. + +### GetType + +`func (o *VrfRoute) GetType() VrfRouteType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VrfRoute) GetTypeOk() (*VrfRouteType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VrfRoute) SetType(v VrfRouteType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VrfRoute) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *VrfRoute) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VrfRoute) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VrfRoute) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VrfRoute) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *VrfRoute) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *VrfRoute) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *VrfRoute) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *VrfRoute) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetMetalGateway + +`func (o *VrfRoute) GetMetalGateway() VrfMetalGateway` + +GetMetalGateway returns the MetalGateway field if non-nil, zero value otherwise. + +### GetMetalGatewayOk + +`func (o *VrfRoute) GetMetalGatewayOk() (*VrfMetalGateway, bool)` + +GetMetalGatewayOk returns a tuple with the MetalGateway field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalGateway + +`func (o *VrfRoute) SetMetalGateway(v VrfMetalGateway)` + +SetMetalGateway sets MetalGateway field to given value. + +### HasMetalGateway + +`func (o *VrfRoute) HasMetalGateway() bool` + +HasMetalGateway returns a boolean if a field has been set. + +### GetVirtualNetwork + +`func (o *VrfRoute) GetVirtualNetwork() VirtualNetwork` + +GetVirtualNetwork returns the VirtualNetwork field if non-nil, zero value otherwise. + +### GetVirtualNetworkOk + +`func (o *VrfRoute) GetVirtualNetworkOk() (*VirtualNetwork, bool)` + +GetVirtualNetworkOk returns a tuple with the VirtualNetwork field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVirtualNetwork + +`func (o *VrfRoute) SetVirtualNetwork(v VirtualNetwork)` + +SetVirtualNetwork sets VirtualNetwork field to given value. + +### HasVirtualNetwork + +`func (o *VrfRoute) HasVirtualNetwork() bool` + +HasVirtualNetwork returns a boolean if a field has been set. + +### GetVrf + +`func (o *VrfRoute) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VrfRoute) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VrfRoute) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + +### HasVrf + +`func (o *VrfRoute) HasVrf() bool` + +HasVrf returns a boolean if a field has been set. + +### GetHref + +`func (o *VrfRoute) GetHref() string` + +GetHref returns the Href field if non-nil, zero value otherwise. + +### GetHrefOk + +`func (o *VrfRoute) GetHrefOk() (*string, bool)` + +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHref + +`func (o *VrfRoute) SetHref(v string)` + +SetHref sets Href field to given value. + +### HasHref + +`func (o *VrfRoute) HasHref() bool` + +HasHref returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfRoute) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfRoute) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfRoute) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfRoute) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRouteCreateInput.md b/services/metalv1/docs/VrfRouteCreateInput.md new file mode 100644 index 00000000..6d8e6f89 --- /dev/null +++ b/services/metalv1/docs/VrfRouteCreateInput.md @@ -0,0 +1,98 @@ +# VrfRouteCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prefix** | **string** | The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" | +**NextHop** | **string** | The IPv4 address within the VRF of the host that will handle this route | +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfRouteCreateInput + +`func NewVrfRouteCreateInput(prefix string, nextHop string, ) *VrfRouteCreateInput` + +NewVrfRouteCreateInput instantiates a new VrfRouteCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfRouteCreateInputWithDefaults + +`func NewVrfRouteCreateInputWithDefaults() *VrfRouteCreateInput` + +NewVrfRouteCreateInputWithDefaults instantiates a new VrfRouteCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPrefix + +`func (o *VrfRouteCreateInput) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *VrfRouteCreateInput) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *VrfRouteCreateInput) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + + +### GetNextHop + +`func (o *VrfRouteCreateInput) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *VrfRouteCreateInput) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *VrfRouteCreateInput) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + + +### GetTags + +`func (o *VrfRouteCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfRouteCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfRouteCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfRouteCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRouteList.md b/services/metalv1/docs/VrfRouteList.md new file mode 100644 index 00000000..d7783f77 --- /dev/null +++ b/services/metalv1/docs/VrfRouteList.md @@ -0,0 +1,82 @@ +# VrfRouteList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Routes** | Pointer to [**[]VrfRoute**](VrfRoute.md) | | [optional] +**Meta** | Pointer to [**Meta**](Meta.md) | | [optional] + +## Methods + +### NewVrfRouteList + +`func NewVrfRouteList() *VrfRouteList` + +NewVrfRouteList instantiates a new VrfRouteList object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfRouteListWithDefaults + +`func NewVrfRouteListWithDefaults() *VrfRouteList` + +NewVrfRouteListWithDefaults instantiates a new VrfRouteList object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRoutes + +`func (o *VrfRouteList) GetRoutes() []VrfRoute` + +GetRoutes returns the Routes field if non-nil, zero value otherwise. + +### GetRoutesOk + +`func (o *VrfRouteList) GetRoutesOk() (*[]VrfRoute, bool)` + +GetRoutesOk returns a tuple with the Routes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoutes + +`func (o *VrfRouteList) SetRoutes(v []VrfRoute)` + +SetRoutes sets Routes field to given value. + +### HasRoutes + +`func (o *VrfRouteList) HasRoutes() bool` + +HasRoutes returns a boolean if a field has been set. + +### GetMeta + +`func (o *VrfRouteList) GetMeta() Meta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *VrfRouteList) GetMetaOk() (*Meta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *VrfRouteList) SetMeta(v Meta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *VrfRouteList) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRouteStatus.md b/services/metalv1/docs/VrfRouteStatus.md new file mode 100644 index 00000000..0c1f512d --- /dev/null +++ b/services/metalv1/docs/VrfRouteStatus.md @@ -0,0 +1,17 @@ +# VrfRouteStatus + +## Enum + + +* `PENDING` (value: `"pending"`) + +* `ACTIVE` (value: `"active"`) + +* `DELETING` (value: `"deleting"`) + +* `ERROR` (value: `"error"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRouteType.md b/services/metalv1/docs/VrfRouteType.md new file mode 100644 index 00000000..010fc5a9 --- /dev/null +++ b/services/metalv1/docs/VrfRouteType.md @@ -0,0 +1,11 @@ +# VrfRouteType + +## Enum + + +* `STATIC` (value: `"static"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfRouteUpdateInput.md b/services/metalv1/docs/VrfRouteUpdateInput.md new file mode 100644 index 00000000..bceb3d09 --- /dev/null +++ b/services/metalv1/docs/VrfRouteUpdateInput.md @@ -0,0 +1,108 @@ +# VrfRouteUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prefix** | Pointer to **string** | The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" | [optional] +**NextHop** | Pointer to **string** | The IPv4 address within the VRF of the host that will handle this route | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfRouteUpdateInput + +`func NewVrfRouteUpdateInput() *VrfRouteUpdateInput` + +NewVrfRouteUpdateInput instantiates a new VrfRouteUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfRouteUpdateInputWithDefaults + +`func NewVrfRouteUpdateInputWithDefaults() *VrfRouteUpdateInput` + +NewVrfRouteUpdateInputWithDefaults instantiates a new VrfRouteUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPrefix + +`func (o *VrfRouteUpdateInput) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *VrfRouteUpdateInput) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *VrfRouteUpdateInput) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + +### HasPrefix + +`func (o *VrfRouteUpdateInput) HasPrefix() bool` + +HasPrefix returns a boolean if a field has been set. + +### GetNextHop + +`func (o *VrfRouteUpdateInput) GetNextHop() string` + +GetNextHop returns the NextHop field if non-nil, zero value otherwise. + +### GetNextHopOk + +`func (o *VrfRouteUpdateInput) GetNextHopOk() (*string, bool)` + +GetNextHopOk returns a tuple with the NextHop field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextHop + +`func (o *VrfRouteUpdateInput) SetNextHop(v string)` + +SetNextHop sets NextHop field to given value. + +### HasNextHop + +`func (o *VrfRouteUpdateInput) HasNextHop() bool` + +HasNextHop returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfRouteUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfRouteUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfRouteUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfRouteUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfUpdateInput.md b/services/metalv1/docs/VrfUpdateInput.md new file mode 100644 index 00000000..810c07cb --- /dev/null +++ b/services/metalv1/docs/VrfUpdateInput.md @@ -0,0 +1,238 @@ +# VrfUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BgpDynamicNeighborsEnabled** | Pointer to **bool** | Toggle to enable the dynamic bgp neighbors feature on the VRF | [optional] +**BgpDynamicNeighborsExportRouteMap** | Pointer to **bool** | Toggle to export the VRF route-map to the dynamic bgp neighbors | [optional] +**BgpDynamicNeighborsBfdEnabled** | Pointer to **bool** | Toggle BFD on dynamic bgp neighbors sessions | [optional] +**Description** | Pointer to **string** | | [optional] +**IpRanges** | Pointer to **[]string** | A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF. | [optional] +**LocalAsn** | Pointer to **int32** | The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. | [optional] +**Name** | Pointer to **string** | | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfUpdateInput + +`func NewVrfUpdateInput() *VrfUpdateInput` + +NewVrfUpdateInput instantiates a new VrfUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfUpdateInputWithDefaults + +`func NewVrfUpdateInputWithDefaults() *VrfUpdateInput` + +NewVrfUpdateInputWithDefaults instantiates a new VrfUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBgpDynamicNeighborsEnabled + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsEnabled() bool` + +GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsEnabledOk + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsEnabled + +`func (o *VrfUpdateInput) SetBgpDynamicNeighborsEnabled(v bool)` + +SetBgpDynamicNeighborsEnabled sets BgpDynamicNeighborsEnabled field to given value. + +### HasBgpDynamicNeighborsEnabled + +`func (o *VrfUpdateInput) HasBgpDynamicNeighborsEnabled() bool` + +HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsExportRouteMap + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsExportRouteMap() bool` + +GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsExportRouteMapOk + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool)` + +GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsExportRouteMap + +`func (o *VrfUpdateInput) SetBgpDynamicNeighborsExportRouteMap(v bool)` + +SetBgpDynamicNeighborsExportRouteMap sets BgpDynamicNeighborsExportRouteMap field to given value. + +### HasBgpDynamicNeighborsExportRouteMap + +`func (o *VrfUpdateInput) HasBgpDynamicNeighborsExportRouteMap() bool` + +HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. + +### GetBgpDynamicNeighborsBfdEnabled + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsBfdEnabled() bool` + +GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field if non-nil, zero value otherwise. + +### GetBgpDynamicNeighborsBfdEnabledOk + +`func (o *VrfUpdateInput) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool)` + +GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBgpDynamicNeighborsBfdEnabled + +`func (o *VrfUpdateInput) SetBgpDynamicNeighborsBfdEnabled(v bool)` + +SetBgpDynamicNeighborsBfdEnabled sets BgpDynamicNeighborsBfdEnabled field to given value. + +### HasBgpDynamicNeighborsBfdEnabled + +`func (o *VrfUpdateInput) HasBgpDynamicNeighborsBfdEnabled() bool` + +HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetIpRanges + +`func (o *VrfUpdateInput) GetIpRanges() []string` + +GetIpRanges returns the IpRanges field if non-nil, zero value otherwise. + +### GetIpRangesOk + +`func (o *VrfUpdateInput) GetIpRangesOk() (*[]string, bool)` + +GetIpRangesOk returns a tuple with the IpRanges field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIpRanges + +`func (o *VrfUpdateInput) SetIpRanges(v []string)` + +SetIpRanges sets IpRanges field to given value. + +### HasIpRanges + +`func (o *VrfUpdateInput) HasIpRanges() bool` + +HasIpRanges returns a boolean if a field has been set. + +### GetLocalAsn + +`func (o *VrfUpdateInput) GetLocalAsn() int32` + +GetLocalAsn returns the LocalAsn field if non-nil, zero value otherwise. + +### GetLocalAsnOk + +`func (o *VrfUpdateInput) GetLocalAsnOk() (*int32, bool)` + +GetLocalAsnOk returns a tuple with the LocalAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocalAsn + +`func (o *VrfUpdateInput) SetLocalAsn(v int32)` + +SetLocalAsn sets LocalAsn field to given value. + +### HasLocalAsn + +`func (o *VrfUpdateInput) HasLocalAsn() bool` + +HasLocalAsn returns a boolean if a field has been set. + +### GetName + +`func (o *VrfUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VrfUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfVirtualCircuit.md b/services/metalv1/docs/VrfVirtualCircuit.md new file mode 100644 index 00000000..63b022c6 --- /dev/null +++ b/services/metalv1/docs/VrfVirtualCircuit.md @@ -0,0 +1,493 @@ +# VrfVirtualCircuit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Description** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Md5** | Pointer to **string** | The MD5 password for the BGP peering in plaintext (not a checksum). | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**Name** | Pointer to **string** | | [optional] +**Port** | Pointer to [**Href**](Href.md) | | [optional] +**NniVlan** | Pointer to **int32** | | [optional] +**PeerAsn** | Pointer to **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**Project** | Pointer to [**Href**](Href.md) | | [optional] +**Speed** | Pointer to **int32** | integer representing bps speed | [optional] +**Status** | Pointer to [**VrfVirtualCircuitStatus**](VrfVirtualCircuitStatus.md) | | [optional] +**Subnet** | Pointer to **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**Tags** | Pointer to **[]string** | | [optional] +**Type** | Pointer to [**VrfIpReservationType**](VrfIpReservationType.md) | | [optional] +**Vrf** | [**Vrf**](Vrf.md) | | +**CreatedAt** | Pointer to **time.Time** | | [optional] +**UpdatedAt** | Pointer to **time.Time** | | [optional] + +## Methods + +### NewVrfVirtualCircuit + +`func NewVrfVirtualCircuit(vrf Vrf, ) *VrfVirtualCircuit` + +NewVrfVirtualCircuit instantiates a new VrfVirtualCircuit object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfVirtualCircuitWithDefaults + +`func NewVrfVirtualCircuitWithDefaults() *VrfVirtualCircuit` + +NewVrfVirtualCircuitWithDefaults instantiates a new VrfVirtualCircuit object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerIp + +`func (o *VrfVirtualCircuit) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VrfVirtualCircuit) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VrfVirtualCircuit) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VrfVirtualCircuit) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfVirtualCircuit) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfVirtualCircuit) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfVirtualCircuit) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfVirtualCircuit) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetId + +`func (o *VrfVirtualCircuit) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *VrfVirtualCircuit) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *VrfVirtualCircuit) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *VrfVirtualCircuit) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VrfVirtualCircuit) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VrfVirtualCircuit) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VrfVirtualCircuit) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VrfVirtualCircuit) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### GetMetalIp + +`func (o *VrfVirtualCircuit) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VrfVirtualCircuit) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VrfVirtualCircuit) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VrfVirtualCircuit) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetName + +`func (o *VrfVirtualCircuit) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfVirtualCircuit) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfVirtualCircuit) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VrfVirtualCircuit) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPort + +`func (o *VrfVirtualCircuit) GetPort() Href` + +GetPort returns the Port field if non-nil, zero value otherwise. + +### GetPortOk + +`func (o *VrfVirtualCircuit) GetPortOk() (*Href, bool)` + +GetPortOk returns a tuple with the Port field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPort + +`func (o *VrfVirtualCircuit) SetPort(v Href)` + +SetPort sets Port field to given value. + +### HasPort + +`func (o *VrfVirtualCircuit) HasPort() bool` + +HasPort returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VrfVirtualCircuit) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VrfVirtualCircuit) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VrfVirtualCircuit) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + +### HasNniVlan + +`func (o *VrfVirtualCircuit) HasNniVlan() bool` + +HasNniVlan returns a boolean if a field has been set. + +### GetPeerAsn + +`func (o *VrfVirtualCircuit) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VrfVirtualCircuit) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VrfVirtualCircuit) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + +### HasPeerAsn + +`func (o *VrfVirtualCircuit) HasPeerAsn() bool` + +HasPeerAsn returns a boolean if a field has been set. + +### GetProject + +`func (o *VrfVirtualCircuit) GetProject() Href` + +GetProject returns the Project field if non-nil, zero value otherwise. + +### GetProjectOk + +`func (o *VrfVirtualCircuit) GetProjectOk() (*Href, bool)` + +GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProject + +`func (o *VrfVirtualCircuit) SetProject(v Href)` + +SetProject sets Project field to given value. + +### HasProject + +`func (o *VrfVirtualCircuit) HasProject() bool` + +HasProject returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VrfVirtualCircuit) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VrfVirtualCircuit) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VrfVirtualCircuit) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VrfVirtualCircuit) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetStatus + +`func (o *VrfVirtualCircuit) GetStatus() VrfVirtualCircuitStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *VrfVirtualCircuit) GetStatusOk() (*VrfVirtualCircuitStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *VrfVirtualCircuit) SetStatus(v VrfVirtualCircuitStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *VrfVirtualCircuit) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetSubnet + +`func (o *VrfVirtualCircuit) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VrfVirtualCircuit) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VrfVirtualCircuit) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + +### HasSubnet + +`func (o *VrfVirtualCircuit) HasSubnet() bool` + +HasSubnet returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfVirtualCircuit) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfVirtualCircuit) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfVirtualCircuit) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfVirtualCircuit) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetType + +`func (o *VrfVirtualCircuit) GetType() VrfIpReservationType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *VrfVirtualCircuit) GetTypeOk() (*VrfIpReservationType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *VrfVirtualCircuit) SetType(v VrfIpReservationType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *VrfVirtualCircuit) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetVrf + +`func (o *VrfVirtualCircuit) GetVrf() Vrf` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VrfVirtualCircuit) GetVrfOk() (*Vrf, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VrfVirtualCircuit) SetVrf(v Vrf)` + +SetVrf sets Vrf field to given value. + + +### GetCreatedAt + +`func (o *VrfVirtualCircuit) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *VrfVirtualCircuit) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *VrfVirtualCircuit) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *VrfVirtualCircuit) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *VrfVirtualCircuit) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *VrfVirtualCircuit) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *VrfVirtualCircuit) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *VrfVirtualCircuit) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfVirtualCircuitCreateInput.md b/services/metalv1/docs/VrfVirtualCircuitCreateInput.md new file mode 100644 index 00000000..ca5d1385 --- /dev/null +++ b/services/metalv1/docs/VrfVirtualCircuitCreateInput.md @@ -0,0 +1,327 @@ +# VrfVirtualCircuitCreateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Description** | Pointer to **string** | | [optional] +**Md5** | Pointer to **NullableString** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**Name** | Pointer to **string** | | [optional] +**NniVlan** | **int32** | | +**PeerAsn** | **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | +**ProjectId** | **string** | | +**Speed** | Pointer to **int32** | speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') | [optional] +**Subnet** | **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF. | +**Tags** | Pointer to **[]string** | | [optional] +**Vrf** | **string** | The UUID of the VRF that will be associated with the Virtual Circuit. | + +## Methods + +### NewVrfVirtualCircuitCreateInput + +`func NewVrfVirtualCircuitCreateInput(nniVlan int32, peerAsn int32, projectId string, subnet string, vrf string, ) *VrfVirtualCircuitCreateInput` + +NewVrfVirtualCircuitCreateInput instantiates a new VrfVirtualCircuitCreateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfVirtualCircuitCreateInputWithDefaults + +`func NewVrfVirtualCircuitCreateInputWithDefaults() *VrfVirtualCircuitCreateInput` + +NewVrfVirtualCircuitCreateInputWithDefaults instantiates a new VrfVirtualCircuitCreateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerIp + +`func (o *VrfVirtualCircuitCreateInput) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VrfVirtualCircuitCreateInput) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VrfVirtualCircuitCreateInput) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VrfVirtualCircuitCreateInput) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfVirtualCircuitCreateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfVirtualCircuitCreateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfVirtualCircuitCreateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfVirtualCircuitCreateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VrfVirtualCircuitCreateInput) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VrfVirtualCircuitCreateInput) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VrfVirtualCircuitCreateInput) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VrfVirtualCircuitCreateInput) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### SetMd5Nil + +`func (o *VrfVirtualCircuitCreateInput) SetMd5Nil(b bool)` + + SetMd5Nil sets the value for Md5 to be an explicit nil + +### UnsetMd5 +`func (o *VrfVirtualCircuitCreateInput) UnsetMd5()` + +UnsetMd5 ensures that no value is present for Md5, not even an explicit nil +### GetMetalIp + +`func (o *VrfVirtualCircuitCreateInput) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VrfVirtualCircuitCreateInput) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VrfVirtualCircuitCreateInput) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VrfVirtualCircuitCreateInput) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetName + +`func (o *VrfVirtualCircuitCreateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfVirtualCircuitCreateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfVirtualCircuitCreateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VrfVirtualCircuitCreateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetNniVlan + +`func (o *VrfVirtualCircuitCreateInput) GetNniVlan() int32` + +GetNniVlan returns the NniVlan field if non-nil, zero value otherwise. + +### GetNniVlanOk + +`func (o *VrfVirtualCircuitCreateInput) GetNniVlanOk() (*int32, bool)` + +GetNniVlanOk returns a tuple with the NniVlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNniVlan + +`func (o *VrfVirtualCircuitCreateInput) SetNniVlan(v int32)` + +SetNniVlan sets NniVlan field to given value. + + +### GetPeerAsn + +`func (o *VrfVirtualCircuitCreateInput) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VrfVirtualCircuitCreateInput) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VrfVirtualCircuitCreateInput) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + + +### GetProjectId + +`func (o *VrfVirtualCircuitCreateInput) GetProjectId() string` + +GetProjectId returns the ProjectId field if non-nil, zero value otherwise. + +### GetProjectIdOk + +`func (o *VrfVirtualCircuitCreateInput) GetProjectIdOk() (*string, bool)` + +GetProjectIdOk returns a tuple with the ProjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProjectId + +`func (o *VrfVirtualCircuitCreateInput) SetProjectId(v string)` + +SetProjectId sets ProjectId field to given value. + + +### GetSpeed + +`func (o *VrfVirtualCircuitCreateInput) GetSpeed() int32` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VrfVirtualCircuitCreateInput) GetSpeedOk() (*int32, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VrfVirtualCircuitCreateInput) SetSpeed(v int32)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VrfVirtualCircuitCreateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetSubnet + +`func (o *VrfVirtualCircuitCreateInput) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VrfVirtualCircuitCreateInput) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VrfVirtualCircuitCreateInput) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + + +### GetTags + +`func (o *VrfVirtualCircuitCreateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfVirtualCircuitCreateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfVirtualCircuitCreateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfVirtualCircuitCreateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetVrf + +`func (o *VrfVirtualCircuitCreateInput) GetVrf() string` + +GetVrf returns the Vrf field if non-nil, zero value otherwise. + +### GetVrfOk + +`func (o *VrfVirtualCircuitCreateInput) GetVrfOk() (*string, bool)` + +GetVrfOk returns a tuple with the Vrf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVrf + +`func (o *VrfVirtualCircuitCreateInput) SetVrf(v string)` + +SetVrf sets Vrf field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfVirtualCircuitStatus.md b/services/metalv1/docs/VrfVirtualCircuitStatus.md new file mode 100644 index 00000000..01efd26e --- /dev/null +++ b/services/metalv1/docs/VrfVirtualCircuitStatus.md @@ -0,0 +1,33 @@ +# VrfVirtualCircuitStatus + +## Enum + + +* `PENDING` (value: `"pending"`) + +* `WAITING_ON_PEERING_DETAILS` (value: `"waiting_on_peering_details"`) + +* `ACTIVATING` (value: `"activating"`) + +* `CHANGING_PEERING_DETAILS` (value: `"changing_peering_details"`) + +* `DEACTIVATING` (value: `"deactivating"`) + +* `DELETING` (value: `"deleting"`) + +* `ACTIVE` (value: `"active"`) + +* `EXPIRED` (value: `"expired"`) + +* `ACTIVATION_FAILED` (value: `"activation_failed"`) + +* `CHANGING_PEERING_DETAILS_FAILED` (value: `"changing_peering_details_failed"`) + +* `DEACTIVATION_FAILED` (value: `"deactivation_failed"`) + +* `DELETE_FAILED` (value: `"delete_failed"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md b/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md new file mode 100644 index 00000000..61884231 --- /dev/null +++ b/services/metalv1/docs/VrfVirtualCircuitUpdateInput.md @@ -0,0 +1,264 @@ +# VrfVirtualCircuitUpdateInput + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CustomerIp** | Pointer to **string** | An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. | [optional] +**Description** | Pointer to **string** | | [optional] +**Md5** | Pointer to **string** | The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character | [optional] +**MetalIp** | Pointer to **string** | An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. | [optional] +**Name** | Pointer to **string** | | [optional] +**PeerAsn** | Pointer to **int32** | The peer ASN that will be used with the VRF on the Virtual Circuit. | [optional] +**Speed** | Pointer to **string** | Speed can be changed only if it is an interconnection on a Dedicated Port | [optional] +**Subnet** | Pointer to **string** | The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. | [optional] +**Tags** | Pointer to **[]string** | | [optional] + +## Methods + +### NewVrfVirtualCircuitUpdateInput + +`func NewVrfVirtualCircuitUpdateInput() *VrfVirtualCircuitUpdateInput` + +NewVrfVirtualCircuitUpdateInput instantiates a new VrfVirtualCircuitUpdateInput object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVrfVirtualCircuitUpdateInputWithDefaults + +`func NewVrfVirtualCircuitUpdateInputWithDefaults() *VrfVirtualCircuitUpdateInput` + +NewVrfVirtualCircuitUpdateInputWithDefaults instantiates a new VrfVirtualCircuitUpdateInput object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCustomerIp + +`func (o *VrfVirtualCircuitUpdateInput) GetCustomerIp() string` + +GetCustomerIp returns the CustomerIp field if non-nil, zero value otherwise. + +### GetCustomerIpOk + +`func (o *VrfVirtualCircuitUpdateInput) GetCustomerIpOk() (*string, bool)` + +GetCustomerIpOk returns a tuple with the CustomerIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerIp + +`func (o *VrfVirtualCircuitUpdateInput) SetCustomerIp(v string)` + +SetCustomerIp sets CustomerIp field to given value. + +### HasCustomerIp + +`func (o *VrfVirtualCircuitUpdateInput) HasCustomerIp() bool` + +HasCustomerIp returns a boolean if a field has been set. + +### GetDescription + +`func (o *VrfVirtualCircuitUpdateInput) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *VrfVirtualCircuitUpdateInput) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *VrfVirtualCircuitUpdateInput) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *VrfVirtualCircuitUpdateInput) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetMd5 + +`func (o *VrfVirtualCircuitUpdateInput) GetMd5() string` + +GetMd5 returns the Md5 field if non-nil, zero value otherwise. + +### GetMd5Ok + +`func (o *VrfVirtualCircuitUpdateInput) GetMd5Ok() (*string, bool)` + +GetMd5Ok returns a tuple with the Md5 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMd5 + +`func (o *VrfVirtualCircuitUpdateInput) SetMd5(v string)` + +SetMd5 sets Md5 field to given value. + +### HasMd5 + +`func (o *VrfVirtualCircuitUpdateInput) HasMd5() bool` + +HasMd5 returns a boolean if a field has been set. + +### GetMetalIp + +`func (o *VrfVirtualCircuitUpdateInput) GetMetalIp() string` + +GetMetalIp returns the MetalIp field if non-nil, zero value otherwise. + +### GetMetalIpOk + +`func (o *VrfVirtualCircuitUpdateInput) GetMetalIpOk() (*string, bool)` + +GetMetalIpOk returns a tuple with the MetalIp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetalIp + +`func (o *VrfVirtualCircuitUpdateInput) SetMetalIp(v string)` + +SetMetalIp sets MetalIp field to given value. + +### HasMetalIp + +`func (o *VrfVirtualCircuitUpdateInput) HasMetalIp() bool` + +HasMetalIp returns a boolean if a field has been set. + +### GetName + +`func (o *VrfVirtualCircuitUpdateInput) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *VrfVirtualCircuitUpdateInput) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *VrfVirtualCircuitUpdateInput) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *VrfVirtualCircuitUpdateInput) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPeerAsn + +`func (o *VrfVirtualCircuitUpdateInput) GetPeerAsn() int32` + +GetPeerAsn returns the PeerAsn field if non-nil, zero value otherwise. + +### GetPeerAsnOk + +`func (o *VrfVirtualCircuitUpdateInput) GetPeerAsnOk() (*int32, bool)` + +GetPeerAsnOk returns a tuple with the PeerAsn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeerAsn + +`func (o *VrfVirtualCircuitUpdateInput) SetPeerAsn(v int32)` + +SetPeerAsn sets PeerAsn field to given value. + +### HasPeerAsn + +`func (o *VrfVirtualCircuitUpdateInput) HasPeerAsn() bool` + +HasPeerAsn returns a boolean if a field has been set. + +### GetSpeed + +`func (o *VrfVirtualCircuitUpdateInput) GetSpeed() string` + +GetSpeed returns the Speed field if non-nil, zero value otherwise. + +### GetSpeedOk + +`func (o *VrfVirtualCircuitUpdateInput) GetSpeedOk() (*string, bool)` + +GetSpeedOk returns a tuple with the Speed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpeed + +`func (o *VrfVirtualCircuitUpdateInput) SetSpeed(v string)` + +SetSpeed sets Speed field to given value. + +### HasSpeed + +`func (o *VrfVirtualCircuitUpdateInput) HasSpeed() bool` + +HasSpeed returns a boolean if a field has been set. + +### GetSubnet + +`func (o *VrfVirtualCircuitUpdateInput) GetSubnet() string` + +GetSubnet returns the Subnet field if non-nil, zero value otherwise. + +### GetSubnetOk + +`func (o *VrfVirtualCircuitUpdateInput) GetSubnetOk() (*string, bool)` + +GetSubnetOk returns a tuple with the Subnet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubnet + +`func (o *VrfVirtualCircuitUpdateInput) SetSubnet(v string)` + +SetSubnet sets Subnet field to given value. + +### HasSubnet + +`func (o *VrfVirtualCircuitUpdateInput) HasSubnet() bool` + +HasSubnet returns a boolean if a field has been set. + +### GetTags + +`func (o *VrfVirtualCircuitUpdateInput) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *VrfVirtualCircuitUpdateInput) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *VrfVirtualCircuitUpdateInput) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *VrfVirtualCircuitUpdateInput) HasTags() bool` + +HasTags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/services/metalv1/model_activate_hardware_reservation_request.go b/services/metalv1/model_activate_hardware_reservation_request.go new file mode 100644 index 00000000..a16aa056 --- /dev/null +++ b/services/metalv1/model_activate_hardware_reservation_request.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ActivateHardwareReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActivateHardwareReservationRequest{} + +// ActivateHardwareReservationRequest struct for ActivateHardwareReservationRequest +type ActivateHardwareReservationRequest struct { + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ActivateHardwareReservationRequest ActivateHardwareReservationRequest + +// NewActivateHardwareReservationRequest instantiates a new ActivateHardwareReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActivateHardwareReservationRequest() *ActivateHardwareReservationRequest { + this := ActivateHardwareReservationRequest{} + return &this +} + +// NewActivateHardwareReservationRequestWithDefaults instantiates a new ActivateHardwareReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActivateHardwareReservationRequestWithDefaults() *ActivateHardwareReservationRequest { + this := ActivateHardwareReservationRequest{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ActivateHardwareReservationRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActivateHardwareReservationRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ActivateHardwareReservationRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ActivateHardwareReservationRequest) SetDescription(v string) { + o.Description = &v +} + +func (o ActivateHardwareReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActivateHardwareReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ActivateHardwareReservationRequest) UnmarshalJSON(bytes []byte) (err error) { + varActivateHardwareReservationRequest := _ActivateHardwareReservationRequest{} + + err = json.Unmarshal(bytes, &varActivateHardwareReservationRequest) + + if err != nil { + return err + } + + *o = ActivateHardwareReservationRequest(varActivateHardwareReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableActivateHardwareReservationRequest struct { + value *ActivateHardwareReservationRequest + isSet bool +} + +func (v NullableActivateHardwareReservationRequest) Get() *ActivateHardwareReservationRequest { + return v.value +} + +func (v *NullableActivateHardwareReservationRequest) Set(val *ActivateHardwareReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableActivateHardwareReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableActivateHardwareReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActivateHardwareReservationRequest(val *ActivateHardwareReservationRequest) *NullableActivateHardwareReservationRequest { + return &NullableActivateHardwareReservationRequest{value: val, isSet: true} +} + +func (v NullableActivateHardwareReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActivateHardwareReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_address.go b/services/metalv1/model_address.go new file mode 100644 index 00000000..7b3ce2e3 --- /dev/null +++ b/services/metalv1/model_address.go @@ -0,0 +1,373 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the Address type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Address{} + +// Address struct for Address +type Address struct { + Address string `json:"address"` + Address2 *string `json:"address2,omitempty"` + City *string `json:"city,omitempty"` + Coordinates *Coordinates `json:"coordinates,omitempty"` + Country string `json:"country"` + State *string `json:"state,omitempty"` + ZipCode string `json:"zip_code"` + AdditionalProperties map[string]interface{} +} + +type _Address Address + +// NewAddress instantiates a new Address object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddress(address string, country string, zipCode string) *Address { + this := Address{} + this.Address = address + this.Country = country + this.ZipCode = zipCode + return &this +} + +// NewAddressWithDefaults instantiates a new Address object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddressWithDefaults() *Address { + this := Address{} + return &this +} + +// GetAddress returns the Address field value +func (o *Address) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *Address) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *Address) SetAddress(v string) { + o.Address = v +} + +// GetAddress2 returns the Address2 field value if set, zero value otherwise. +func (o *Address) GetAddress2() string { + if o == nil || IsNil(o.Address2) { + var ret string + return ret + } + return *o.Address2 +} + +// GetAddress2Ok returns a tuple with the Address2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetAddress2Ok() (*string, bool) { + if o == nil || IsNil(o.Address2) { + return nil, false + } + return o.Address2, true +} + +// HasAddress2 returns a boolean if a field has been set. +func (o *Address) HasAddress2() bool { + if o != nil && !IsNil(o.Address2) { + return true + } + + return false +} + +// SetAddress2 gets a reference to the given string and assigns it to the Address2 field. +func (o *Address) SetAddress2(v string) { + o.Address2 = &v +} + +// GetCity returns the City field value if set, zero value otherwise. +func (o *Address) GetCity() string { + if o == nil || IsNil(o.City) { + var ret string + return ret + } + return *o.City +} + +// GetCityOk returns a tuple with the City field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetCityOk() (*string, bool) { + if o == nil || IsNil(o.City) { + return nil, false + } + return o.City, true +} + +// HasCity returns a boolean if a field has been set. +func (o *Address) HasCity() bool { + if o != nil && !IsNil(o.City) { + return true + } + + return false +} + +// SetCity gets a reference to the given string and assigns it to the City field. +func (o *Address) SetCity(v string) { + o.City = &v +} + +// GetCoordinates returns the Coordinates field value if set, zero value otherwise. +func (o *Address) GetCoordinates() Coordinates { + if o == nil || IsNil(o.Coordinates) { + var ret Coordinates + return ret + } + return *o.Coordinates +} + +// GetCoordinatesOk returns a tuple with the Coordinates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetCoordinatesOk() (*Coordinates, bool) { + if o == nil || IsNil(o.Coordinates) { + return nil, false + } + return o.Coordinates, true +} + +// HasCoordinates returns a boolean if a field has been set. +func (o *Address) HasCoordinates() bool { + if o != nil && !IsNil(o.Coordinates) { + return true + } + + return false +} + +// SetCoordinates gets a reference to the given Coordinates and assigns it to the Coordinates field. +func (o *Address) SetCoordinates(v Coordinates) { + o.Coordinates = &v +} + +// GetCountry returns the Country field value +func (o *Address) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *Address) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *Address) SetCountry(v string) { + o.Country = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Address) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Address) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *Address) SetState(v string) { + o.State = &v +} + +// GetZipCode returns the ZipCode field value +func (o *Address) GetZipCode() string { + if o == nil { + var ret string + return ret + } + + return o.ZipCode +} + +// GetZipCodeOk returns a tuple with the ZipCode field value +// and a boolean to check if the value has been set. +func (o *Address) GetZipCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ZipCode, true +} + +// SetZipCode sets field value +func (o *Address) SetZipCode(v string) { + o.ZipCode = v +} + +func (o Address) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Address) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if !IsNil(o.Address2) { + toSerialize["address2"] = o.Address2 + } + if !IsNil(o.City) { + toSerialize["city"] = o.City + } + if !IsNil(o.Coordinates) { + toSerialize["coordinates"] = o.Coordinates + } + toSerialize["country"] = o.Country + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + toSerialize["zip_code"] = o.ZipCode + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Address) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + "country", + "zip_code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddress := _Address{} + + err = json.Unmarshal(bytes, &varAddress) + + if err != nil { + return err + } + + *o = Address(varAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "address2") + delete(additionalProperties, "city") + delete(additionalProperties, "coordinates") + delete(additionalProperties, "country") + delete(additionalProperties, "state") + delete(additionalProperties, "zip_code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAddress struct { + value *Address + isSet bool +} + +func (v NullableAddress) Get() *Address { + return v.value +} + +func (v *NullableAddress) Set(val *Address) { + v.value = val + v.isSet = true +} + +func (v NullableAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddress(val *Address) *NullableAddress { + return &NullableAddress{value: val, isSet: true} +} + +func (v NullableAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_attribute.go b/services/metalv1/model_attribute.go new file mode 100644 index 00000000..93e1810e --- /dev/null +++ b/services/metalv1/model_attribute.go @@ -0,0 +1,269 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Attribute type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Attribute{} + +// Attribute struct for Attribute +type Attribute struct { + // Attribute namespace + Namespace *string `json:"namespace,omitempty"` + // Datetime when the block was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Datetime when the block was updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Data *AttributeData `json:"data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Attribute Attribute + +// NewAttribute instantiates a new Attribute object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAttribute() *Attribute { + this := Attribute{} + return &this +} + +// NewAttributeWithDefaults instantiates a new Attribute object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAttributeWithDefaults() *Attribute { + this := Attribute{} + return &this +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *Attribute) GetNamespace() string { + if o == nil || IsNil(o.Namespace) { + var ret string + return ret + } + return *o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Attribute) GetNamespaceOk() (*string, bool) { + if o == nil || IsNil(o.Namespace) { + return nil, false + } + return o.Namespace, true +} + +// HasNamespace returns a boolean if a field has been set. +func (o *Attribute) HasNamespace() bool { + if o != nil && !IsNil(o.Namespace) { + return true + } + + return false +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *Attribute) SetNamespace(v string) { + o.Namespace = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Attribute) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Attribute) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Attribute) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Attribute) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Attribute) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Attribute) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Attribute) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Attribute) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *Attribute) GetData() AttributeData { + if o == nil || IsNil(o.Data) { + var ret AttributeData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Attribute) GetDataOk() (*AttributeData, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *Attribute) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given AttributeData and assigns it to the Data field. +func (o *Attribute) SetData(v AttributeData) { + o.Data = &v +} + +func (o Attribute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Attribute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Namespace) { + toSerialize["namespace"] = o.Namespace + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Attribute) UnmarshalJSON(bytes []byte) (err error) { + varAttribute := _Attribute{} + + err = json.Unmarshal(bytes, &varAttribute) + + if err != nil { + return err + } + + *o = Attribute(varAttribute) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "namespace") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAttribute struct { + value *Attribute + isSet bool +} + +func (v NullableAttribute) Get() *Attribute { + return v.value +} + +func (v *NullableAttribute) Set(val *Attribute) { + v.value = val + v.isSet = true +} + +func (v NullableAttribute) IsSet() bool { + return v.isSet +} + +func (v *NullableAttribute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAttribute(val *Attribute) *NullableAttribute { + return &NullableAttribute{value: val, isSet: true} +} + +func (v NullableAttribute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAttribute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_attribute_data.go b/services/metalv1/model_attribute_data.go new file mode 100644 index 00000000..b4d8b698 --- /dev/null +++ b/services/metalv1/model_attribute_data.go @@ -0,0 +1,269 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the AttributeData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AttributeData{} + +// AttributeData struct for AttributeData +type AttributeData struct { + // Boolean flag to know if the firmware set is the latest for the model and vendor + Latest *bool `json:"latest,omitempty"` + // Model on which this firmware set can be applied + Model *string `json:"model,omitempty"` + // Vendor on which this firmware set can be applied + Vendor *string `json:"vendor,omitempty"` + // Plan where the firmware set can be applied + Plan *string `json:"plan,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AttributeData AttributeData + +// NewAttributeData instantiates a new AttributeData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAttributeData() *AttributeData { + this := AttributeData{} + return &this +} + +// NewAttributeDataWithDefaults instantiates a new AttributeData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAttributeDataWithDefaults() *AttributeData { + this := AttributeData{} + return &this +} + +// GetLatest returns the Latest field value if set, zero value otherwise. +func (o *AttributeData) GetLatest() bool { + if o == nil || IsNil(o.Latest) { + var ret bool + return ret + } + return *o.Latest +} + +// GetLatestOk returns a tuple with the Latest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeData) GetLatestOk() (*bool, bool) { + if o == nil || IsNil(o.Latest) { + return nil, false + } + return o.Latest, true +} + +// HasLatest returns a boolean if a field has been set. +func (o *AttributeData) HasLatest() bool { + if o != nil && !IsNil(o.Latest) { + return true + } + + return false +} + +// SetLatest gets a reference to the given bool and assigns it to the Latest field. +func (o *AttributeData) SetLatest(v bool) { + o.Latest = &v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *AttributeData) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeData) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *AttributeData) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *AttributeData) SetModel(v string) { + o.Model = &v +} + +// GetVendor returns the Vendor field value if set, zero value otherwise. +func (o *AttributeData) GetVendor() string { + if o == nil || IsNil(o.Vendor) { + var ret string + return ret + } + return *o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeData) GetVendorOk() (*string, bool) { + if o == nil || IsNil(o.Vendor) { + return nil, false + } + return o.Vendor, true +} + +// HasVendor returns a boolean if a field has been set. +func (o *AttributeData) HasVendor() bool { + if o != nil && !IsNil(o.Vendor) { + return true + } + + return false +} + +// SetVendor gets a reference to the given string and assigns it to the Vendor field. +func (o *AttributeData) SetVendor(v string) { + o.Vendor = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *AttributeData) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AttributeData) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *AttributeData) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *AttributeData) SetPlan(v string) { + o.Plan = &v +} + +func (o AttributeData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AttributeData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Latest) { + toSerialize["latest"] = o.Latest + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Vendor) { + toSerialize["vendor"] = o.Vendor + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AttributeData) UnmarshalJSON(bytes []byte) (err error) { + varAttributeData := _AttributeData{} + + err = json.Unmarshal(bytes, &varAttributeData) + + if err != nil { + return err + } + + *o = AttributeData(varAttributeData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "latest") + delete(additionalProperties, "model") + delete(additionalProperties, "vendor") + delete(additionalProperties, "plan") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAttributeData struct { + value *AttributeData + isSet bool +} + +func (v NullableAttributeData) Get() *AttributeData { + return v.value +} + +func (v *NullableAttributeData) Set(val *AttributeData) { + v.value = val + v.isSet = true +} + +func (v NullableAttributeData) IsSet() bool { + return v.isSet +} + +func (v *NullableAttributeData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAttributeData(val *AttributeData) *NullableAttributeData { + return &NullableAttributeData{value: val, isSet: true} +} + +func (v NullableAttributeData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAttributeData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_auth_token.go b/services/metalv1/model_auth_token.go new file mode 100644 index 00000000..987c9ea6 --- /dev/null +++ b/services/metalv1/model_auth_token.go @@ -0,0 +1,415 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the AuthToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthToken{} + +// AuthToken struct for AuthToken +type AuthToken struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + // Available only for API keys + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Project *AuthTokenProject `json:"project,omitempty"` + ReadOnly *bool `json:"read_only,omitempty"` + Token *string `json:"token,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + User *AuthTokenUser `json:"user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthToken AuthToken + +// NewAuthToken instantiates a new AuthToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthToken() *AuthToken { + this := AuthToken{} + return &this +} + +// NewAuthTokenWithDefaults instantiates a new AuthToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthTokenWithDefaults() *AuthToken { + this := AuthToken{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AuthToken) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AuthToken) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AuthToken) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AuthToken) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AuthToken) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AuthToken) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AuthToken) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AuthToken) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AuthToken) SetId(v string) { + o.Id = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *AuthToken) GetProject() AuthTokenProject { + if o == nil || IsNil(o.Project) { + var ret AuthTokenProject + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetProjectOk() (*AuthTokenProject, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *AuthToken) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given AuthTokenProject and assigns it to the Project field. +func (o *AuthToken) SetProject(v AuthTokenProject) { + o.Project = &v +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *AuthToken) GetReadOnly() bool { + if o == nil || IsNil(o.ReadOnly) { + var ret bool + return ret + } + return *o.ReadOnly +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetReadOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.ReadOnly) { + return nil, false + } + return o.ReadOnly, true +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *AuthToken) HasReadOnly() bool { + if o != nil && !IsNil(o.ReadOnly) { + return true + } + + return false +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *AuthToken) SetReadOnly(v bool) { + o.ReadOnly = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *AuthToken) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *AuthToken) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *AuthToken) SetToken(v string) { + o.Token = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AuthToken) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AuthToken) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AuthToken) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *AuthToken) GetUser() AuthTokenUser { + if o == nil || IsNil(o.User) { + var ret AuthTokenUser + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthToken) GetUserOk() (*AuthTokenUser, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *AuthToken) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given AuthTokenUser and assigns it to the User field. +func (o *AuthToken) SetUser(v AuthTokenUser) { + o.User = &v +} + +func (o AuthToken) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.ReadOnly) { + toSerialize["read_only"] = o.ReadOnly + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthToken) UnmarshalJSON(bytes []byte) (err error) { + varAuthToken := _AuthToken{} + + err = json.Unmarshal(bytes, &varAuthToken) + + if err != nil { + return err + } + + *o = AuthToken(varAuthToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "project") + delete(additionalProperties, "read_only") + delete(additionalProperties, "token") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthToken struct { + value *AuthToken + isSet bool +} + +func (v NullableAuthToken) Get() *AuthToken { + return v.value +} + +func (v *NullableAuthToken) Set(val *AuthToken) { + v.value = val + v.isSet = true +} + +func (v NullableAuthToken) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthToken(val *AuthToken) *NullableAuthToken { + return &NullableAuthToken{value: val, isSet: true} +} + +func (v NullableAuthToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_auth_token_input.go b/services/metalv1/model_auth_token_input.go new file mode 100644 index 00000000..ec9ccfed --- /dev/null +++ b/services/metalv1/model_auth_token_input.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the AuthTokenInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthTokenInput{} + +// AuthTokenInput struct for AuthTokenInput +type AuthTokenInput struct { + Description *string `json:"description,omitempty"` + ReadOnly *bool `json:"read_only,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthTokenInput AuthTokenInput + +// NewAuthTokenInput instantiates a new AuthTokenInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthTokenInput() *AuthTokenInput { + this := AuthTokenInput{} + return &this +} + +// NewAuthTokenInputWithDefaults instantiates a new AuthTokenInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthTokenInputWithDefaults() *AuthTokenInput { + this := AuthTokenInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AuthTokenInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AuthTokenInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AuthTokenInput) SetDescription(v string) { + o.Description = &v +} + +// GetReadOnly returns the ReadOnly field value if set, zero value otherwise. +func (o *AuthTokenInput) GetReadOnly() bool { + if o == nil || IsNil(o.ReadOnly) { + var ret bool + return ret + } + return *o.ReadOnly +} + +// GetReadOnlyOk returns a tuple with the ReadOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenInput) GetReadOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.ReadOnly) { + return nil, false + } + return o.ReadOnly, true +} + +// HasReadOnly returns a boolean if a field has been set. +func (o *AuthTokenInput) HasReadOnly() bool { + if o != nil && !IsNil(o.ReadOnly) { + return true + } + + return false +} + +// SetReadOnly gets a reference to the given bool and assigns it to the ReadOnly field. +func (o *AuthTokenInput) SetReadOnly(v bool) { + o.ReadOnly = &v +} + +func (o AuthTokenInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthTokenInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ReadOnly) { + toSerialize["read_only"] = o.ReadOnly + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthTokenInput) UnmarshalJSON(bytes []byte) (err error) { + varAuthTokenInput := _AuthTokenInput{} + + err = json.Unmarshal(bytes, &varAuthTokenInput) + + if err != nil { + return err + } + + *o = AuthTokenInput(varAuthTokenInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "read_only") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthTokenInput struct { + value *AuthTokenInput + isSet bool +} + +func (v NullableAuthTokenInput) Get() *AuthTokenInput { + return v.value +} + +func (v *NullableAuthTokenInput) Set(val *AuthTokenInput) { + v.value = val + v.isSet = true +} + +func (v NullableAuthTokenInput) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthTokenInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthTokenInput(val *AuthTokenInput) *NullableAuthTokenInput { + return &NullableAuthTokenInput{value: val, isSet: true} +} + +func (v NullableAuthTokenInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthTokenInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_auth_token_list.go b/services/metalv1/model_auth_token_list.go new file mode 100644 index 00000000..aea97389 --- /dev/null +++ b/services/metalv1/model_auth_token_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the AuthTokenList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthTokenList{} + +// AuthTokenList struct for AuthTokenList +type AuthTokenList struct { + ApiKeys []AuthToken `json:"api_keys,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthTokenList AuthTokenList + +// NewAuthTokenList instantiates a new AuthTokenList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthTokenList() *AuthTokenList { + this := AuthTokenList{} + return &this +} + +// NewAuthTokenListWithDefaults instantiates a new AuthTokenList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthTokenListWithDefaults() *AuthTokenList { + this := AuthTokenList{} + return &this +} + +// GetApiKeys returns the ApiKeys field value if set, zero value otherwise. +func (o *AuthTokenList) GetApiKeys() []AuthToken { + if o == nil || IsNil(o.ApiKeys) { + var ret []AuthToken + return ret + } + return o.ApiKeys +} + +// GetApiKeysOk returns a tuple with the ApiKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenList) GetApiKeysOk() ([]AuthToken, bool) { + if o == nil || IsNil(o.ApiKeys) { + return nil, false + } + return o.ApiKeys, true +} + +// HasApiKeys returns a boolean if a field has been set. +func (o *AuthTokenList) HasApiKeys() bool { + if o != nil && !IsNil(o.ApiKeys) { + return true + } + + return false +} + +// SetApiKeys gets a reference to the given []AuthToken and assigns it to the ApiKeys field. +func (o *AuthTokenList) SetApiKeys(v []AuthToken) { + o.ApiKeys = v +} + +func (o AuthTokenList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthTokenList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ApiKeys) { + toSerialize["api_keys"] = o.ApiKeys + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthTokenList) UnmarshalJSON(bytes []byte) (err error) { + varAuthTokenList := _AuthTokenList{} + + err = json.Unmarshal(bytes, &varAuthTokenList) + + if err != nil { + return err + } + + *o = AuthTokenList(varAuthTokenList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "api_keys") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthTokenList struct { + value *AuthTokenList + isSet bool +} + +func (v NullableAuthTokenList) Get() *AuthTokenList { + return v.value +} + +func (v *NullableAuthTokenList) Set(val *AuthTokenList) { + v.value = val + v.isSet = true +} + +func (v NullableAuthTokenList) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthTokenList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthTokenList(val *AuthTokenList) *NullableAuthTokenList { + return &NullableAuthTokenList{value: val, isSet: true} +} + +func (v NullableAuthTokenList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthTokenList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_auth_token_project.go b/services/metalv1/model_auth_token_project.go new file mode 100644 index 00000000..c562e985 --- /dev/null +++ b/services/metalv1/model_auth_token_project.go @@ -0,0 +1,822 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the AuthTokenProject type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthTokenProject{} + +// AuthTokenProject struct for AuthTokenProject +type AuthTokenProject struct { + BgpConfig *Href `json:"bgp_config,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Devices []Href `json:"devices,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Invitations []Href `json:"invitations,omitempty"` + MaxDevices map[string]interface{} `json:"max_devices,omitempty"` + Members []Href `json:"members,omitempty"` + Memberships []Href `json:"memberships,omitempty"` + // The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + Name *string `json:"name,omitempty"` + NetworkStatus map[string]interface{} `json:"network_status,omitempty"` + Organization *Organization `json:"organization,omitempty"` + PaymentMethod *Href `json:"payment_method,omitempty"` + SshKeys []Href `json:"ssh_keys,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Volumes []Href `json:"volumes,omitempty"` + Type *ProjectType `json:"type,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthTokenProject AuthTokenProject + +// NewAuthTokenProject instantiates a new AuthTokenProject object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthTokenProject() *AuthTokenProject { + this := AuthTokenProject{} + return &this +} + +// NewAuthTokenProjectWithDefaults instantiates a new AuthTokenProject object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthTokenProjectWithDefaults() *AuthTokenProject { + this := AuthTokenProject{} + return &this +} + +// GetBgpConfig returns the BgpConfig field value if set, zero value otherwise. +func (o *AuthTokenProject) GetBgpConfig() Href { + if o == nil || IsNil(o.BgpConfig) { + var ret Href + return ret + } + return *o.BgpConfig +} + +// GetBgpConfigOk returns a tuple with the BgpConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetBgpConfigOk() (*Href, bool) { + if o == nil || IsNil(o.BgpConfig) { + return nil, false + } + return o.BgpConfig, true +} + +// HasBgpConfig returns a boolean if a field has been set. +func (o *AuthTokenProject) HasBgpConfig() bool { + if o != nil && !IsNil(o.BgpConfig) { + return true + } + + return false +} + +// SetBgpConfig gets a reference to the given Href and assigns it to the BgpConfig field. +func (o *AuthTokenProject) SetBgpConfig(v Href) { + o.BgpConfig = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AuthTokenProject) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AuthTokenProject) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AuthTokenProject) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *AuthTokenProject) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *AuthTokenProject) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *AuthTokenProject) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDevices returns the Devices field value if set, zero value otherwise. +func (o *AuthTokenProject) GetDevices() []Href { + if o == nil || IsNil(o.Devices) { + var ret []Href + return ret + } + return o.Devices +} + +// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetDevicesOk() ([]Href, bool) { + if o == nil || IsNil(o.Devices) { + return nil, false + } + return o.Devices, true +} + +// HasDevices returns a boolean if a field has been set. +func (o *AuthTokenProject) HasDevices() bool { + if o != nil && !IsNil(o.Devices) { + return true + } + + return false +} + +// SetDevices gets a reference to the given []Href and assigns it to the Devices field. +func (o *AuthTokenProject) SetDevices(v []Href) { + o.Devices = v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *AuthTokenProject) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *AuthTokenProject) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *AuthTokenProject) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AuthTokenProject) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AuthTokenProject) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AuthTokenProject) SetId(v string) { + o.Id = &v +} + +// GetInvitations returns the Invitations field value if set, zero value otherwise. +func (o *AuthTokenProject) GetInvitations() []Href { + if o == nil || IsNil(o.Invitations) { + var ret []Href + return ret + } + return o.Invitations +} + +// GetInvitationsOk returns a tuple with the Invitations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetInvitationsOk() ([]Href, bool) { + if o == nil || IsNil(o.Invitations) { + return nil, false + } + return o.Invitations, true +} + +// HasInvitations returns a boolean if a field has been set. +func (o *AuthTokenProject) HasInvitations() bool { + if o != nil && !IsNil(o.Invitations) { + return true + } + + return false +} + +// SetInvitations gets a reference to the given []Href and assigns it to the Invitations field. +func (o *AuthTokenProject) SetInvitations(v []Href) { + o.Invitations = v +} + +// GetMaxDevices returns the MaxDevices field value if set, zero value otherwise. +func (o *AuthTokenProject) GetMaxDevices() map[string]interface{} { + if o == nil || IsNil(o.MaxDevices) { + var ret map[string]interface{} + return ret + } + return o.MaxDevices +} + +// GetMaxDevicesOk returns a tuple with the MaxDevices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetMaxDevicesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.MaxDevices) { + return map[string]interface{}{}, false + } + return o.MaxDevices, true +} + +// HasMaxDevices returns a boolean if a field has been set. +func (o *AuthTokenProject) HasMaxDevices() bool { + if o != nil && !IsNil(o.MaxDevices) { + return true + } + + return false +} + +// SetMaxDevices gets a reference to the given map[string]interface{} and assigns it to the MaxDevices field. +func (o *AuthTokenProject) SetMaxDevices(v map[string]interface{}) { + o.MaxDevices = v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *AuthTokenProject) GetMembers() []Href { + if o == nil || IsNil(o.Members) { + var ret []Href + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetMembersOk() ([]Href, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *AuthTokenProject) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []Href and assigns it to the Members field. +func (o *AuthTokenProject) SetMembers(v []Href) { + o.Members = v +} + +// GetMemberships returns the Memberships field value if set, zero value otherwise. +func (o *AuthTokenProject) GetMemberships() []Href { + if o == nil || IsNil(o.Memberships) { + var ret []Href + return ret + } + return o.Memberships +} + +// GetMembershipsOk returns a tuple with the Memberships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetMembershipsOk() ([]Href, bool) { + if o == nil || IsNil(o.Memberships) { + return nil, false + } + return o.Memberships, true +} + +// HasMemberships returns a boolean if a field has been set. +func (o *AuthTokenProject) HasMemberships() bool { + if o != nil && !IsNil(o.Memberships) { + return true + } + + return false +} + +// SetMemberships gets a reference to the given []Href and assigns it to the Memberships field. +func (o *AuthTokenProject) SetMemberships(v []Href) { + o.Memberships = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AuthTokenProject) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AuthTokenProject) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *AuthTokenProject) SetName(v string) { + o.Name = &v +} + +// GetNetworkStatus returns the NetworkStatus field value if set, zero value otherwise. +func (o *AuthTokenProject) GetNetworkStatus() map[string]interface{} { + if o == nil || IsNil(o.NetworkStatus) { + var ret map[string]interface{} + return ret + } + return o.NetworkStatus +} + +// GetNetworkStatusOk returns a tuple with the NetworkStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetNetworkStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.NetworkStatus) { + return map[string]interface{}{}, false + } + return o.NetworkStatus, true +} + +// HasNetworkStatus returns a boolean if a field has been set. +func (o *AuthTokenProject) HasNetworkStatus() bool { + if o != nil && !IsNil(o.NetworkStatus) { + return true + } + + return false +} + +// SetNetworkStatus gets a reference to the given map[string]interface{} and assigns it to the NetworkStatus field. +func (o *AuthTokenProject) SetNetworkStatus(v map[string]interface{}) { + o.NetworkStatus = v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *AuthTokenProject) GetOrganization() Organization { + if o == nil || IsNil(o.Organization) { + var ret Organization + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetOrganizationOk() (*Organization, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *AuthTokenProject) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Organization and assigns it to the Organization field. +func (o *AuthTokenProject) SetOrganization(v Organization) { + o.Organization = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *AuthTokenProject) GetPaymentMethod() Href { + if o == nil || IsNil(o.PaymentMethod) { + var ret Href + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetPaymentMethodOk() (*Href, bool) { + if o == nil || IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *AuthTokenProject) HasPaymentMethod() bool { + if o != nil && !IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given Href and assigns it to the PaymentMethod field. +func (o *AuthTokenProject) SetPaymentMethod(v Href) { + o.PaymentMethod = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *AuthTokenProject) GetSshKeys() []Href { + if o == nil || IsNil(o.SshKeys) { + var ret []Href + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetSshKeysOk() ([]Href, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *AuthTokenProject) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []Href and assigns it to the SshKeys field. +func (o *AuthTokenProject) SetSshKeys(v []Href) { + o.SshKeys = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AuthTokenProject) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AuthTokenProject) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AuthTokenProject) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *AuthTokenProject) GetVolumes() []Href { + if o == nil || IsNil(o.Volumes) { + var ret []Href + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetVolumesOk() ([]Href, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *AuthTokenProject) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []Href and assigns it to the Volumes field. +func (o *AuthTokenProject) SetVolumes(v []Href) { + o.Volumes = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *AuthTokenProject) GetType() ProjectType { + if o == nil || IsNil(o.Type) { + var ret ProjectType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetTypeOk() (*ProjectType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *AuthTokenProject) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ProjectType and assigns it to the Type field. +func (o *AuthTokenProject) SetType(v ProjectType) { + o.Type = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *AuthTokenProject) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenProject) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *AuthTokenProject) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *AuthTokenProject) SetTags(v []string) { + o.Tags = v +} + +func (o AuthTokenProject) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthTokenProject) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpConfig) { + toSerialize["bgp_config"] = o.BgpConfig + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Devices) { + toSerialize["devices"] = o.Devices + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Invitations) { + toSerialize["invitations"] = o.Invitations + } + if !IsNil(o.MaxDevices) { + toSerialize["max_devices"] = o.MaxDevices + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + if !IsNil(o.Memberships) { + toSerialize["memberships"] = o.Memberships + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkStatus) { + toSerialize["network_status"] = o.NetworkStatus + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.PaymentMethod) { + toSerialize["payment_method"] = o.PaymentMethod + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthTokenProject) UnmarshalJSON(bytes []byte) (err error) { + varAuthTokenProject := _AuthTokenProject{} + + err = json.Unmarshal(bytes, &varAuthTokenProject) + + if err != nil { + return err + } + + *o = AuthTokenProject(varAuthTokenProject) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_config") + delete(additionalProperties, "created_at") + delete(additionalProperties, "customdata") + delete(additionalProperties, "devices") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "invitations") + delete(additionalProperties, "max_devices") + delete(additionalProperties, "members") + delete(additionalProperties, "memberships") + delete(additionalProperties, "name") + delete(additionalProperties, "network_status") + delete(additionalProperties, "organization") + delete(additionalProperties, "payment_method") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "volumes") + delete(additionalProperties, "type") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthTokenProject struct { + value *AuthTokenProject + isSet bool +} + +func (v NullableAuthTokenProject) Get() *AuthTokenProject { + return v.value +} + +func (v *NullableAuthTokenProject) Set(val *AuthTokenProject) { + v.value = val + v.isSet = true +} + +func (v NullableAuthTokenProject) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthTokenProject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthTokenProject(val *AuthTokenProject) *NullableAuthTokenProject { + return &NullableAuthTokenProject{value: val, isSet: true} +} + +func (v NullableAuthTokenProject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthTokenProject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_auth_token_user.go b/services/metalv1/model_auth_token_user.go new file mode 100644 index 00000000..b9a836a6 --- /dev/null +++ b/services/metalv1/model_auth_token_user.go @@ -0,0 +1,932 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the AuthTokenUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthTokenUser{} + +// AuthTokenUser struct for AuthTokenUser +type AuthTokenUser struct { + AvatarThumbUrl *string `json:"avatar_thumb_url,omitempty"` + AvatarUrl *string `json:"avatar_url,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + DefaultOrganizationId *string `json:"default_organization_id,omitempty"` + DefaultProjectId *string `json:"default_project_id,omitempty"` + Email *string `json:"email,omitempty"` + Emails []Href `json:"emails,omitempty"` + FirstName *string `json:"first_name,omitempty"` + FraudScore *string `json:"fraud_score,omitempty"` + FullName *string `json:"full_name,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + LastLoginAt *time.Time `json:"last_login_at,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaxOrganizations *int32 `json:"max_organizations,omitempty"` + MaxProjects *int32 `json:"max_projects,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + ShortId *string `json:"short_id,omitempty"` + Timezone *string `json:"timezone,omitempty"` + TwoFactorAuth *string `json:"two_factor_auth,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthTokenUser AuthTokenUser + +// NewAuthTokenUser instantiates a new AuthTokenUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthTokenUser() *AuthTokenUser { + this := AuthTokenUser{} + return &this +} + +// NewAuthTokenUserWithDefaults instantiates a new AuthTokenUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthTokenUserWithDefaults() *AuthTokenUser { + this := AuthTokenUser{} + return &this +} + +// GetAvatarThumbUrl returns the AvatarThumbUrl field value if set, zero value otherwise. +func (o *AuthTokenUser) GetAvatarThumbUrl() string { + if o == nil || IsNil(o.AvatarThumbUrl) { + var ret string + return ret + } + return *o.AvatarThumbUrl +} + +// GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetAvatarThumbUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarThumbUrl) { + return nil, false + } + return o.AvatarThumbUrl, true +} + +// HasAvatarThumbUrl returns a boolean if a field has been set. +func (o *AuthTokenUser) HasAvatarThumbUrl() bool { + if o != nil && !IsNil(o.AvatarThumbUrl) { + return true + } + + return false +} + +// SetAvatarThumbUrl gets a reference to the given string and assigns it to the AvatarThumbUrl field. +func (o *AuthTokenUser) SetAvatarThumbUrl(v string) { + o.AvatarThumbUrl = &v +} + +// GetAvatarUrl returns the AvatarUrl field value if set, zero value otherwise. +func (o *AuthTokenUser) GetAvatarUrl() string { + if o == nil || IsNil(o.AvatarUrl) { + var ret string + return ret + } + return *o.AvatarUrl +} + +// GetAvatarUrlOk returns a tuple with the AvatarUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetAvatarUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarUrl) { + return nil, false + } + return o.AvatarUrl, true +} + +// HasAvatarUrl returns a boolean if a field has been set. +func (o *AuthTokenUser) HasAvatarUrl() bool { + if o != nil && !IsNil(o.AvatarUrl) { + return true + } + + return false +} + +// SetAvatarUrl gets a reference to the given string and assigns it to the AvatarUrl field. +func (o *AuthTokenUser) SetAvatarUrl(v string) { + o.AvatarUrl = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AuthTokenUser) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AuthTokenUser) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AuthTokenUser) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *AuthTokenUser) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *AuthTokenUser) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *AuthTokenUser) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDefaultOrganizationId returns the DefaultOrganizationId field value if set, zero value otherwise. +func (o *AuthTokenUser) GetDefaultOrganizationId() string { + if o == nil || IsNil(o.DefaultOrganizationId) { + var ret string + return ret + } + return *o.DefaultOrganizationId +} + +// GetDefaultOrganizationIdOk returns a tuple with the DefaultOrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetDefaultOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.DefaultOrganizationId) { + return nil, false + } + return o.DefaultOrganizationId, true +} + +// HasDefaultOrganizationId returns a boolean if a field has been set. +func (o *AuthTokenUser) HasDefaultOrganizationId() bool { + if o != nil && !IsNil(o.DefaultOrganizationId) { + return true + } + + return false +} + +// SetDefaultOrganizationId gets a reference to the given string and assigns it to the DefaultOrganizationId field. +func (o *AuthTokenUser) SetDefaultOrganizationId(v string) { + o.DefaultOrganizationId = &v +} + +// GetDefaultProjectId returns the DefaultProjectId field value if set, zero value otherwise. +func (o *AuthTokenUser) GetDefaultProjectId() string { + if o == nil || IsNil(o.DefaultProjectId) { + var ret string + return ret + } + return *o.DefaultProjectId +} + +// GetDefaultProjectIdOk returns a tuple with the DefaultProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetDefaultProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.DefaultProjectId) { + return nil, false + } + return o.DefaultProjectId, true +} + +// HasDefaultProjectId returns a boolean if a field has been set. +func (o *AuthTokenUser) HasDefaultProjectId() bool { + if o != nil && !IsNil(o.DefaultProjectId) { + return true + } + + return false +} + +// SetDefaultProjectId gets a reference to the given string and assigns it to the DefaultProjectId field. +func (o *AuthTokenUser) SetDefaultProjectId(v string) { + o.DefaultProjectId = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *AuthTokenUser) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *AuthTokenUser) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *AuthTokenUser) SetEmail(v string) { + o.Email = &v +} + +// GetEmails returns the Emails field value if set, zero value otherwise. +func (o *AuthTokenUser) GetEmails() []Href { + if o == nil || IsNil(o.Emails) { + var ret []Href + return ret + } + return o.Emails +} + +// GetEmailsOk returns a tuple with the Emails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetEmailsOk() ([]Href, bool) { + if o == nil || IsNil(o.Emails) { + return nil, false + } + return o.Emails, true +} + +// HasEmails returns a boolean if a field has been set. +func (o *AuthTokenUser) HasEmails() bool { + if o != nil && !IsNil(o.Emails) { + return true + } + + return false +} + +// SetEmails gets a reference to the given []Href and assigns it to the Emails field. +func (o *AuthTokenUser) SetEmails(v []Href) { + o.Emails = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *AuthTokenUser) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *AuthTokenUser) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *AuthTokenUser) SetFirstName(v string) { + o.FirstName = &v +} + +// GetFraudScore returns the FraudScore field value if set, zero value otherwise. +func (o *AuthTokenUser) GetFraudScore() string { + if o == nil || IsNil(o.FraudScore) { + var ret string + return ret + } + return *o.FraudScore +} + +// GetFraudScoreOk returns a tuple with the FraudScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetFraudScoreOk() (*string, bool) { + if o == nil || IsNil(o.FraudScore) { + return nil, false + } + return o.FraudScore, true +} + +// HasFraudScore returns a boolean if a field has been set. +func (o *AuthTokenUser) HasFraudScore() bool { + if o != nil && !IsNil(o.FraudScore) { + return true + } + + return false +} + +// SetFraudScore gets a reference to the given string and assigns it to the FraudScore field. +func (o *AuthTokenUser) SetFraudScore(v string) { + o.FraudScore = &v +} + +// GetFullName returns the FullName field value if set, zero value otherwise. +func (o *AuthTokenUser) GetFullName() string { + if o == nil || IsNil(o.FullName) { + var ret string + return ret + } + return *o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetFullNameOk() (*string, bool) { + if o == nil || IsNil(o.FullName) { + return nil, false + } + return o.FullName, true +} + +// HasFullName returns a boolean if a field has been set. +func (o *AuthTokenUser) HasFullName() bool { + if o != nil && !IsNil(o.FullName) { + return true + } + + return false +} + +// SetFullName gets a reference to the given string and assigns it to the FullName field. +func (o *AuthTokenUser) SetFullName(v string) { + o.FullName = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *AuthTokenUser) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *AuthTokenUser) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *AuthTokenUser) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AuthTokenUser) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AuthTokenUser) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AuthTokenUser) SetId(v string) { + o.Id = &v +} + +// GetLastLoginAt returns the LastLoginAt field value if set, zero value otherwise. +func (o *AuthTokenUser) GetLastLoginAt() time.Time { + if o == nil || IsNil(o.LastLoginAt) { + var ret time.Time + return ret + } + return *o.LastLoginAt +} + +// GetLastLoginAtOk returns a tuple with the LastLoginAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetLastLoginAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastLoginAt) { + return nil, false + } + return o.LastLoginAt, true +} + +// HasLastLoginAt returns a boolean if a field has been set. +func (o *AuthTokenUser) HasLastLoginAt() bool { + if o != nil && !IsNil(o.LastLoginAt) { + return true + } + + return false +} + +// SetLastLoginAt gets a reference to the given time.Time and assigns it to the LastLoginAt field. +func (o *AuthTokenUser) SetLastLoginAt(v time.Time) { + o.LastLoginAt = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *AuthTokenUser) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *AuthTokenUser) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *AuthTokenUser) SetLastName(v string) { + o.LastName = &v +} + +// GetMaxOrganizations returns the MaxOrganizations field value if set, zero value otherwise. +func (o *AuthTokenUser) GetMaxOrganizations() int32 { + if o == nil || IsNil(o.MaxOrganizations) { + var ret int32 + return ret + } + return *o.MaxOrganizations +} + +// GetMaxOrganizationsOk returns a tuple with the MaxOrganizations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetMaxOrganizationsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxOrganizations) { + return nil, false + } + return o.MaxOrganizations, true +} + +// HasMaxOrganizations returns a boolean if a field has been set. +func (o *AuthTokenUser) HasMaxOrganizations() bool { + if o != nil && !IsNil(o.MaxOrganizations) { + return true + } + + return false +} + +// SetMaxOrganizations gets a reference to the given int32 and assigns it to the MaxOrganizations field. +func (o *AuthTokenUser) SetMaxOrganizations(v int32) { + o.MaxOrganizations = &v +} + +// GetMaxProjects returns the MaxProjects field value if set, zero value otherwise. +func (o *AuthTokenUser) GetMaxProjects() int32 { + if o == nil || IsNil(o.MaxProjects) { + var ret int32 + return ret + } + return *o.MaxProjects +} + +// GetMaxProjectsOk returns a tuple with the MaxProjects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetMaxProjectsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxProjects) { + return nil, false + } + return o.MaxProjects, true +} + +// HasMaxProjects returns a boolean if a field has been set. +func (o *AuthTokenUser) HasMaxProjects() bool { + if o != nil && !IsNil(o.MaxProjects) { + return true + } + + return false +} + +// SetMaxProjects gets a reference to the given int32 and assigns it to the MaxProjects field. +func (o *AuthTokenUser) SetMaxProjects(v int32) { + o.MaxProjects = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *AuthTokenUser) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *AuthTokenUser) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *AuthTokenUser) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetShortId returns the ShortId field value if set, zero value otherwise. +func (o *AuthTokenUser) GetShortId() string { + if o == nil || IsNil(o.ShortId) { + var ret string + return ret + } + return *o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetShortIdOk() (*string, bool) { + if o == nil || IsNil(o.ShortId) { + return nil, false + } + return o.ShortId, true +} + +// HasShortId returns a boolean if a field has been set. +func (o *AuthTokenUser) HasShortId() bool { + if o != nil && !IsNil(o.ShortId) { + return true + } + + return false +} + +// SetShortId gets a reference to the given string and assigns it to the ShortId field. +func (o *AuthTokenUser) SetShortId(v string) { + o.ShortId = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *AuthTokenUser) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *AuthTokenUser) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *AuthTokenUser) SetTimezone(v string) { + o.Timezone = &v +} + +// GetTwoFactorAuth returns the TwoFactorAuth field value if set, zero value otherwise. +func (o *AuthTokenUser) GetTwoFactorAuth() string { + if o == nil || IsNil(o.TwoFactorAuth) { + var ret string + return ret + } + return *o.TwoFactorAuth +} + +// GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetTwoFactorAuthOk() (*string, bool) { + if o == nil || IsNil(o.TwoFactorAuth) { + return nil, false + } + return o.TwoFactorAuth, true +} + +// HasTwoFactorAuth returns a boolean if a field has been set. +func (o *AuthTokenUser) HasTwoFactorAuth() bool { + if o != nil && !IsNil(o.TwoFactorAuth) { + return true + } + + return false +} + +// SetTwoFactorAuth gets a reference to the given string and assigns it to the TwoFactorAuth field. +func (o *AuthTokenUser) SetTwoFactorAuth(v string) { + o.TwoFactorAuth = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AuthTokenUser) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthTokenUser) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AuthTokenUser) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AuthTokenUser) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o AuthTokenUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthTokenUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvatarThumbUrl) { + toSerialize["avatar_thumb_url"] = o.AvatarThumbUrl + } + if !IsNil(o.AvatarUrl) { + toSerialize["avatar_url"] = o.AvatarUrl + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.DefaultOrganizationId) { + toSerialize["default_organization_id"] = o.DefaultOrganizationId + } + if !IsNil(o.DefaultProjectId) { + toSerialize["default_project_id"] = o.DefaultProjectId + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Emails) { + toSerialize["emails"] = o.Emails + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.FraudScore) { + toSerialize["fraud_score"] = o.FraudScore + } + if !IsNil(o.FullName) { + toSerialize["full_name"] = o.FullName + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.LastLoginAt) { + toSerialize["last_login_at"] = o.LastLoginAt + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.MaxOrganizations) { + toSerialize["max_organizations"] = o.MaxOrganizations + } + if !IsNil(o.MaxProjects) { + toSerialize["max_projects"] = o.MaxProjects + } + if !IsNil(o.PhoneNumber) { + toSerialize["phone_number"] = o.PhoneNumber + } + if !IsNil(o.ShortId) { + toSerialize["short_id"] = o.ShortId + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + if !IsNil(o.TwoFactorAuth) { + toSerialize["two_factor_auth"] = o.TwoFactorAuth + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthTokenUser) UnmarshalJSON(bytes []byte) (err error) { + varAuthTokenUser := _AuthTokenUser{} + + err = json.Unmarshal(bytes, &varAuthTokenUser) + + if err != nil { + return err + } + + *o = AuthTokenUser(varAuthTokenUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar_thumb_url") + delete(additionalProperties, "avatar_url") + delete(additionalProperties, "created_at") + delete(additionalProperties, "customdata") + delete(additionalProperties, "default_organization_id") + delete(additionalProperties, "default_project_id") + delete(additionalProperties, "email") + delete(additionalProperties, "emails") + delete(additionalProperties, "first_name") + delete(additionalProperties, "fraud_score") + delete(additionalProperties, "full_name") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "last_login_at") + delete(additionalProperties, "last_name") + delete(additionalProperties, "max_organizations") + delete(additionalProperties, "max_projects") + delete(additionalProperties, "phone_number") + delete(additionalProperties, "short_id") + delete(additionalProperties, "timezone") + delete(additionalProperties, "two_factor_auth") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthTokenUser struct { + value *AuthTokenUser + isSet bool +} + +func (v NullableAuthTokenUser) Get() *AuthTokenUser { + return v.value +} + +func (v *NullableAuthTokenUser) Set(val *AuthTokenUser) { + v.value = val + v.isSet = true +} + +func (v NullableAuthTokenUser) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthTokenUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthTokenUser(val *AuthTokenUser) *NullableAuthTokenUser { + return &NullableAuthTokenUser{value: val, isSet: true} +} + +func (v NullableAuthTokenUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthTokenUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_batch.go b/services/metalv1/model_batch.go new file mode 100644 index 00000000..3d95133d --- /dev/null +++ b/services/metalv1/model_batch.go @@ -0,0 +1,414 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Batch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Batch{} + +// Batch struct for Batch +type Batch struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Devices []Href `json:"devices,omitempty"` + ErrorMessages []string `json:"error_messages,omitempty"` + Id *string `json:"id,omitempty"` + Project *Href `json:"project,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + State *string `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Batch Batch + +// NewBatch instantiates a new Batch object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatch() *Batch { + this := Batch{} + return &this +} + +// NewBatchWithDefaults instantiates a new Batch object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchWithDefaults() *Batch { + this := Batch{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Batch) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Batch) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Batch) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDevices returns the Devices field value if set, zero value otherwise. +func (o *Batch) GetDevices() []Href { + if o == nil || IsNil(o.Devices) { + var ret []Href + return ret + } + return o.Devices +} + +// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetDevicesOk() ([]Href, bool) { + if o == nil || IsNil(o.Devices) { + return nil, false + } + return o.Devices, true +} + +// HasDevices returns a boolean if a field has been set. +func (o *Batch) HasDevices() bool { + if o != nil && !IsNil(o.Devices) { + return true + } + + return false +} + +// SetDevices gets a reference to the given []Href and assigns it to the Devices field. +func (o *Batch) SetDevices(v []Href) { + o.Devices = v +} + +// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise. +func (o *Batch) GetErrorMessages() []string { + if o == nil || IsNil(o.ErrorMessages) { + var ret []string + return ret + } + return o.ErrorMessages +} + +// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetErrorMessagesOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorMessages) { + return nil, false + } + return o.ErrorMessages, true +} + +// HasErrorMessages returns a boolean if a field has been set. +func (o *Batch) HasErrorMessages() bool { + if o != nil && !IsNil(o.ErrorMessages) { + return true + } + + return false +} + +// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. +func (o *Batch) SetErrorMessages(v []string) { + o.ErrorMessages = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Batch) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Batch) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Batch) SetId(v string) { + o.Id = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *Batch) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *Batch) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *Batch) SetProject(v Href) { + o.Project = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *Batch) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Batch) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *Batch) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Batch) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Batch) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *Batch) SetState(v string) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Batch) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Batch) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Batch) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Batch) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Batch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Batch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Devices) { + toSerialize["devices"] = o.Devices + } + if !IsNil(o.ErrorMessages) { + toSerialize["error_messages"] = o.ErrorMessages + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Batch) UnmarshalJSON(bytes []byte) (err error) { + varBatch := _Batch{} + + err = json.Unmarshal(bytes, &varBatch) + + if err != nil { + return err + } + + *o = Batch(varBatch) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "devices") + delete(additionalProperties, "error_messages") + delete(additionalProperties, "id") + delete(additionalProperties, "project") + delete(additionalProperties, "quantity") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBatch struct { + value *Batch + isSet bool +} + +func (v NullableBatch) Get() *Batch { + return v.value +} + +func (v *NullableBatch) Set(val *Batch) { + v.value = val + v.isSet = true +} + +func (v NullableBatch) IsSet() bool { + return v.isSet +} + +func (v *NullableBatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatch(val *Batch) *NullableBatch { + return &NullableBatch{value: val, isSet: true} +} + +func (v NullableBatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_batches_list.go b/services/metalv1/model_batches_list.go new file mode 100644 index 00000000..837135c8 --- /dev/null +++ b/services/metalv1/model_batches_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BatchesList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchesList{} + +// BatchesList struct for BatchesList +type BatchesList struct { + Batches []Batch `json:"batches,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BatchesList BatchesList + +// NewBatchesList instantiates a new BatchesList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchesList() *BatchesList { + this := BatchesList{} + return &this +} + +// NewBatchesListWithDefaults instantiates a new BatchesList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchesListWithDefaults() *BatchesList { + this := BatchesList{} + return &this +} + +// GetBatches returns the Batches field value if set, zero value otherwise. +func (o *BatchesList) GetBatches() []Batch { + if o == nil || IsNil(o.Batches) { + var ret []Batch + return ret + } + return o.Batches +} + +// GetBatchesOk returns a tuple with the Batches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BatchesList) GetBatchesOk() ([]Batch, bool) { + if o == nil || IsNil(o.Batches) { + return nil, false + } + return o.Batches, true +} + +// HasBatches returns a boolean if a field has been set. +func (o *BatchesList) HasBatches() bool { + if o != nil && !IsNil(o.Batches) { + return true + } + + return false +} + +// SetBatches gets a reference to the given []Batch and assigns it to the Batches field. +func (o *BatchesList) SetBatches(v []Batch) { + o.Batches = v +} + +func (o BatchesList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchesList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Batches) { + toSerialize["batches"] = o.Batches + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BatchesList) UnmarshalJSON(bytes []byte) (err error) { + varBatchesList := _BatchesList{} + + err = json.Unmarshal(bytes, &varBatchesList) + + if err != nil { + return err + } + + *o = BatchesList(varBatchesList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "batches") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBatchesList struct { + value *BatchesList + isSet bool +} + +func (v NullableBatchesList) Get() *BatchesList { + return v.value +} + +func (v *NullableBatchesList) Set(val *BatchesList) { + v.value = val + v.isSet = true +} + +func (v NullableBatchesList) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchesList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchesList(val *BatchesList) *NullableBatchesList { + return &NullableBatchesList{value: val, isSet: true} +} + +func (v NullableBatchesList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchesList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_config.go b/services/metalv1/model_bgp_config.go new file mode 100644 index 00000000..e91a354f --- /dev/null +++ b/services/metalv1/model_bgp_config.go @@ -0,0 +1,620 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the BgpConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpConfig{} + +// BgpConfig struct for BgpConfig +type BgpConfig struct { + // Autonomous System Number. ASN is required with Global BGP. With Local BGP the private ASN, 65000, is assigned. + Asn *int32 `json:"asn,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + DeploymentType *BgpConfigDeploymentType `json:"deployment_type,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + // The maximum number of route filters allowed per server + MaxPrefix *int32 `json:"max_prefix,omitempty"` + // (Optional) Password for BGP session in plaintext (not a checksum) + Md5 NullableString `json:"md5,omitempty"` + Project *Href `json:"project,omitempty"` + // The IP block ranges associated to the ASN (Populated in Global BGP only) + Ranges []GlobalBgpRange `json:"ranges,omitempty"` + RequestedAt *time.Time `json:"requested_at,omitempty"` + // Specifies AS-MACRO (aka AS-SET) to use when building client route filters + RouteObject *string `json:"route_object,omitempty"` + // The direct connections between neighboring routers that want to exchange routing information. + Sessions []BgpSession `json:"sessions,omitempty"` + Status *BgpConfigStatus `json:"status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpConfig BgpConfig + +// NewBgpConfig instantiates a new BgpConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpConfig() *BgpConfig { + this := BgpConfig{} + var maxPrefix int32 = 10 + this.MaxPrefix = &maxPrefix + return &this +} + +// NewBgpConfigWithDefaults instantiates a new BgpConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpConfigWithDefaults() *BgpConfig { + this := BgpConfig{} + var maxPrefix int32 = 10 + this.MaxPrefix = &maxPrefix + return &this +} + +// GetAsn returns the Asn field value if set, zero value otherwise. +func (o *BgpConfig) GetAsn() int32 { + if o == nil || IsNil(o.Asn) { + var ret int32 + return ret + } + return *o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetAsnOk() (*int32, bool) { + if o == nil || IsNil(o.Asn) { + return nil, false + } + return o.Asn, true +} + +// HasAsn returns a boolean if a field has been set. +func (o *BgpConfig) HasAsn() bool { + if o != nil && !IsNil(o.Asn) { + return true + } + + return false +} + +// SetAsn gets a reference to the given int32 and assigns it to the Asn field. +func (o *BgpConfig) SetAsn(v int32) { + o.Asn = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BgpConfig) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BgpConfig) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BgpConfig) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDeploymentType returns the DeploymentType field value if set, zero value otherwise. +func (o *BgpConfig) GetDeploymentType() BgpConfigDeploymentType { + if o == nil || IsNil(o.DeploymentType) { + var ret BgpConfigDeploymentType + return ret + } + return *o.DeploymentType +} + +// GetDeploymentTypeOk returns a tuple with the DeploymentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetDeploymentTypeOk() (*BgpConfigDeploymentType, bool) { + if o == nil || IsNil(o.DeploymentType) { + return nil, false + } + return o.DeploymentType, true +} + +// HasDeploymentType returns a boolean if a field has been set. +func (o *BgpConfig) HasDeploymentType() bool { + if o != nil && !IsNil(o.DeploymentType) { + return true + } + + return false +} + +// SetDeploymentType gets a reference to the given BgpConfigDeploymentType and assigns it to the DeploymentType field. +func (o *BgpConfig) SetDeploymentType(v BgpConfigDeploymentType) { + o.DeploymentType = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *BgpConfig) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *BgpConfig) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *BgpConfig) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BgpConfig) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BgpConfig) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BgpConfig) SetId(v string) { + o.Id = &v +} + +// GetMaxPrefix returns the MaxPrefix field value if set, zero value otherwise. +func (o *BgpConfig) GetMaxPrefix() int32 { + if o == nil || IsNil(o.MaxPrefix) { + var ret int32 + return ret + } + return *o.MaxPrefix +} + +// GetMaxPrefixOk returns a tuple with the MaxPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetMaxPrefixOk() (*int32, bool) { + if o == nil || IsNil(o.MaxPrefix) { + return nil, false + } + return o.MaxPrefix, true +} + +// HasMaxPrefix returns a boolean if a field has been set. +func (o *BgpConfig) HasMaxPrefix() bool { + if o != nil && !IsNil(o.MaxPrefix) { + return true + } + + return false +} + +// SetMaxPrefix gets a reference to the given int32 and assigns it to the MaxPrefix field. +func (o *BgpConfig) SetMaxPrefix(v int32) { + o.MaxPrefix = &v +} + +// GetMd5 returns the Md5 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BgpConfig) GetMd5() string { + if o == nil || IsNil(o.Md5.Get()) { + var ret string + return ret + } + return *o.Md5.Get() +} + +// GetMd5Ok returns a tuple with the Md5 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BgpConfig) GetMd5Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.Md5.Get(), o.Md5.IsSet() +} + +// HasMd5 returns a boolean if a field has been set. +func (o *BgpConfig) HasMd5() bool { + if o != nil && o.Md5.IsSet() { + return true + } + + return false +} + +// SetMd5 gets a reference to the given NullableString and assigns it to the Md5 field. +func (o *BgpConfig) SetMd5(v string) { + o.Md5.Set(&v) +} + +// SetMd5Nil sets the value for Md5 to be an explicit nil +func (o *BgpConfig) SetMd5Nil() { + o.Md5.Set(nil) +} + +// UnsetMd5 ensures that no value is present for Md5, not even an explicit nil +func (o *BgpConfig) UnsetMd5() { + o.Md5.Unset() +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *BgpConfig) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *BgpConfig) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *BgpConfig) SetProject(v Href) { + o.Project = &v +} + +// GetRanges returns the Ranges field value if set, zero value otherwise. +func (o *BgpConfig) GetRanges() []GlobalBgpRange { + if o == nil || IsNil(o.Ranges) { + var ret []GlobalBgpRange + return ret + } + return o.Ranges +} + +// GetRangesOk returns a tuple with the Ranges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetRangesOk() ([]GlobalBgpRange, bool) { + if o == nil || IsNil(o.Ranges) { + return nil, false + } + return o.Ranges, true +} + +// HasRanges returns a boolean if a field has been set. +func (o *BgpConfig) HasRanges() bool { + if o != nil && !IsNil(o.Ranges) { + return true + } + + return false +} + +// SetRanges gets a reference to the given []GlobalBgpRange and assigns it to the Ranges field. +func (o *BgpConfig) SetRanges(v []GlobalBgpRange) { + o.Ranges = v +} + +// GetRequestedAt returns the RequestedAt field value if set, zero value otherwise. +func (o *BgpConfig) GetRequestedAt() time.Time { + if o == nil || IsNil(o.RequestedAt) { + var ret time.Time + return ret + } + return *o.RequestedAt +} + +// GetRequestedAtOk returns a tuple with the RequestedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetRequestedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.RequestedAt) { + return nil, false + } + return o.RequestedAt, true +} + +// HasRequestedAt returns a boolean if a field has been set. +func (o *BgpConfig) HasRequestedAt() bool { + if o != nil && !IsNil(o.RequestedAt) { + return true + } + + return false +} + +// SetRequestedAt gets a reference to the given time.Time and assigns it to the RequestedAt field. +func (o *BgpConfig) SetRequestedAt(v time.Time) { + o.RequestedAt = &v +} + +// GetRouteObject returns the RouteObject field value if set, zero value otherwise. +func (o *BgpConfig) GetRouteObject() string { + if o == nil || IsNil(o.RouteObject) { + var ret string + return ret + } + return *o.RouteObject +} + +// GetRouteObjectOk returns a tuple with the RouteObject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetRouteObjectOk() (*string, bool) { + if o == nil || IsNil(o.RouteObject) { + return nil, false + } + return o.RouteObject, true +} + +// HasRouteObject returns a boolean if a field has been set. +func (o *BgpConfig) HasRouteObject() bool { + if o != nil && !IsNil(o.RouteObject) { + return true + } + + return false +} + +// SetRouteObject gets a reference to the given string and assigns it to the RouteObject field. +func (o *BgpConfig) SetRouteObject(v string) { + o.RouteObject = &v +} + +// GetSessions returns the Sessions field value if set, zero value otherwise. +func (o *BgpConfig) GetSessions() []BgpSession { + if o == nil || IsNil(o.Sessions) { + var ret []BgpSession + return ret + } + return o.Sessions +} + +// GetSessionsOk returns a tuple with the Sessions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetSessionsOk() ([]BgpSession, bool) { + if o == nil || IsNil(o.Sessions) { + return nil, false + } + return o.Sessions, true +} + +// HasSessions returns a boolean if a field has been set. +func (o *BgpConfig) HasSessions() bool { + if o != nil && !IsNil(o.Sessions) { + return true + } + + return false +} + +// SetSessions gets a reference to the given []BgpSession and assigns it to the Sessions field. +func (o *BgpConfig) SetSessions(v []BgpSession) { + o.Sessions = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *BgpConfig) GetStatus() BgpConfigStatus { + if o == nil || IsNil(o.Status) { + var ret BgpConfigStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfig) GetStatusOk() (*BgpConfigStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *BgpConfig) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given BgpConfigStatus and assigns it to the Status field. +func (o *BgpConfig) SetStatus(v BgpConfigStatus) { + o.Status = &v +} + +func (o BgpConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Asn) { + toSerialize["asn"] = o.Asn + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.DeploymentType) { + toSerialize["deployment_type"] = o.DeploymentType + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.MaxPrefix) { + toSerialize["max_prefix"] = o.MaxPrefix + } + if o.Md5.IsSet() { + toSerialize["md5"] = o.Md5.Get() + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Ranges) { + toSerialize["ranges"] = o.Ranges + } + if !IsNil(o.RequestedAt) { + toSerialize["requested_at"] = o.RequestedAt + } + if !IsNil(o.RouteObject) { + toSerialize["route_object"] = o.RouteObject + } + if !IsNil(o.Sessions) { + toSerialize["sessions"] = o.Sessions + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpConfig) UnmarshalJSON(bytes []byte) (err error) { + varBgpConfig := _BgpConfig{} + + err = json.Unmarshal(bytes, &varBgpConfig) + + if err != nil { + return err + } + + *o = BgpConfig(varBgpConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "created_at") + delete(additionalProperties, "deployment_type") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "max_prefix") + delete(additionalProperties, "md5") + delete(additionalProperties, "project") + delete(additionalProperties, "ranges") + delete(additionalProperties, "requested_at") + delete(additionalProperties, "route_object") + delete(additionalProperties, "sessions") + delete(additionalProperties, "status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpConfig struct { + value *BgpConfig + isSet bool +} + +func (v NullableBgpConfig) Get() *BgpConfig { + return v.value +} + +func (v *NullableBgpConfig) Set(val *BgpConfig) { + v.value = val + v.isSet = true +} + +func (v NullableBgpConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpConfig(val *BgpConfig) *NullableBgpConfig { + return &NullableBgpConfig{value: val, isSet: true} +} + +func (v NullableBgpConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_config_deployment_type.go b/services/metalv1/model_bgp_config_deployment_type.go new file mode 100644 index 00000000..5104eec7 --- /dev/null +++ b/services/metalv1/model_bgp_config_deployment_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BgpConfigDeploymentType In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. +type BgpConfigDeploymentType string + +// List of BgpConfig_deployment_type +const ( + BGPCONFIGDEPLOYMENTTYPE_GLOBAL BgpConfigDeploymentType = "global" + BGPCONFIGDEPLOYMENTTYPE_LOCAL BgpConfigDeploymentType = "local" +) + +// All allowed values of BgpConfigDeploymentType enum +var AllowedBgpConfigDeploymentTypeEnumValues = []BgpConfigDeploymentType{ + "global", + "local", +} + +func (v *BgpConfigDeploymentType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BgpConfigDeploymentType(value) + for _, existing := range AllowedBgpConfigDeploymentTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BgpConfigDeploymentType", value) +} + +// NewBgpConfigDeploymentTypeFromValue returns a pointer to a valid BgpConfigDeploymentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBgpConfigDeploymentTypeFromValue(v string) (*BgpConfigDeploymentType, error) { + ev := BgpConfigDeploymentType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BgpConfigDeploymentType: valid values are %v", v, AllowedBgpConfigDeploymentTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BgpConfigDeploymentType) IsValid() bool { + for _, existing := range AllowedBgpConfigDeploymentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BgpConfig_deployment_type value +func (v BgpConfigDeploymentType) Ptr() *BgpConfigDeploymentType { + return &v +} + +type NullableBgpConfigDeploymentType struct { + value *BgpConfigDeploymentType + isSet bool +} + +func (v NullableBgpConfigDeploymentType) Get() *BgpConfigDeploymentType { + return v.value +} + +func (v *NullableBgpConfigDeploymentType) Set(val *BgpConfigDeploymentType) { + v.value = val + v.isSet = true +} + +func (v NullableBgpConfigDeploymentType) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpConfigDeploymentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpConfigDeploymentType(val *BgpConfigDeploymentType) *NullableBgpConfigDeploymentType { + return &NullableBgpConfigDeploymentType{value: val, isSet: true} +} + +func (v NullableBgpConfigDeploymentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpConfigDeploymentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_config_request_input.go b/services/metalv1/model_bgp_config_request_input.go new file mode 100644 index 00000000..85f933da --- /dev/null +++ b/services/metalv1/model_bgp_config_request_input.go @@ -0,0 +1,273 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the BgpConfigRequestInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpConfigRequestInput{} + +// BgpConfigRequestInput struct for BgpConfigRequestInput +type BgpConfigRequestInput struct { + // Autonomous System Number for local BGP deployment. + Asn int32 `json:"asn"` + DeploymentType BgpConfigRequestInputDeploymentType `json:"deployment_type"` + // The plaintext password to share between BGP neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character + Md5 *string `json:"md5,omitempty"` + // A use case explanation (necessary for global BGP request review). + UseCase *string `json:"use_case,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpConfigRequestInput BgpConfigRequestInput + +// NewBgpConfigRequestInput instantiates a new BgpConfigRequestInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpConfigRequestInput(asn int32, deploymentType BgpConfigRequestInputDeploymentType) *BgpConfigRequestInput { + this := BgpConfigRequestInput{} + this.Asn = asn + this.DeploymentType = deploymentType + return &this +} + +// NewBgpConfigRequestInputWithDefaults instantiates a new BgpConfigRequestInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpConfigRequestInputWithDefaults() *BgpConfigRequestInput { + this := BgpConfigRequestInput{} + return &this +} + +// GetAsn returns the Asn field value +func (o *BgpConfigRequestInput) GetAsn() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *BgpConfigRequestInput) GetAsnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *BgpConfigRequestInput) SetAsn(v int32) { + o.Asn = v +} + +// GetDeploymentType returns the DeploymentType field value +func (o *BgpConfigRequestInput) GetDeploymentType() BgpConfigRequestInputDeploymentType { + if o == nil { + var ret BgpConfigRequestInputDeploymentType + return ret + } + + return o.DeploymentType +} + +// GetDeploymentTypeOk returns a tuple with the DeploymentType field value +// and a boolean to check if the value has been set. +func (o *BgpConfigRequestInput) GetDeploymentTypeOk() (*BgpConfigRequestInputDeploymentType, bool) { + if o == nil { + return nil, false + } + return &o.DeploymentType, true +} + +// SetDeploymentType sets field value +func (o *BgpConfigRequestInput) SetDeploymentType(v BgpConfigRequestInputDeploymentType) { + o.DeploymentType = v +} + +// GetMd5 returns the Md5 field value if set, zero value otherwise. +func (o *BgpConfigRequestInput) GetMd5() string { + if o == nil || IsNil(o.Md5) { + var ret string + return ret + } + return *o.Md5 +} + +// GetMd5Ok returns a tuple with the Md5 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfigRequestInput) GetMd5Ok() (*string, bool) { + if o == nil || IsNil(o.Md5) { + return nil, false + } + return o.Md5, true +} + +// HasMd5 returns a boolean if a field has been set. +func (o *BgpConfigRequestInput) HasMd5() bool { + if o != nil && !IsNil(o.Md5) { + return true + } + + return false +} + +// SetMd5 gets a reference to the given string and assigns it to the Md5 field. +func (o *BgpConfigRequestInput) SetMd5(v string) { + o.Md5 = &v +} + +// GetUseCase returns the UseCase field value if set, zero value otherwise. +func (o *BgpConfigRequestInput) GetUseCase() string { + if o == nil || IsNil(o.UseCase) { + var ret string + return ret + } + return *o.UseCase +} + +// GetUseCaseOk returns a tuple with the UseCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpConfigRequestInput) GetUseCaseOk() (*string, bool) { + if o == nil || IsNil(o.UseCase) { + return nil, false + } + return o.UseCase, true +} + +// HasUseCase returns a boolean if a field has been set. +func (o *BgpConfigRequestInput) HasUseCase() bool { + if o != nil && !IsNil(o.UseCase) { + return true + } + + return false +} + +// SetUseCase gets a reference to the given string and assigns it to the UseCase field. +func (o *BgpConfigRequestInput) SetUseCase(v string) { + o.UseCase = &v +} + +func (o BgpConfigRequestInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpConfigRequestInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["asn"] = o.Asn + toSerialize["deployment_type"] = o.DeploymentType + if !IsNil(o.Md5) { + toSerialize["md5"] = o.Md5 + } + if !IsNil(o.UseCase) { + toSerialize["use_case"] = o.UseCase + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpConfigRequestInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "asn", + "deployment_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBgpConfigRequestInput := _BgpConfigRequestInput{} + + err = json.Unmarshal(bytes, &varBgpConfigRequestInput) + + if err != nil { + return err + } + + *o = BgpConfigRequestInput(varBgpConfigRequestInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "deployment_type") + delete(additionalProperties, "md5") + delete(additionalProperties, "use_case") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpConfigRequestInput struct { + value *BgpConfigRequestInput + isSet bool +} + +func (v NullableBgpConfigRequestInput) Get() *BgpConfigRequestInput { + return v.value +} + +func (v *NullableBgpConfigRequestInput) Set(val *BgpConfigRequestInput) { + v.value = val + v.isSet = true +} + +func (v NullableBgpConfigRequestInput) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpConfigRequestInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpConfigRequestInput(val *BgpConfigRequestInput) *NullableBgpConfigRequestInput { + return &NullableBgpConfigRequestInput{value: val, isSet: true} +} + +func (v NullableBgpConfigRequestInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpConfigRequestInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_config_request_input_deployment_type.go b/services/metalv1/model_bgp_config_request_input_deployment_type.go new file mode 100644 index 00000000..e9565961 --- /dev/null +++ b/services/metalv1/model_bgp_config_request_input_deployment_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BgpConfigRequestInputDeploymentType Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers. +type BgpConfigRequestInputDeploymentType string + +// List of BgpConfigRequestInput_deployment_type +const ( + BGPCONFIGREQUESTINPUTDEPLOYMENTTYPE_LOCAL BgpConfigRequestInputDeploymentType = "local" + BGPCONFIGREQUESTINPUTDEPLOYMENTTYPE_GLOBAL BgpConfigRequestInputDeploymentType = "global" +) + +// All allowed values of BgpConfigRequestInputDeploymentType enum +var AllowedBgpConfigRequestInputDeploymentTypeEnumValues = []BgpConfigRequestInputDeploymentType{ + "local", + "global", +} + +func (v *BgpConfigRequestInputDeploymentType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BgpConfigRequestInputDeploymentType(value) + for _, existing := range AllowedBgpConfigRequestInputDeploymentTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BgpConfigRequestInputDeploymentType", value) +} + +// NewBgpConfigRequestInputDeploymentTypeFromValue returns a pointer to a valid BgpConfigRequestInputDeploymentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBgpConfigRequestInputDeploymentTypeFromValue(v string) (*BgpConfigRequestInputDeploymentType, error) { + ev := BgpConfigRequestInputDeploymentType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BgpConfigRequestInputDeploymentType: valid values are %v", v, AllowedBgpConfigRequestInputDeploymentTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BgpConfigRequestInputDeploymentType) IsValid() bool { + for _, existing := range AllowedBgpConfigRequestInputDeploymentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BgpConfigRequestInput_deployment_type value +func (v BgpConfigRequestInputDeploymentType) Ptr() *BgpConfigRequestInputDeploymentType { + return &v +} + +type NullableBgpConfigRequestInputDeploymentType struct { + value *BgpConfigRequestInputDeploymentType + isSet bool +} + +func (v NullableBgpConfigRequestInputDeploymentType) Get() *BgpConfigRequestInputDeploymentType { + return v.value +} + +func (v *NullableBgpConfigRequestInputDeploymentType) Set(val *BgpConfigRequestInputDeploymentType) { + v.value = val + v.isSet = true +} + +func (v NullableBgpConfigRequestInputDeploymentType) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpConfigRequestInputDeploymentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpConfigRequestInputDeploymentType(val *BgpConfigRequestInputDeploymentType) *NullableBgpConfigRequestInputDeploymentType { + return &NullableBgpConfigRequestInputDeploymentType{value: val, isSet: true} +} + +func (v NullableBgpConfigRequestInputDeploymentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpConfigRequestInputDeploymentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_config_status.go b/services/metalv1/model_bgp_config_status.go new file mode 100644 index 00000000..878e723c --- /dev/null +++ b/services/metalv1/model_bgp_config_status.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BgpConfigStatus Status of the BGP Config. Status \"requested\" is valid only with the \"global\" deployment_type. +type BgpConfigStatus string + +// List of BgpConfig_status +const ( + BGPCONFIGSTATUS_REQUESTED BgpConfigStatus = "requested" + BGPCONFIGSTATUS_ENABLED BgpConfigStatus = "enabled" + BGPCONFIGSTATUS_DISABLED BgpConfigStatus = "disabled" +) + +// All allowed values of BgpConfigStatus enum +var AllowedBgpConfigStatusEnumValues = []BgpConfigStatus{ + "requested", + "enabled", + "disabled", +} + +func (v *BgpConfigStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BgpConfigStatus(value) + for _, existing := range AllowedBgpConfigStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BgpConfigStatus", value) +} + +// NewBgpConfigStatusFromValue returns a pointer to a valid BgpConfigStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBgpConfigStatusFromValue(v string) (*BgpConfigStatus, error) { + ev := BgpConfigStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BgpConfigStatus: valid values are %v", v, AllowedBgpConfigStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BgpConfigStatus) IsValid() bool { + for _, existing := range AllowedBgpConfigStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BgpConfig_status value +func (v BgpConfigStatus) Ptr() *BgpConfigStatus { + return &v +} + +type NullableBgpConfigStatus struct { + value *BgpConfigStatus + isSet bool +} + +func (v NullableBgpConfigStatus) Get() *BgpConfigStatus { + return v.value +} + +func (v *NullableBgpConfigStatus) Set(val *BgpConfigStatus) { + v.value = val + v.isSet = true +} + +func (v NullableBgpConfigStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpConfigStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpConfigStatus(val *BgpConfigStatus) *NullableBgpConfigStatus { + return &NullableBgpConfigStatus{value: val, isSet: true} +} + +func (v NullableBgpConfigStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpConfigStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_dynamic_neighbor.go b/services/metalv1/model_bgp_dynamic_neighbor.go new file mode 100644 index 00000000..b241fefd --- /dev/null +++ b/services/metalv1/model_bgp_dynamic_neighbor.go @@ -0,0 +1,491 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the BgpDynamicNeighbor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpDynamicNeighbor{} + +// BgpDynamicNeighbor struct for BgpDynamicNeighbor +type BgpDynamicNeighbor struct { + // The unique identifier for the resource + Id *string `json:"id,omitempty"` + // The ASN of the dynamic BGP neighbor + BgpNeighborAsn *int32 `json:"bgp_neighbor_asn,omitempty"` + // Network range of the dynamic BGP neighbor in CIDR format + BgpNeighborRange *string `json:"bgp_neighbor_range,omitempty"` + MetalGateway *VrfMetalGateway `json:"metal_gateway,omitempty"` + State *BgpDynamicNeighborState `json:"state,omitempty"` + Href *string `json:"href,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedBy *UserLimited `json:"created_by,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpDynamicNeighbor BgpDynamicNeighbor + +// NewBgpDynamicNeighbor instantiates a new BgpDynamicNeighbor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpDynamicNeighbor() *BgpDynamicNeighbor { + this := BgpDynamicNeighbor{} + return &this +} + +// NewBgpDynamicNeighborWithDefaults instantiates a new BgpDynamicNeighbor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpDynamicNeighborWithDefaults() *BgpDynamicNeighbor { + this := BgpDynamicNeighbor{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BgpDynamicNeighbor) SetId(v string) { + o.Id = &v +} + +// GetBgpNeighborAsn returns the BgpNeighborAsn field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetBgpNeighborAsn() int32 { + if o == nil || IsNil(o.BgpNeighborAsn) { + var ret int32 + return ret + } + return *o.BgpNeighborAsn +} + +// GetBgpNeighborAsnOk returns a tuple with the BgpNeighborAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetBgpNeighborAsnOk() (*int32, bool) { + if o == nil || IsNil(o.BgpNeighborAsn) { + return nil, false + } + return o.BgpNeighborAsn, true +} + +// HasBgpNeighborAsn returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasBgpNeighborAsn() bool { + if o != nil && !IsNil(o.BgpNeighborAsn) { + return true + } + + return false +} + +// SetBgpNeighborAsn gets a reference to the given int32 and assigns it to the BgpNeighborAsn field. +func (o *BgpDynamicNeighbor) SetBgpNeighborAsn(v int32) { + o.BgpNeighborAsn = &v +} + +// GetBgpNeighborRange returns the BgpNeighborRange field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetBgpNeighborRange() string { + if o == nil || IsNil(o.BgpNeighborRange) { + var ret string + return ret + } + return *o.BgpNeighborRange +} + +// GetBgpNeighborRangeOk returns a tuple with the BgpNeighborRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetBgpNeighborRangeOk() (*string, bool) { + if o == nil || IsNil(o.BgpNeighborRange) { + return nil, false + } + return o.BgpNeighborRange, true +} + +// HasBgpNeighborRange returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasBgpNeighborRange() bool { + if o != nil && !IsNil(o.BgpNeighborRange) { + return true + } + + return false +} + +// SetBgpNeighborRange gets a reference to the given string and assigns it to the BgpNeighborRange field. +func (o *BgpDynamicNeighbor) SetBgpNeighborRange(v string) { + o.BgpNeighborRange = &v +} + +// GetMetalGateway returns the MetalGateway field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetMetalGateway() VrfMetalGateway { + if o == nil || IsNil(o.MetalGateway) { + var ret VrfMetalGateway + return ret + } + return *o.MetalGateway +} + +// GetMetalGatewayOk returns a tuple with the MetalGateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetMetalGatewayOk() (*VrfMetalGateway, bool) { + if o == nil || IsNil(o.MetalGateway) { + return nil, false + } + return o.MetalGateway, true +} + +// HasMetalGateway returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasMetalGateway() bool { + if o != nil && !IsNil(o.MetalGateway) { + return true + } + + return false +} + +// SetMetalGateway gets a reference to the given VrfMetalGateway and assigns it to the MetalGateway field. +func (o *BgpDynamicNeighbor) SetMetalGateway(v VrfMetalGateway) { + o.MetalGateway = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetState() BgpDynamicNeighborState { + if o == nil || IsNil(o.State) { + var ret BgpDynamicNeighborState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetStateOk() (*BgpDynamicNeighborState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given BgpDynamicNeighborState and assigns it to the State field. +func (o *BgpDynamicNeighbor) SetState(v BgpDynamicNeighborState) { + o.State = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *BgpDynamicNeighbor) SetHref(v string) { + o.Href = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BgpDynamicNeighbor) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetCreatedBy() UserLimited { + if o == nil || IsNil(o.CreatedBy) { + var ret UserLimited + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetCreatedByOk() (*UserLimited, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given UserLimited and assigns it to the CreatedBy field. +func (o *BgpDynamicNeighbor) SetCreatedBy(v UserLimited) { + o.CreatedBy = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *BgpDynamicNeighbor) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *BgpDynamicNeighbor) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighbor) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *BgpDynamicNeighbor) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *BgpDynamicNeighbor) SetTags(v []string) { + o.Tags = v +} + +func (o BgpDynamicNeighbor) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpDynamicNeighbor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.BgpNeighborAsn) { + toSerialize["bgp_neighbor_asn"] = o.BgpNeighborAsn + } + if !IsNil(o.BgpNeighborRange) { + toSerialize["bgp_neighbor_range"] = o.BgpNeighborRange + } + if !IsNil(o.MetalGateway) { + toSerialize["metal_gateway"] = o.MetalGateway + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpDynamicNeighbor) UnmarshalJSON(bytes []byte) (err error) { + varBgpDynamicNeighbor := _BgpDynamicNeighbor{} + + err = json.Unmarshal(bytes, &varBgpDynamicNeighbor) + + if err != nil { + return err + } + + *o = BgpDynamicNeighbor(varBgpDynamicNeighbor) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "bgp_neighbor_asn") + delete(additionalProperties, "bgp_neighbor_range") + delete(additionalProperties, "metal_gateway") + delete(additionalProperties, "state") + delete(additionalProperties, "href") + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpDynamicNeighbor struct { + value *BgpDynamicNeighbor + isSet bool +} + +func (v NullableBgpDynamicNeighbor) Get() *BgpDynamicNeighbor { + return v.value +} + +func (v *NullableBgpDynamicNeighbor) Set(val *BgpDynamicNeighbor) { + v.value = val + v.isSet = true +} + +func (v NullableBgpDynamicNeighbor) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpDynamicNeighbor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpDynamicNeighbor(val *BgpDynamicNeighbor) *NullableBgpDynamicNeighbor { + return &NullableBgpDynamicNeighbor{value: val, isSet: true} +} + +func (v NullableBgpDynamicNeighbor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpDynamicNeighbor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_dynamic_neighbor_create_input.go b/services/metalv1/model_bgp_dynamic_neighbor_create_input.go new file mode 100644 index 00000000..e3bd5d8f --- /dev/null +++ b/services/metalv1/model_bgp_dynamic_neighbor_create_input.go @@ -0,0 +1,235 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the BgpDynamicNeighborCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpDynamicNeighborCreateInput{} + +// BgpDynamicNeighborCreateInput struct for BgpDynamicNeighborCreateInput +type BgpDynamicNeighborCreateInput struct { + // Network range of the dynamic BGP neighbor in CIDR format + BgpNeighborRange string `json:"bgp_neighbor_range"` + // The ASN of the dynamic BGP neighbor + BgpNeighborAsn int32 `json:"bgp_neighbor_asn"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpDynamicNeighborCreateInput BgpDynamicNeighborCreateInput + +// NewBgpDynamicNeighborCreateInput instantiates a new BgpDynamicNeighborCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpDynamicNeighborCreateInput(bgpNeighborRange string, bgpNeighborAsn int32) *BgpDynamicNeighborCreateInput { + this := BgpDynamicNeighborCreateInput{} + this.BgpNeighborRange = bgpNeighborRange + this.BgpNeighborAsn = bgpNeighborAsn + return &this +} + +// NewBgpDynamicNeighborCreateInputWithDefaults instantiates a new BgpDynamicNeighborCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpDynamicNeighborCreateInputWithDefaults() *BgpDynamicNeighborCreateInput { + this := BgpDynamicNeighborCreateInput{} + return &this +} + +// GetBgpNeighborRange returns the BgpNeighborRange field value +func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborRange() string { + if o == nil { + var ret string + return ret + } + + return o.BgpNeighborRange +} + +// GetBgpNeighborRangeOk returns a tuple with the BgpNeighborRange field value +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborRangeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BgpNeighborRange, true +} + +// SetBgpNeighborRange sets field value +func (o *BgpDynamicNeighborCreateInput) SetBgpNeighborRange(v string) { + o.BgpNeighborRange = v +} + +// GetBgpNeighborAsn returns the BgpNeighborAsn field value +func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborAsn() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BgpNeighborAsn +} + +// GetBgpNeighborAsnOk returns a tuple with the BgpNeighborAsn field value +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighborCreateInput) GetBgpNeighborAsnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BgpNeighborAsn, true +} + +// SetBgpNeighborAsn sets field value +func (o *BgpDynamicNeighborCreateInput) SetBgpNeighborAsn(v int32) { + o.BgpNeighborAsn = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *BgpDynamicNeighborCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighborCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *BgpDynamicNeighborCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *BgpDynamicNeighborCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o BgpDynamicNeighborCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpDynamicNeighborCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bgp_neighbor_range"] = o.BgpNeighborRange + toSerialize["bgp_neighbor_asn"] = o.BgpNeighborAsn + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpDynamicNeighborCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bgp_neighbor_range", + "bgp_neighbor_asn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBgpDynamicNeighborCreateInput := _BgpDynamicNeighborCreateInput{} + + err = json.Unmarshal(bytes, &varBgpDynamicNeighborCreateInput) + + if err != nil { + return err + } + + *o = BgpDynamicNeighborCreateInput(varBgpDynamicNeighborCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_neighbor_range") + delete(additionalProperties, "bgp_neighbor_asn") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpDynamicNeighborCreateInput struct { + value *BgpDynamicNeighborCreateInput + isSet bool +} + +func (v NullableBgpDynamicNeighborCreateInput) Get() *BgpDynamicNeighborCreateInput { + return v.value +} + +func (v *NullableBgpDynamicNeighborCreateInput) Set(val *BgpDynamicNeighborCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableBgpDynamicNeighborCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpDynamicNeighborCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpDynamicNeighborCreateInput(val *BgpDynamicNeighborCreateInput) *NullableBgpDynamicNeighborCreateInput { + return &NullableBgpDynamicNeighborCreateInput{value: val, isSet: true} +} + +func (v NullableBgpDynamicNeighborCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpDynamicNeighborCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_dynamic_neighbor_list.go b/services/metalv1/model_bgp_dynamic_neighbor_list.go new file mode 100644 index 00000000..6463c289 --- /dev/null +++ b/services/metalv1/model_bgp_dynamic_neighbor_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BgpDynamicNeighborList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpDynamicNeighborList{} + +// BgpDynamicNeighborList struct for BgpDynamicNeighborList +type BgpDynamicNeighborList struct { + BgpDynamicNeighbors []BgpDynamicNeighbor `json:"bgp_dynamic_neighbors,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpDynamicNeighborList BgpDynamicNeighborList + +// NewBgpDynamicNeighborList instantiates a new BgpDynamicNeighborList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpDynamicNeighborList() *BgpDynamicNeighborList { + this := BgpDynamicNeighborList{} + return &this +} + +// NewBgpDynamicNeighborListWithDefaults instantiates a new BgpDynamicNeighborList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpDynamicNeighborListWithDefaults() *BgpDynamicNeighborList { + this := BgpDynamicNeighborList{} + return &this +} + +// GetBgpDynamicNeighbors returns the BgpDynamicNeighbors field value if set, zero value otherwise. +func (o *BgpDynamicNeighborList) GetBgpDynamicNeighbors() []BgpDynamicNeighbor { + if o == nil || IsNil(o.BgpDynamicNeighbors) { + var ret []BgpDynamicNeighbor + return ret + } + return o.BgpDynamicNeighbors +} + +// GetBgpDynamicNeighborsOk returns a tuple with the BgpDynamicNeighbors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighborList) GetBgpDynamicNeighborsOk() ([]BgpDynamicNeighbor, bool) { + if o == nil || IsNil(o.BgpDynamicNeighbors) { + return nil, false + } + return o.BgpDynamicNeighbors, true +} + +// HasBgpDynamicNeighbors returns a boolean if a field has been set. +func (o *BgpDynamicNeighborList) HasBgpDynamicNeighbors() bool { + if o != nil && !IsNil(o.BgpDynamicNeighbors) { + return true + } + + return false +} + +// SetBgpDynamicNeighbors gets a reference to the given []BgpDynamicNeighbor and assigns it to the BgpDynamicNeighbors field. +func (o *BgpDynamicNeighborList) SetBgpDynamicNeighbors(v []BgpDynamicNeighbor) { + o.BgpDynamicNeighbors = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *BgpDynamicNeighborList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpDynamicNeighborList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *BgpDynamicNeighborList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *BgpDynamicNeighborList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o BgpDynamicNeighborList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpDynamicNeighborList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpDynamicNeighbors) { + toSerialize["bgp_dynamic_neighbors"] = o.BgpDynamicNeighbors + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpDynamicNeighborList) UnmarshalJSON(bytes []byte) (err error) { + varBgpDynamicNeighborList := _BgpDynamicNeighborList{} + + err = json.Unmarshal(bytes, &varBgpDynamicNeighborList) + + if err != nil { + return err + } + + *o = BgpDynamicNeighborList(varBgpDynamicNeighborList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_dynamic_neighbors") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpDynamicNeighborList struct { + value *BgpDynamicNeighborList + isSet bool +} + +func (v NullableBgpDynamicNeighborList) Get() *BgpDynamicNeighborList { + return v.value +} + +func (v *NullableBgpDynamicNeighborList) Set(val *BgpDynamicNeighborList) { + v.value = val + v.isSet = true +} + +func (v NullableBgpDynamicNeighborList) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpDynamicNeighborList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpDynamicNeighborList(val *BgpDynamicNeighborList) *NullableBgpDynamicNeighborList { + return &NullableBgpDynamicNeighborList{value: val, isSet: true} +} + +func (v NullableBgpDynamicNeighborList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpDynamicNeighborList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_dynamic_neighbor_state.go b/services/metalv1/model_bgp_dynamic_neighbor_state.go new file mode 100644 index 00000000..5f52577c --- /dev/null +++ b/services/metalv1/model_bgp_dynamic_neighbor_state.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BgpDynamicNeighborState the model 'BgpDynamicNeighborState' +type BgpDynamicNeighborState string + +// List of BgpDynamicNeighbor_state +const ( + BGPDYNAMICNEIGHBORSTATE_ACTIVE BgpDynamicNeighborState = "active" + BGPDYNAMICNEIGHBORSTATE_DELETING BgpDynamicNeighborState = "deleting" + BGPDYNAMICNEIGHBORSTATE_PENDING BgpDynamicNeighborState = "pending" + BGPDYNAMICNEIGHBORSTATE_READY BgpDynamicNeighborState = "ready" +) + +// All allowed values of BgpDynamicNeighborState enum +var AllowedBgpDynamicNeighborStateEnumValues = []BgpDynamicNeighborState{ + "active", + "deleting", + "pending", + "ready", +} + +func (v *BgpDynamicNeighborState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BgpDynamicNeighborState(value) + for _, existing := range AllowedBgpDynamicNeighborStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BgpDynamicNeighborState", value) +} + +// NewBgpDynamicNeighborStateFromValue returns a pointer to a valid BgpDynamicNeighborState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBgpDynamicNeighborStateFromValue(v string) (*BgpDynamicNeighborState, error) { + ev := BgpDynamicNeighborState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BgpDynamicNeighborState: valid values are %v", v, AllowedBgpDynamicNeighborStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BgpDynamicNeighborState) IsValid() bool { + for _, existing := range AllowedBgpDynamicNeighborStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BgpDynamicNeighbor_state value +func (v BgpDynamicNeighborState) Ptr() *BgpDynamicNeighborState { + return &v +} + +type NullableBgpDynamicNeighborState struct { + value *BgpDynamicNeighborState + isSet bool +} + +func (v NullableBgpDynamicNeighborState) Get() *BgpDynamicNeighborState { + return v.value +} + +func (v *NullableBgpDynamicNeighborState) Set(val *BgpDynamicNeighborState) { + v.value = val + v.isSet = true +} + +func (v NullableBgpDynamicNeighborState) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpDynamicNeighborState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpDynamicNeighborState(val *BgpDynamicNeighborState) *NullableBgpDynamicNeighborState { + return &NullableBgpDynamicNeighborState{value: val, isSet: true} +} + +func (v NullableBgpDynamicNeighborState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpDynamicNeighborState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_neighbor_data.go b/services/metalv1/model_bgp_neighbor_data.go new file mode 100644 index 00000000..43164909 --- /dev/null +++ b/services/metalv1/model_bgp_neighbor_data.go @@ -0,0 +1,497 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BgpNeighborData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpNeighborData{} + +// BgpNeighborData struct for BgpNeighborData +type BgpNeighborData struct { + // Address Family for IP Address. Accepted values are 4 or 6 + AddressFamily *int32 `json:"address_family,omitempty"` + // The customer's ASN. In a local BGP deployment, this will be an internal ASN used to route within the data center. For a global BGP deployment, this will be the your own ASN, configured when you set up BGP for your project. + CustomerAs *int32 `json:"customer_as,omitempty"` + // The device's IP address. For an IPv4 BGP session, this is typically the private bond0 address for the device. + CustomerIp *string `json:"customer_ip,omitempty"` + // True if an MD5 password is configured for the project. + Md5Enabled *bool `json:"md5_enabled,omitempty"` + // The MD5 password configured for the project, if set. + Md5Password *string `json:"md5_password,omitempty"` + // True when the BGP session should be configured as multihop. + Multihop *bool `json:"multihop,omitempty"` + // The Peer ASN to use when configuring BGP on your device. + PeerAs *int32 `json:"peer_as,omitempty"` + // A list of one or more IP addresses to use for the Peer IP section of your BGP configuration. For non-multihop sessions, this will typically be a single gateway address for the device. For multihop sessions, it will be a list of IPs. + PeerIps []string `json:"peer_ips,omitempty"` + // A list of project subnets + RoutesIn []BgpRoute `json:"routes_in,omitempty"` + // A list of outgoing routes. Only populated if the BGP session has default route enabled. + RoutesOut []BgpRoute `json:"routes_out,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpNeighborData BgpNeighborData + +// NewBgpNeighborData instantiates a new BgpNeighborData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpNeighborData() *BgpNeighborData { + this := BgpNeighborData{} + return &this +} + +// NewBgpNeighborDataWithDefaults instantiates a new BgpNeighborData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpNeighborDataWithDefaults() *BgpNeighborData { + this := BgpNeighborData{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *BgpNeighborData) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *BgpNeighborData) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *BgpNeighborData) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetCustomerAs returns the CustomerAs field value if set, zero value otherwise. +func (o *BgpNeighborData) GetCustomerAs() int32 { + if o == nil || IsNil(o.CustomerAs) { + var ret int32 + return ret + } + return *o.CustomerAs +} + +// GetCustomerAsOk returns a tuple with the CustomerAs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetCustomerAsOk() (*int32, bool) { + if o == nil || IsNil(o.CustomerAs) { + return nil, false + } + return o.CustomerAs, true +} + +// HasCustomerAs returns a boolean if a field has been set. +func (o *BgpNeighborData) HasCustomerAs() bool { + if o != nil && !IsNil(o.CustomerAs) { + return true + } + + return false +} + +// SetCustomerAs gets a reference to the given int32 and assigns it to the CustomerAs field. +func (o *BgpNeighborData) SetCustomerAs(v int32) { + o.CustomerAs = &v +} + +// GetCustomerIp returns the CustomerIp field value if set, zero value otherwise. +func (o *BgpNeighborData) GetCustomerIp() string { + if o == nil || IsNil(o.CustomerIp) { + var ret string + return ret + } + return *o.CustomerIp +} + +// GetCustomerIpOk returns a tuple with the CustomerIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetCustomerIpOk() (*string, bool) { + if o == nil || IsNil(o.CustomerIp) { + return nil, false + } + return o.CustomerIp, true +} + +// HasCustomerIp returns a boolean if a field has been set. +func (o *BgpNeighborData) HasCustomerIp() bool { + if o != nil && !IsNil(o.CustomerIp) { + return true + } + + return false +} + +// SetCustomerIp gets a reference to the given string and assigns it to the CustomerIp field. +func (o *BgpNeighborData) SetCustomerIp(v string) { + o.CustomerIp = &v +} + +// GetMd5Enabled returns the Md5Enabled field value if set, zero value otherwise. +func (o *BgpNeighborData) GetMd5Enabled() bool { + if o == nil || IsNil(o.Md5Enabled) { + var ret bool + return ret + } + return *o.Md5Enabled +} + +// GetMd5EnabledOk returns a tuple with the Md5Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetMd5EnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Md5Enabled) { + return nil, false + } + return o.Md5Enabled, true +} + +// HasMd5Enabled returns a boolean if a field has been set. +func (o *BgpNeighborData) HasMd5Enabled() bool { + if o != nil && !IsNil(o.Md5Enabled) { + return true + } + + return false +} + +// SetMd5Enabled gets a reference to the given bool and assigns it to the Md5Enabled field. +func (o *BgpNeighborData) SetMd5Enabled(v bool) { + o.Md5Enabled = &v +} + +// GetMd5Password returns the Md5Password field value if set, zero value otherwise. +func (o *BgpNeighborData) GetMd5Password() string { + if o == nil || IsNil(o.Md5Password) { + var ret string + return ret + } + return *o.Md5Password +} + +// GetMd5PasswordOk returns a tuple with the Md5Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetMd5PasswordOk() (*string, bool) { + if o == nil || IsNil(o.Md5Password) { + return nil, false + } + return o.Md5Password, true +} + +// HasMd5Password returns a boolean if a field has been set. +func (o *BgpNeighborData) HasMd5Password() bool { + if o != nil && !IsNil(o.Md5Password) { + return true + } + + return false +} + +// SetMd5Password gets a reference to the given string and assigns it to the Md5Password field. +func (o *BgpNeighborData) SetMd5Password(v string) { + o.Md5Password = &v +} + +// GetMultihop returns the Multihop field value if set, zero value otherwise. +func (o *BgpNeighborData) GetMultihop() bool { + if o == nil || IsNil(o.Multihop) { + var ret bool + return ret + } + return *o.Multihop +} + +// GetMultihopOk returns a tuple with the Multihop field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetMultihopOk() (*bool, bool) { + if o == nil || IsNil(o.Multihop) { + return nil, false + } + return o.Multihop, true +} + +// HasMultihop returns a boolean if a field has been set. +func (o *BgpNeighborData) HasMultihop() bool { + if o != nil && !IsNil(o.Multihop) { + return true + } + + return false +} + +// SetMultihop gets a reference to the given bool and assigns it to the Multihop field. +func (o *BgpNeighborData) SetMultihop(v bool) { + o.Multihop = &v +} + +// GetPeerAs returns the PeerAs field value if set, zero value otherwise. +func (o *BgpNeighborData) GetPeerAs() int32 { + if o == nil || IsNil(o.PeerAs) { + var ret int32 + return ret + } + return *o.PeerAs +} + +// GetPeerAsOk returns a tuple with the PeerAs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetPeerAsOk() (*int32, bool) { + if o == nil || IsNil(o.PeerAs) { + return nil, false + } + return o.PeerAs, true +} + +// HasPeerAs returns a boolean if a field has been set. +func (o *BgpNeighborData) HasPeerAs() bool { + if o != nil && !IsNil(o.PeerAs) { + return true + } + + return false +} + +// SetPeerAs gets a reference to the given int32 and assigns it to the PeerAs field. +func (o *BgpNeighborData) SetPeerAs(v int32) { + o.PeerAs = &v +} + +// GetPeerIps returns the PeerIps field value if set, zero value otherwise. +func (o *BgpNeighborData) GetPeerIps() []string { + if o == nil || IsNil(o.PeerIps) { + var ret []string + return ret + } + return o.PeerIps +} + +// GetPeerIpsOk returns a tuple with the PeerIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetPeerIpsOk() ([]string, bool) { + if o == nil || IsNil(o.PeerIps) { + return nil, false + } + return o.PeerIps, true +} + +// HasPeerIps returns a boolean if a field has been set. +func (o *BgpNeighborData) HasPeerIps() bool { + if o != nil && !IsNil(o.PeerIps) { + return true + } + + return false +} + +// SetPeerIps gets a reference to the given []string and assigns it to the PeerIps field. +func (o *BgpNeighborData) SetPeerIps(v []string) { + o.PeerIps = v +} + +// GetRoutesIn returns the RoutesIn field value if set, zero value otherwise. +func (o *BgpNeighborData) GetRoutesIn() []BgpRoute { + if o == nil || IsNil(o.RoutesIn) { + var ret []BgpRoute + return ret + } + return o.RoutesIn +} + +// GetRoutesInOk returns a tuple with the RoutesIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetRoutesInOk() ([]BgpRoute, bool) { + if o == nil || IsNil(o.RoutesIn) { + return nil, false + } + return o.RoutesIn, true +} + +// HasRoutesIn returns a boolean if a field has been set. +func (o *BgpNeighborData) HasRoutesIn() bool { + if o != nil && !IsNil(o.RoutesIn) { + return true + } + + return false +} + +// SetRoutesIn gets a reference to the given []BgpRoute and assigns it to the RoutesIn field. +func (o *BgpNeighborData) SetRoutesIn(v []BgpRoute) { + o.RoutesIn = v +} + +// GetRoutesOut returns the RoutesOut field value if set, zero value otherwise. +func (o *BgpNeighborData) GetRoutesOut() []BgpRoute { + if o == nil || IsNil(o.RoutesOut) { + var ret []BgpRoute + return ret + } + return o.RoutesOut +} + +// GetRoutesOutOk returns a tuple with the RoutesOut field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpNeighborData) GetRoutesOutOk() ([]BgpRoute, bool) { + if o == nil || IsNil(o.RoutesOut) { + return nil, false + } + return o.RoutesOut, true +} + +// HasRoutesOut returns a boolean if a field has been set. +func (o *BgpNeighborData) HasRoutesOut() bool { + if o != nil && !IsNil(o.RoutesOut) { + return true + } + + return false +} + +// SetRoutesOut gets a reference to the given []BgpRoute and assigns it to the RoutesOut field. +func (o *BgpNeighborData) SetRoutesOut(v []BgpRoute) { + o.RoutesOut = v +} + +func (o BgpNeighborData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpNeighborData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.CustomerAs) { + toSerialize["customer_as"] = o.CustomerAs + } + if !IsNil(o.CustomerIp) { + toSerialize["customer_ip"] = o.CustomerIp + } + if !IsNil(o.Md5Enabled) { + toSerialize["md5_enabled"] = o.Md5Enabled + } + if !IsNil(o.Md5Password) { + toSerialize["md5_password"] = o.Md5Password + } + if !IsNil(o.Multihop) { + toSerialize["multihop"] = o.Multihop + } + if !IsNil(o.PeerAs) { + toSerialize["peer_as"] = o.PeerAs + } + if !IsNil(o.PeerIps) { + toSerialize["peer_ips"] = o.PeerIps + } + if !IsNil(o.RoutesIn) { + toSerialize["routes_in"] = o.RoutesIn + } + if !IsNil(o.RoutesOut) { + toSerialize["routes_out"] = o.RoutesOut + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpNeighborData) UnmarshalJSON(bytes []byte) (err error) { + varBgpNeighborData := _BgpNeighborData{} + + err = json.Unmarshal(bytes, &varBgpNeighborData) + + if err != nil { + return err + } + + *o = BgpNeighborData(varBgpNeighborData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "customer_as") + delete(additionalProperties, "customer_ip") + delete(additionalProperties, "md5_enabled") + delete(additionalProperties, "md5_password") + delete(additionalProperties, "multihop") + delete(additionalProperties, "peer_as") + delete(additionalProperties, "peer_ips") + delete(additionalProperties, "routes_in") + delete(additionalProperties, "routes_out") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpNeighborData struct { + value *BgpNeighborData + isSet bool +} + +func (v NullableBgpNeighborData) Get() *BgpNeighborData { + return v.value +} + +func (v *NullableBgpNeighborData) Set(val *BgpNeighborData) { + v.value = val + v.isSet = true +} + +func (v NullableBgpNeighborData) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpNeighborData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpNeighborData(val *BgpNeighborData) *NullableBgpNeighborData { + return &NullableBgpNeighborData{value: val, isSet: true} +} + +func (v NullableBgpNeighborData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpNeighborData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_route.go b/services/metalv1/model_bgp_route.go new file mode 100644 index 00000000..fb1071ed --- /dev/null +++ b/services/metalv1/model_bgp_route.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BgpRoute type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpRoute{} + +// BgpRoute struct for BgpRoute +type BgpRoute struct { + Exact *bool `json:"exact,omitempty"` + Route *string `json:"route,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpRoute BgpRoute + +// NewBgpRoute instantiates a new BgpRoute object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpRoute() *BgpRoute { + this := BgpRoute{} + return &this +} + +// NewBgpRouteWithDefaults instantiates a new BgpRoute object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpRouteWithDefaults() *BgpRoute { + this := BgpRoute{} + return &this +} + +// GetExact returns the Exact field value if set, zero value otherwise. +func (o *BgpRoute) GetExact() bool { + if o == nil || IsNil(o.Exact) { + var ret bool + return ret + } + return *o.Exact +} + +// GetExactOk returns a tuple with the Exact field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpRoute) GetExactOk() (*bool, bool) { + if o == nil || IsNil(o.Exact) { + return nil, false + } + return o.Exact, true +} + +// HasExact returns a boolean if a field has been set. +func (o *BgpRoute) HasExact() bool { + if o != nil && !IsNil(o.Exact) { + return true + } + + return false +} + +// SetExact gets a reference to the given bool and assigns it to the Exact field. +func (o *BgpRoute) SetExact(v bool) { + o.Exact = &v +} + +// GetRoute returns the Route field value if set, zero value otherwise. +func (o *BgpRoute) GetRoute() string { + if o == nil || IsNil(o.Route) { + var ret string + return ret + } + return *o.Route +} + +// GetRouteOk returns a tuple with the Route field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpRoute) GetRouteOk() (*string, bool) { + if o == nil || IsNil(o.Route) { + return nil, false + } + return o.Route, true +} + +// HasRoute returns a boolean if a field has been set. +func (o *BgpRoute) HasRoute() bool { + if o != nil && !IsNil(o.Route) { + return true + } + + return false +} + +// SetRoute gets a reference to the given string and assigns it to the Route field. +func (o *BgpRoute) SetRoute(v string) { + o.Route = &v +} + +func (o BgpRoute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpRoute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Exact) { + toSerialize["exact"] = o.Exact + } + if !IsNil(o.Route) { + toSerialize["route"] = o.Route + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpRoute) UnmarshalJSON(bytes []byte) (err error) { + varBgpRoute := _BgpRoute{} + + err = json.Unmarshal(bytes, &varBgpRoute) + + if err != nil { + return err + } + + *o = BgpRoute(varBgpRoute) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "exact") + delete(additionalProperties, "route") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpRoute struct { + value *BgpRoute + isSet bool +} + +func (v NullableBgpRoute) Get() *BgpRoute { + return v.value +} + +func (v *NullableBgpRoute) Set(val *BgpRoute) { + v.value = val + v.isSet = true +} + +func (v NullableBgpRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpRoute(val *BgpRoute) *NullableBgpRoute { + return &NullableBgpRoute{value: val, isSet: true} +} + +func (v NullableBgpRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session.go b/services/metalv1/model_bgp_session.go new file mode 100644 index 00000000..da90d1bc --- /dev/null +++ b/services/metalv1/model_bgp_session.go @@ -0,0 +1,465 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the BgpSession type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpSession{} + +// BgpSession struct for BgpSession +type BgpSession struct { + AddressFamily BgpSessionAddressFamily `json:"address_family"` + CreatedAt *time.Time `json:"created_at,omitempty"` + DefaultRoute *bool `json:"default_route,omitempty"` + Device *Href `json:"device,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + LearnedRoutes []string `json:"learned_routes,omitempty"` + // The status of the BGP Session. Multiple status values may be reported when the device is connected to multiple switches, one value per switch. Each status will start with \"unknown\" and progress to \"up\" or \"down\" depending on the connected device. Subsequent \"unknown\" values indicate a problem acquiring status from the switch. + Status *string `json:"status,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpSession BgpSession + +// NewBgpSession instantiates a new BgpSession object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpSession(addressFamily BgpSessionAddressFamily) *BgpSession { + this := BgpSession{} + this.AddressFamily = addressFamily + return &this +} + +// NewBgpSessionWithDefaults instantiates a new BgpSession object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpSessionWithDefaults() *BgpSession { + this := BgpSession{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value +func (o *BgpSession) GetAddressFamily() BgpSessionAddressFamily { + if o == nil { + var ret BgpSessionAddressFamily + return ret + } + + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value +// and a boolean to check if the value has been set. +func (o *BgpSession) GetAddressFamilyOk() (*BgpSessionAddressFamily, bool) { + if o == nil { + return nil, false + } + return &o.AddressFamily, true +} + +// SetAddressFamily sets field value +func (o *BgpSession) SetAddressFamily(v BgpSessionAddressFamily) { + o.AddressFamily = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BgpSession) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BgpSession) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BgpSession) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefaultRoute returns the DefaultRoute field value if set, zero value otherwise. +func (o *BgpSession) GetDefaultRoute() bool { + if o == nil || IsNil(o.DefaultRoute) { + var ret bool + return ret + } + return *o.DefaultRoute +} + +// GetDefaultRouteOk returns a tuple with the DefaultRoute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetDefaultRouteOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultRoute) { + return nil, false + } + return o.DefaultRoute, true +} + +// HasDefaultRoute returns a boolean if a field has been set. +func (o *BgpSession) HasDefaultRoute() bool { + if o != nil && !IsNil(o.DefaultRoute) { + return true + } + + return false +} + +// SetDefaultRoute gets a reference to the given bool and assigns it to the DefaultRoute field. +func (o *BgpSession) SetDefaultRoute(v bool) { + o.DefaultRoute = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *BgpSession) GetDevice() Href { + if o == nil || IsNil(o.Device) { + var ret Href + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetDeviceOk() (*Href, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *BgpSession) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given Href and assigns it to the Device field. +func (o *BgpSession) SetDevice(v Href) { + o.Device = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *BgpSession) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *BgpSession) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *BgpSession) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BgpSession) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BgpSession) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BgpSession) SetId(v string) { + o.Id = &v +} + +// GetLearnedRoutes returns the LearnedRoutes field value if set, zero value otherwise. +func (o *BgpSession) GetLearnedRoutes() []string { + if o == nil || IsNil(o.LearnedRoutes) { + var ret []string + return ret + } + return o.LearnedRoutes +} + +// GetLearnedRoutesOk returns a tuple with the LearnedRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetLearnedRoutesOk() ([]string, bool) { + if o == nil || IsNil(o.LearnedRoutes) { + return nil, false + } + return o.LearnedRoutes, true +} + +// HasLearnedRoutes returns a boolean if a field has been set. +func (o *BgpSession) HasLearnedRoutes() bool { + if o != nil && !IsNil(o.LearnedRoutes) { + return true + } + + return false +} + +// SetLearnedRoutes gets a reference to the given []string and assigns it to the LearnedRoutes field. +func (o *BgpSession) SetLearnedRoutes(v []string) { + o.LearnedRoutes = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *BgpSession) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *BgpSession) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *BgpSession) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *BgpSession) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSession) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *BgpSession) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *BgpSession) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o BgpSession) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpSession) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address_family"] = o.AddressFamily + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.DefaultRoute) { + toSerialize["default_route"] = o.DefaultRoute + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.LearnedRoutes) { + toSerialize["learned_routes"] = o.LearnedRoutes + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpSession) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address_family", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBgpSession := _BgpSession{} + + err = json.Unmarshal(bytes, &varBgpSession) + + if err != nil { + return err + } + + *o = BgpSession(varBgpSession) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "created_at") + delete(additionalProperties, "default_route") + delete(additionalProperties, "device") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "learned_routes") + delete(additionalProperties, "status") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpSession struct { + value *BgpSession + isSet bool +} + +func (v NullableBgpSession) Get() *BgpSession { + return v.value +} + +func (v *NullableBgpSession) Set(val *BgpSession) { + v.value = val + v.isSet = true +} + +func (v NullableBgpSession) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpSession) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpSession(val *BgpSession) *NullableBgpSession { + return &NullableBgpSession{value: val, isSet: true} +} + +func (v NullableBgpSession) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpSession) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session_address_family.go b/services/metalv1/model_bgp_session_address_family.go new file mode 100644 index 00000000..8cab0b19 --- /dev/null +++ b/services/metalv1/model_bgp_session_address_family.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BgpSessionAddressFamily the model 'BgpSessionAddressFamily' +type BgpSessionAddressFamily string + +// List of BgpSession_address_family +const ( + BGPSESSIONADDRESSFAMILY_IPV4 BgpSessionAddressFamily = "ipv4" + BGPSESSIONADDRESSFAMILY_IPV6 BgpSessionAddressFamily = "ipv6" +) + +// All allowed values of BgpSessionAddressFamily enum +var AllowedBgpSessionAddressFamilyEnumValues = []BgpSessionAddressFamily{ + "ipv4", + "ipv6", +} + +func (v *BgpSessionAddressFamily) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BgpSessionAddressFamily(value) + for _, existing := range AllowedBgpSessionAddressFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BgpSessionAddressFamily", value) +} + +// NewBgpSessionAddressFamilyFromValue returns a pointer to a valid BgpSessionAddressFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBgpSessionAddressFamilyFromValue(v string) (*BgpSessionAddressFamily, error) { + ev := BgpSessionAddressFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BgpSessionAddressFamily: valid values are %v", v, AllowedBgpSessionAddressFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BgpSessionAddressFamily) IsValid() bool { + for _, existing := range AllowedBgpSessionAddressFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BgpSession_address_family value +func (v BgpSessionAddressFamily) Ptr() *BgpSessionAddressFamily { + return &v +} + +type NullableBgpSessionAddressFamily struct { + value *BgpSessionAddressFamily + isSet bool +} + +func (v NullableBgpSessionAddressFamily) Get() *BgpSessionAddressFamily { + return v.value +} + +func (v *NullableBgpSessionAddressFamily) Set(val *BgpSessionAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableBgpSessionAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpSessionAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpSessionAddressFamily(val *BgpSessionAddressFamily) *NullableBgpSessionAddressFamily { + return &NullableBgpSessionAddressFamily{value: val, isSet: true} +} + +func (v NullableBgpSessionAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpSessionAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session_input.go b/services/metalv1/model_bgp_session_input.go new file mode 100644 index 00000000..68c104cc --- /dev/null +++ b/services/metalv1/model_bgp_session_input.go @@ -0,0 +1,196 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BGPSessionInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BGPSessionInput{} + +// BGPSessionInput struct for BGPSessionInput +type BGPSessionInput struct { + AddressFamily *BGPSessionInputAddressFamily `json:"address_family,omitempty"` + // Set the default route policy. + DefaultRoute *bool `json:"default_route,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BGPSessionInput BGPSessionInput + +// NewBGPSessionInput instantiates a new BGPSessionInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBGPSessionInput() *BGPSessionInput { + this := BGPSessionInput{} + var defaultRoute bool = false + this.DefaultRoute = &defaultRoute + return &this +} + +// NewBGPSessionInputWithDefaults instantiates a new BGPSessionInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBGPSessionInputWithDefaults() *BGPSessionInput { + this := BGPSessionInput{} + var defaultRoute bool = false + this.DefaultRoute = &defaultRoute + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *BGPSessionInput) GetAddressFamily() BGPSessionInputAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret BGPSessionInputAddressFamily + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BGPSessionInput) GetAddressFamilyOk() (*BGPSessionInputAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *BGPSessionInput) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given BGPSessionInputAddressFamily and assigns it to the AddressFamily field. +func (o *BGPSessionInput) SetAddressFamily(v BGPSessionInputAddressFamily) { + o.AddressFamily = &v +} + +// GetDefaultRoute returns the DefaultRoute field value if set, zero value otherwise. +func (o *BGPSessionInput) GetDefaultRoute() bool { + if o == nil || IsNil(o.DefaultRoute) { + var ret bool + return ret + } + return *o.DefaultRoute +} + +// GetDefaultRouteOk returns a tuple with the DefaultRoute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BGPSessionInput) GetDefaultRouteOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultRoute) { + return nil, false + } + return o.DefaultRoute, true +} + +// HasDefaultRoute returns a boolean if a field has been set. +func (o *BGPSessionInput) HasDefaultRoute() bool { + if o != nil && !IsNil(o.DefaultRoute) { + return true + } + + return false +} + +// SetDefaultRoute gets a reference to the given bool and assigns it to the DefaultRoute field. +func (o *BGPSessionInput) SetDefaultRoute(v bool) { + o.DefaultRoute = &v +} + +func (o BGPSessionInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BGPSessionInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.DefaultRoute) { + toSerialize["default_route"] = o.DefaultRoute + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BGPSessionInput) UnmarshalJSON(bytes []byte) (err error) { + varBGPSessionInput := _BGPSessionInput{} + + err = json.Unmarshal(bytes, &varBGPSessionInput) + + if err != nil { + return err + } + + *o = BGPSessionInput(varBGPSessionInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "default_route") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBGPSessionInput struct { + value *BGPSessionInput + isSet bool +} + +func (v NullableBGPSessionInput) Get() *BGPSessionInput { + return v.value +} + +func (v *NullableBGPSessionInput) Set(val *BGPSessionInput) { + v.value = val + v.isSet = true +} + +func (v NullableBGPSessionInput) IsSet() bool { + return v.isSet +} + +func (v *NullableBGPSessionInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBGPSessionInput(val *BGPSessionInput) *NullableBGPSessionInput { + return &NullableBGPSessionInput{value: val, isSet: true} +} + +func (v NullableBGPSessionInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBGPSessionInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session_input_address_family.go b/services/metalv1/model_bgp_session_input_address_family.go new file mode 100644 index 00000000..90cfd8f1 --- /dev/null +++ b/services/metalv1/model_bgp_session_input_address_family.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// BGPSessionInputAddressFamily Address family for BGP session. +type BGPSessionInputAddressFamily string + +// List of BGPSessionInput_address_family +const ( + BGPSESSIONINPUTADDRESSFAMILY_IPV4 BGPSessionInputAddressFamily = "ipv4" + BGPSESSIONINPUTADDRESSFAMILY_IPV6 BGPSessionInputAddressFamily = "ipv6" +) + +// All allowed values of BGPSessionInputAddressFamily enum +var AllowedBGPSessionInputAddressFamilyEnumValues = []BGPSessionInputAddressFamily{ + "ipv4", + "ipv6", +} + +func (v *BGPSessionInputAddressFamily) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BGPSessionInputAddressFamily(value) + for _, existing := range AllowedBGPSessionInputAddressFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BGPSessionInputAddressFamily", value) +} + +// NewBGPSessionInputAddressFamilyFromValue returns a pointer to a valid BGPSessionInputAddressFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBGPSessionInputAddressFamilyFromValue(v string) (*BGPSessionInputAddressFamily, error) { + ev := BGPSessionInputAddressFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BGPSessionInputAddressFamily: valid values are %v", v, AllowedBGPSessionInputAddressFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BGPSessionInputAddressFamily) IsValid() bool { + for _, existing := range AllowedBGPSessionInputAddressFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BGPSessionInput_address_family value +func (v BGPSessionInputAddressFamily) Ptr() *BGPSessionInputAddressFamily { + return &v +} + +type NullableBGPSessionInputAddressFamily struct { + value *BGPSessionInputAddressFamily + isSet bool +} + +func (v NullableBGPSessionInputAddressFamily) Get() *BGPSessionInputAddressFamily { + return v.value +} + +func (v *NullableBGPSessionInputAddressFamily) Set(val *BGPSessionInputAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableBGPSessionInputAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableBGPSessionInputAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBGPSessionInputAddressFamily(val *BGPSessionInputAddressFamily) *NullableBGPSessionInputAddressFamily { + return &NullableBGPSessionInputAddressFamily{value: val, isSet: true} +} + +func (v NullableBGPSessionInputAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBGPSessionInputAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session_list.go b/services/metalv1/model_bgp_session_list.go new file mode 100644 index 00000000..312da9b8 --- /dev/null +++ b/services/metalv1/model_bgp_session_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BgpSessionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpSessionList{} + +// BgpSessionList struct for BgpSessionList +type BgpSessionList struct { + BgpSessions []BgpSession `json:"bgp_sessions,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpSessionList BgpSessionList + +// NewBgpSessionList instantiates a new BgpSessionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpSessionList() *BgpSessionList { + this := BgpSessionList{} + return &this +} + +// NewBgpSessionListWithDefaults instantiates a new BgpSessionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpSessionListWithDefaults() *BgpSessionList { + this := BgpSessionList{} + return &this +} + +// GetBgpSessions returns the BgpSessions field value if set, zero value otherwise. +func (o *BgpSessionList) GetBgpSessions() []BgpSession { + if o == nil || IsNil(o.BgpSessions) { + var ret []BgpSession + return ret + } + return o.BgpSessions +} + +// GetBgpSessionsOk returns a tuple with the BgpSessions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSessionList) GetBgpSessionsOk() ([]BgpSession, bool) { + if o == nil || IsNil(o.BgpSessions) { + return nil, false + } + return o.BgpSessions, true +} + +// HasBgpSessions returns a boolean if a field has been set. +func (o *BgpSessionList) HasBgpSessions() bool { + if o != nil && !IsNil(o.BgpSessions) { + return true + } + + return false +} + +// SetBgpSessions gets a reference to the given []BgpSession and assigns it to the BgpSessions field. +func (o *BgpSessionList) SetBgpSessions(v []BgpSession) { + o.BgpSessions = v +} + +func (o BgpSessionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpSessionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpSessions) { + toSerialize["bgp_sessions"] = o.BgpSessions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpSessionList) UnmarshalJSON(bytes []byte) (err error) { + varBgpSessionList := _BgpSessionList{} + + err = json.Unmarshal(bytes, &varBgpSessionList) + + if err != nil { + return err + } + + *o = BgpSessionList(varBgpSessionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_sessions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpSessionList struct { + value *BgpSessionList + isSet bool +} + +func (v NullableBgpSessionList) Get() *BgpSessionList { + return v.value +} + +func (v *NullableBgpSessionList) Set(val *BgpSessionList) { + v.value = val + v.isSet = true +} + +func (v NullableBgpSessionList) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpSessionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpSessionList(val *BgpSessionList) *NullableBgpSessionList { + return &NullableBgpSessionList{value: val, isSet: true} +} + +func (v NullableBgpSessionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpSessionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bgp_session_neighbors.go b/services/metalv1/model_bgp_session_neighbors.go new file mode 100644 index 00000000..46971248 --- /dev/null +++ b/services/metalv1/model_bgp_session_neighbors.go @@ -0,0 +1,155 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BgpSessionNeighbors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BgpSessionNeighbors{} + +// BgpSessionNeighbors struct for BgpSessionNeighbors +type BgpSessionNeighbors struct { + // A list of BGP session neighbor data + BgpNeighbors []BgpNeighborData `json:"bgp_neighbors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BgpSessionNeighbors BgpSessionNeighbors + +// NewBgpSessionNeighbors instantiates a new BgpSessionNeighbors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBgpSessionNeighbors() *BgpSessionNeighbors { + this := BgpSessionNeighbors{} + return &this +} + +// NewBgpSessionNeighborsWithDefaults instantiates a new BgpSessionNeighbors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBgpSessionNeighborsWithDefaults() *BgpSessionNeighbors { + this := BgpSessionNeighbors{} + return &this +} + +// GetBgpNeighbors returns the BgpNeighbors field value if set, zero value otherwise. +func (o *BgpSessionNeighbors) GetBgpNeighbors() []BgpNeighborData { + if o == nil || IsNil(o.BgpNeighbors) { + var ret []BgpNeighborData + return ret + } + return o.BgpNeighbors +} + +// GetBgpNeighborsOk returns a tuple with the BgpNeighbors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BgpSessionNeighbors) GetBgpNeighborsOk() ([]BgpNeighborData, bool) { + if o == nil || IsNil(o.BgpNeighbors) { + return nil, false + } + return o.BgpNeighbors, true +} + +// HasBgpNeighbors returns a boolean if a field has been set. +func (o *BgpSessionNeighbors) HasBgpNeighbors() bool { + if o != nil && !IsNil(o.BgpNeighbors) { + return true + } + + return false +} + +// SetBgpNeighbors gets a reference to the given []BgpNeighborData and assigns it to the BgpNeighbors field. +func (o *BgpSessionNeighbors) SetBgpNeighbors(v []BgpNeighborData) { + o.BgpNeighbors = v +} + +func (o BgpSessionNeighbors) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BgpSessionNeighbors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpNeighbors) { + toSerialize["bgp_neighbors"] = o.BgpNeighbors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BgpSessionNeighbors) UnmarshalJSON(bytes []byte) (err error) { + varBgpSessionNeighbors := _BgpSessionNeighbors{} + + err = json.Unmarshal(bytes, &varBgpSessionNeighbors) + + if err != nil { + return err + } + + *o = BgpSessionNeighbors(varBgpSessionNeighbors) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_neighbors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBgpSessionNeighbors struct { + value *BgpSessionNeighbors + isSet bool +} + +func (v NullableBgpSessionNeighbors) Get() *BgpSessionNeighbors { + return v.value +} + +func (v *NullableBgpSessionNeighbors) Set(val *BgpSessionNeighbors) { + v.value = val + v.isSet = true +} + +func (v NullableBgpSessionNeighbors) IsSet() bool { + return v.isSet +} + +func (v *NullableBgpSessionNeighbors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBgpSessionNeighbors(val *BgpSessionNeighbors) *NullableBgpSessionNeighbors { + return &NullableBgpSessionNeighbors{value: val, isSet: true} +} + +func (v NullableBgpSessionNeighbors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBgpSessionNeighbors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_bond_port_data.go b/services/metalv1/model_bond_port_data.go new file mode 100644 index 00000000..60c1bb98 --- /dev/null +++ b/services/metalv1/model_bond_port_data.go @@ -0,0 +1,193 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the BondPortData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BondPortData{} + +// BondPortData struct for BondPortData +type BondPortData struct { + // ID of the bonding port + Id *string `json:"id,omitempty"` + // Name of the port interface for the bond (\"bond0\") + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BondPortData BondPortData + +// NewBondPortData instantiates a new BondPortData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBondPortData() *BondPortData { + this := BondPortData{} + return &this +} + +// NewBondPortDataWithDefaults instantiates a new BondPortData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBondPortDataWithDefaults() *BondPortData { + this := BondPortData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BondPortData) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BondPortData) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BondPortData) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BondPortData) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BondPortData) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BondPortData) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BondPortData) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BondPortData) SetName(v string) { + o.Name = &v +} + +func (o BondPortData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BondPortData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BondPortData) UnmarshalJSON(bytes []byte) (err error) { + varBondPortData := _BondPortData{} + + err = json.Unmarshal(bytes, &varBondPortData) + + if err != nil { + return err + } + + *o = BondPortData(varBondPortData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBondPortData struct { + value *BondPortData + isSet bool +} + +func (v NullableBondPortData) Get() *BondPortData { + return v.value +} + +func (v *NullableBondPortData) Set(val *BondPortData) { + v.value = val + v.isSet = true +} + +func (v NullableBondPortData) IsSet() bool { + return v.isSet +} + +func (v *NullableBondPortData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBondPortData(val *BondPortData) *NullableBondPortData { + return &NullableBondPortData{value: val, isSet: true} +} + +func (v NullableBondPortData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBondPortData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_check_per_facility_info.go b/services/metalv1/model_capacity_check_per_facility_info.go new file mode 100644 index 00000000..5ba0869e --- /dev/null +++ b/services/metalv1/model_capacity_check_per_facility_info.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityCheckPerFacilityInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityCheckPerFacilityInfo{} + +// CapacityCheckPerFacilityInfo struct for CapacityCheckPerFacilityInfo +type CapacityCheckPerFacilityInfo struct { + Available *bool `json:"available,omitempty"` + Facility *string `json:"facility,omitempty"` + Plan *string `json:"plan,omitempty"` + Quantity *string `json:"quantity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityCheckPerFacilityInfo CapacityCheckPerFacilityInfo + +// NewCapacityCheckPerFacilityInfo instantiates a new CapacityCheckPerFacilityInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityCheckPerFacilityInfo() *CapacityCheckPerFacilityInfo { + this := CapacityCheckPerFacilityInfo{} + return &this +} + +// NewCapacityCheckPerFacilityInfoWithDefaults instantiates a new CapacityCheckPerFacilityInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityCheckPerFacilityInfoWithDefaults() *CapacityCheckPerFacilityInfo { + this := CapacityCheckPerFacilityInfo{} + return &this +} + +// GetAvailable returns the Available field value if set, zero value otherwise. +func (o *CapacityCheckPerFacilityInfo) GetAvailable() bool { + if o == nil || IsNil(o.Available) { + var ret bool + return ret + } + return *o.Available +} + +// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerFacilityInfo) GetAvailableOk() (*bool, bool) { + if o == nil || IsNil(o.Available) { + return nil, false + } + return o.Available, true +} + +// HasAvailable returns a boolean if a field has been set. +func (o *CapacityCheckPerFacilityInfo) HasAvailable() bool { + if o != nil && !IsNil(o.Available) { + return true + } + + return false +} + +// SetAvailable gets a reference to the given bool and assigns it to the Available field. +func (o *CapacityCheckPerFacilityInfo) SetAvailable(v bool) { + o.Available = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *CapacityCheckPerFacilityInfo) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerFacilityInfo) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *CapacityCheckPerFacilityInfo) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *CapacityCheckPerFacilityInfo) SetFacility(v string) { + o.Facility = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *CapacityCheckPerFacilityInfo) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerFacilityInfo) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *CapacityCheckPerFacilityInfo) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *CapacityCheckPerFacilityInfo) SetPlan(v string) { + o.Plan = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *CapacityCheckPerFacilityInfo) GetQuantity() string { + if o == nil || IsNil(o.Quantity) { + var ret string + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerFacilityInfo) GetQuantityOk() (*string, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *CapacityCheckPerFacilityInfo) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given string and assigns it to the Quantity field. +func (o *CapacityCheckPerFacilityInfo) SetQuantity(v string) { + o.Quantity = &v +} + +func (o CapacityCheckPerFacilityInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityCheckPerFacilityInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Available) { + toSerialize["available"] = o.Available + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityCheckPerFacilityInfo) UnmarshalJSON(bytes []byte) (err error) { + varCapacityCheckPerFacilityInfo := _CapacityCheckPerFacilityInfo{} + + err = json.Unmarshal(bytes, &varCapacityCheckPerFacilityInfo) + + if err != nil { + return err + } + + *o = CapacityCheckPerFacilityInfo(varCapacityCheckPerFacilityInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "available") + delete(additionalProperties, "facility") + delete(additionalProperties, "plan") + delete(additionalProperties, "quantity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityCheckPerFacilityInfo struct { + value *CapacityCheckPerFacilityInfo + isSet bool +} + +func (v NullableCapacityCheckPerFacilityInfo) Get() *CapacityCheckPerFacilityInfo { + return v.value +} + +func (v *NullableCapacityCheckPerFacilityInfo) Set(val *CapacityCheckPerFacilityInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityCheckPerFacilityInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityCheckPerFacilityInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityCheckPerFacilityInfo(val *CapacityCheckPerFacilityInfo) *NullableCapacityCheckPerFacilityInfo { + return &NullableCapacityCheckPerFacilityInfo{value: val, isSet: true} +} + +func (v NullableCapacityCheckPerFacilityInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityCheckPerFacilityInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_check_per_facility_list.go b/services/metalv1/model_capacity_check_per_facility_list.go new file mode 100644 index 00000000..1336fa14 --- /dev/null +++ b/services/metalv1/model_capacity_check_per_facility_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityCheckPerFacilityList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityCheckPerFacilityList{} + +// CapacityCheckPerFacilityList struct for CapacityCheckPerFacilityList +type CapacityCheckPerFacilityList struct { + Servers []CapacityCheckPerFacilityInfo `json:"servers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityCheckPerFacilityList CapacityCheckPerFacilityList + +// NewCapacityCheckPerFacilityList instantiates a new CapacityCheckPerFacilityList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityCheckPerFacilityList() *CapacityCheckPerFacilityList { + this := CapacityCheckPerFacilityList{} + return &this +} + +// NewCapacityCheckPerFacilityListWithDefaults instantiates a new CapacityCheckPerFacilityList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityCheckPerFacilityListWithDefaults() *CapacityCheckPerFacilityList { + this := CapacityCheckPerFacilityList{} + return &this +} + +// GetServers returns the Servers field value if set, zero value otherwise. +func (o *CapacityCheckPerFacilityList) GetServers() []CapacityCheckPerFacilityInfo { + if o == nil || IsNil(o.Servers) { + var ret []CapacityCheckPerFacilityInfo + return ret + } + return o.Servers +} + +// GetServersOk returns a tuple with the Servers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerFacilityList) GetServersOk() ([]CapacityCheckPerFacilityInfo, bool) { + if o == nil || IsNil(o.Servers) { + return nil, false + } + return o.Servers, true +} + +// HasServers returns a boolean if a field has been set. +func (o *CapacityCheckPerFacilityList) HasServers() bool { + if o != nil && !IsNil(o.Servers) { + return true + } + + return false +} + +// SetServers gets a reference to the given []CapacityCheckPerFacilityInfo and assigns it to the Servers field. +func (o *CapacityCheckPerFacilityList) SetServers(v []CapacityCheckPerFacilityInfo) { + o.Servers = v +} + +func (o CapacityCheckPerFacilityList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityCheckPerFacilityList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Servers) { + toSerialize["servers"] = o.Servers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityCheckPerFacilityList) UnmarshalJSON(bytes []byte) (err error) { + varCapacityCheckPerFacilityList := _CapacityCheckPerFacilityList{} + + err = json.Unmarshal(bytes, &varCapacityCheckPerFacilityList) + + if err != nil { + return err + } + + *o = CapacityCheckPerFacilityList(varCapacityCheckPerFacilityList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "servers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityCheckPerFacilityList struct { + value *CapacityCheckPerFacilityList + isSet bool +} + +func (v NullableCapacityCheckPerFacilityList) Get() *CapacityCheckPerFacilityList { + return v.value +} + +func (v *NullableCapacityCheckPerFacilityList) Set(val *CapacityCheckPerFacilityList) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityCheckPerFacilityList) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityCheckPerFacilityList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityCheckPerFacilityList(val *CapacityCheckPerFacilityList) *NullableCapacityCheckPerFacilityList { + return &NullableCapacityCheckPerFacilityList{value: val, isSet: true} +} + +func (v NullableCapacityCheckPerFacilityList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityCheckPerFacilityList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_check_per_metro_info.go b/services/metalv1/model_capacity_check_per_metro_info.go new file mode 100644 index 00000000..4562f7ff --- /dev/null +++ b/services/metalv1/model_capacity_check_per_metro_info.go @@ -0,0 +1,269 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityCheckPerMetroInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityCheckPerMetroInfo{} + +// CapacityCheckPerMetroInfo struct for CapacityCheckPerMetroInfo +type CapacityCheckPerMetroInfo struct { + // Returns true if there is enough capacity in the metro to fulfill the quantity set. Returns false if there is not enough. + Available *bool `json:"available,omitempty"` + // The metro ID or code sent to check capacity. + Metro *string `json:"metro,omitempty"` + // The plan ID or slug sent to check capacity. + Plan *string `json:"plan,omitempty"` + // The number of servers sent to check capacity. + Quantity *string `json:"quantity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityCheckPerMetroInfo CapacityCheckPerMetroInfo + +// NewCapacityCheckPerMetroInfo instantiates a new CapacityCheckPerMetroInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityCheckPerMetroInfo() *CapacityCheckPerMetroInfo { + this := CapacityCheckPerMetroInfo{} + return &this +} + +// NewCapacityCheckPerMetroInfoWithDefaults instantiates a new CapacityCheckPerMetroInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityCheckPerMetroInfoWithDefaults() *CapacityCheckPerMetroInfo { + this := CapacityCheckPerMetroInfo{} + return &this +} + +// GetAvailable returns the Available field value if set, zero value otherwise. +func (o *CapacityCheckPerMetroInfo) GetAvailable() bool { + if o == nil || IsNil(o.Available) { + var ret bool + return ret + } + return *o.Available +} + +// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerMetroInfo) GetAvailableOk() (*bool, bool) { + if o == nil || IsNil(o.Available) { + return nil, false + } + return o.Available, true +} + +// HasAvailable returns a boolean if a field has been set. +func (o *CapacityCheckPerMetroInfo) HasAvailable() bool { + if o != nil && !IsNil(o.Available) { + return true + } + + return false +} + +// SetAvailable gets a reference to the given bool and assigns it to the Available field. +func (o *CapacityCheckPerMetroInfo) SetAvailable(v bool) { + o.Available = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *CapacityCheckPerMetroInfo) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerMetroInfo) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *CapacityCheckPerMetroInfo) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *CapacityCheckPerMetroInfo) SetMetro(v string) { + o.Metro = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *CapacityCheckPerMetroInfo) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerMetroInfo) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *CapacityCheckPerMetroInfo) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *CapacityCheckPerMetroInfo) SetPlan(v string) { + o.Plan = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *CapacityCheckPerMetroInfo) GetQuantity() string { + if o == nil || IsNil(o.Quantity) { + var ret string + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerMetroInfo) GetQuantityOk() (*string, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *CapacityCheckPerMetroInfo) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given string and assigns it to the Quantity field. +func (o *CapacityCheckPerMetroInfo) SetQuantity(v string) { + o.Quantity = &v +} + +func (o CapacityCheckPerMetroInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityCheckPerMetroInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Available) { + toSerialize["available"] = o.Available + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityCheckPerMetroInfo) UnmarshalJSON(bytes []byte) (err error) { + varCapacityCheckPerMetroInfo := _CapacityCheckPerMetroInfo{} + + err = json.Unmarshal(bytes, &varCapacityCheckPerMetroInfo) + + if err != nil { + return err + } + + *o = CapacityCheckPerMetroInfo(varCapacityCheckPerMetroInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "available") + delete(additionalProperties, "metro") + delete(additionalProperties, "plan") + delete(additionalProperties, "quantity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityCheckPerMetroInfo struct { + value *CapacityCheckPerMetroInfo + isSet bool +} + +func (v NullableCapacityCheckPerMetroInfo) Get() *CapacityCheckPerMetroInfo { + return v.value +} + +func (v *NullableCapacityCheckPerMetroInfo) Set(val *CapacityCheckPerMetroInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityCheckPerMetroInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityCheckPerMetroInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityCheckPerMetroInfo(val *CapacityCheckPerMetroInfo) *NullableCapacityCheckPerMetroInfo { + return &NullableCapacityCheckPerMetroInfo{value: val, isSet: true} +} + +func (v NullableCapacityCheckPerMetroInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityCheckPerMetroInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_check_per_metro_list.go b/services/metalv1/model_capacity_check_per_metro_list.go new file mode 100644 index 00000000..48bd422e --- /dev/null +++ b/services/metalv1/model_capacity_check_per_metro_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityCheckPerMetroList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityCheckPerMetroList{} + +// CapacityCheckPerMetroList struct for CapacityCheckPerMetroList +type CapacityCheckPerMetroList struct { + Servers []CapacityCheckPerMetroInfo `json:"servers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityCheckPerMetroList CapacityCheckPerMetroList + +// NewCapacityCheckPerMetroList instantiates a new CapacityCheckPerMetroList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityCheckPerMetroList() *CapacityCheckPerMetroList { + this := CapacityCheckPerMetroList{} + return &this +} + +// NewCapacityCheckPerMetroListWithDefaults instantiates a new CapacityCheckPerMetroList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityCheckPerMetroListWithDefaults() *CapacityCheckPerMetroList { + this := CapacityCheckPerMetroList{} + return &this +} + +// GetServers returns the Servers field value if set, zero value otherwise. +func (o *CapacityCheckPerMetroList) GetServers() []CapacityCheckPerMetroInfo { + if o == nil || IsNil(o.Servers) { + var ret []CapacityCheckPerMetroInfo + return ret + } + return o.Servers +} + +// GetServersOk returns a tuple with the Servers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityCheckPerMetroList) GetServersOk() ([]CapacityCheckPerMetroInfo, bool) { + if o == nil || IsNil(o.Servers) { + return nil, false + } + return o.Servers, true +} + +// HasServers returns a boolean if a field has been set. +func (o *CapacityCheckPerMetroList) HasServers() bool { + if o != nil && !IsNil(o.Servers) { + return true + } + + return false +} + +// SetServers gets a reference to the given []CapacityCheckPerMetroInfo and assigns it to the Servers field. +func (o *CapacityCheckPerMetroList) SetServers(v []CapacityCheckPerMetroInfo) { + o.Servers = v +} + +func (o CapacityCheckPerMetroList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityCheckPerMetroList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Servers) { + toSerialize["servers"] = o.Servers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityCheckPerMetroList) UnmarshalJSON(bytes []byte) (err error) { + varCapacityCheckPerMetroList := _CapacityCheckPerMetroList{} + + err = json.Unmarshal(bytes, &varCapacityCheckPerMetroList) + + if err != nil { + return err + } + + *o = CapacityCheckPerMetroList(varCapacityCheckPerMetroList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "servers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityCheckPerMetroList struct { + value *CapacityCheckPerMetroList + isSet bool +} + +func (v NullableCapacityCheckPerMetroList) Get() *CapacityCheckPerMetroList { + return v.value +} + +func (v *NullableCapacityCheckPerMetroList) Set(val *CapacityCheckPerMetroList) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityCheckPerMetroList) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityCheckPerMetroList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityCheckPerMetroList(val *CapacityCheckPerMetroList) *NullableCapacityCheckPerMetroList { + return &NullableCapacityCheckPerMetroList{value: val, isSet: true} +} + +func (v NullableCapacityCheckPerMetroList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityCheckPerMetroList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_input.go b/services/metalv1/model_capacity_input.go new file mode 100644 index 00000000..0fd05a75 --- /dev/null +++ b/services/metalv1/model_capacity_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityInput{} + +// CapacityInput struct for CapacityInput +type CapacityInput struct { + Servers []ServerInfo `json:"servers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityInput CapacityInput + +// NewCapacityInput instantiates a new CapacityInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityInput() *CapacityInput { + this := CapacityInput{} + return &this +} + +// NewCapacityInputWithDefaults instantiates a new CapacityInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityInputWithDefaults() *CapacityInput { + this := CapacityInput{} + return &this +} + +// GetServers returns the Servers field value if set, zero value otherwise. +func (o *CapacityInput) GetServers() []ServerInfo { + if o == nil || IsNil(o.Servers) { + var ret []ServerInfo + return ret + } + return o.Servers +} + +// GetServersOk returns a tuple with the Servers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityInput) GetServersOk() ([]ServerInfo, bool) { + if o == nil || IsNil(o.Servers) { + return nil, false + } + return o.Servers, true +} + +// HasServers returns a boolean if a field has been set. +func (o *CapacityInput) HasServers() bool { + if o != nil && !IsNil(o.Servers) { + return true + } + + return false +} + +// SetServers gets a reference to the given []ServerInfo and assigns it to the Servers field. +func (o *CapacityInput) SetServers(v []ServerInfo) { + o.Servers = v +} + +func (o CapacityInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Servers) { + toSerialize["servers"] = o.Servers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityInput) UnmarshalJSON(bytes []byte) (err error) { + varCapacityInput := _CapacityInput{} + + err = json.Unmarshal(bytes, &varCapacityInput) + + if err != nil { + return err + } + + *o = CapacityInput(varCapacityInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "servers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityInput struct { + value *CapacityInput + isSet bool +} + +func (v NullableCapacityInput) Get() *CapacityInput { + return v.value +} + +func (v *NullableCapacityInput) Set(val *CapacityInput) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityInput) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityInput(val *CapacityInput) *NullableCapacityInput { + return &NullableCapacityInput{value: val, isSet: true} +} + +func (v NullableCapacityInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_level_per_baremetal.go b/services/metalv1/model_capacity_level_per_baremetal.go new file mode 100644 index 00000000..2504a374 --- /dev/null +++ b/services/metalv1/model_capacity_level_per_baremetal.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityLevelPerBaremetal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityLevelPerBaremetal{} + +// CapacityLevelPerBaremetal struct for CapacityLevelPerBaremetal +type CapacityLevelPerBaremetal struct { + Level *string `json:"level,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityLevelPerBaremetal CapacityLevelPerBaremetal + +// NewCapacityLevelPerBaremetal instantiates a new CapacityLevelPerBaremetal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityLevelPerBaremetal() *CapacityLevelPerBaremetal { + this := CapacityLevelPerBaremetal{} + return &this +} + +// NewCapacityLevelPerBaremetalWithDefaults instantiates a new CapacityLevelPerBaremetal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityLevelPerBaremetalWithDefaults() *CapacityLevelPerBaremetal { + this := CapacityLevelPerBaremetal{} + return &this +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *CapacityLevelPerBaremetal) GetLevel() string { + if o == nil || IsNil(o.Level) { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityLevelPerBaremetal) GetLevelOk() (*string, bool) { + if o == nil || IsNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *CapacityLevelPerBaremetal) HasLevel() bool { + if o != nil && !IsNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *CapacityLevelPerBaremetal) SetLevel(v string) { + o.Level = &v +} + +func (o CapacityLevelPerBaremetal) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityLevelPerBaremetal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Level) { + toSerialize["level"] = o.Level + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityLevelPerBaremetal) UnmarshalJSON(bytes []byte) (err error) { + varCapacityLevelPerBaremetal := _CapacityLevelPerBaremetal{} + + err = json.Unmarshal(bytes, &varCapacityLevelPerBaremetal) + + if err != nil { + return err + } + + *o = CapacityLevelPerBaremetal(varCapacityLevelPerBaremetal) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "level") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityLevelPerBaremetal struct { + value *CapacityLevelPerBaremetal + isSet bool +} + +func (v NullableCapacityLevelPerBaremetal) Get() *CapacityLevelPerBaremetal { + return v.value +} + +func (v *NullableCapacityLevelPerBaremetal) Set(val *CapacityLevelPerBaremetal) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityLevelPerBaremetal) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityLevelPerBaremetal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityLevelPerBaremetal(val *CapacityLevelPerBaremetal) *NullableCapacityLevelPerBaremetal { + return &NullableCapacityLevelPerBaremetal{value: val, isSet: true} +} + +func (v NullableCapacityLevelPerBaremetal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityLevelPerBaremetal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_capacity_list.go b/services/metalv1/model_capacity_list.go new file mode 100644 index 00000000..727152c9 --- /dev/null +++ b/services/metalv1/model_capacity_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CapacityList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CapacityList{} + +// CapacityList struct for CapacityList +type CapacityList struct { + Capacity *map[string]map[string]CapacityLevelPerBaremetal `json:"capacity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CapacityList CapacityList + +// NewCapacityList instantiates a new CapacityList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCapacityList() *CapacityList { + this := CapacityList{} + return &this +} + +// NewCapacityListWithDefaults instantiates a new CapacityList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCapacityListWithDefaults() *CapacityList { + this := CapacityList{} + return &this +} + +// GetCapacity returns the Capacity field value if set, zero value otherwise. +func (o *CapacityList) GetCapacity() map[string]map[string]CapacityLevelPerBaremetal { + if o == nil || IsNil(o.Capacity) { + var ret map[string]map[string]CapacityLevelPerBaremetal + return ret + } + return *o.Capacity +} + +// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CapacityList) GetCapacityOk() (*map[string]map[string]CapacityLevelPerBaremetal, bool) { + if o == nil || IsNil(o.Capacity) { + return nil, false + } + return o.Capacity, true +} + +// HasCapacity returns a boolean if a field has been set. +func (o *CapacityList) HasCapacity() bool { + if o != nil && !IsNil(o.Capacity) { + return true + } + + return false +} + +// SetCapacity gets a reference to the given map[string]map[string]CapacityLevelPerBaremetal and assigns it to the Capacity field. +func (o *CapacityList) SetCapacity(v map[string]map[string]CapacityLevelPerBaremetal) { + o.Capacity = &v +} + +func (o CapacityList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CapacityList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Capacity) { + toSerialize["capacity"] = o.Capacity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CapacityList) UnmarshalJSON(bytes []byte) (err error) { + varCapacityList := _CapacityList{} + + err = json.Unmarshal(bytes, &varCapacityList) + + if err != nil { + return err + } + + *o = CapacityList(varCapacityList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "capacity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCapacityList struct { + value *CapacityList + isSet bool +} + +func (v NullableCapacityList) Get() *CapacityList { + return v.value +} + +func (v *NullableCapacityList) Set(val *CapacityList) { + v.value = val + v.isSet = true +} + +func (v NullableCapacityList) IsSet() bool { + return v.isSet +} + +func (v *NullableCapacityList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapacityList(val *CapacityList) *NullableCapacityList { + return &NullableCapacityList{value: val, isSet: true} +} + +func (v NullableCapacityList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapacityList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_component.go b/services/metalv1/model_component.go new file mode 100644 index 00000000..9f22cc4b --- /dev/null +++ b/services/metalv1/model_component.go @@ -0,0 +1,536 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Component type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Component{} + +// Component struct for Component +type Component struct { + // Component UUID + Uuid *string `json:"uuid,omitempty"` + // Component vendor + Vendor *string `json:"vendor,omitempty"` + // List of models where this component version can be applied + Model []string `json:"model,omitempty"` + // name of the file + Filename *string `json:"filename,omitempty"` + // Version of the component + Version *string `json:"version,omitempty"` + // Component type + Component *string `json:"component,omitempty"` + // File checksum + Checksum *string `json:"checksum,omitempty"` + // Location of the file + UpstreamUrl *string `json:"upstream_url,omitempty"` + // Location of the file in the repository + RepositoryUrl *string `json:"repository_url,omitempty"` + // Datetime when the block was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Datetime when the block was updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Component Component + +// NewComponent instantiates a new Component object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComponent() *Component { + this := Component{} + return &this +} + +// NewComponentWithDefaults instantiates a new Component object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComponentWithDefaults() *Component { + this := Component{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *Component) GetUuid() string { + if o == nil || IsNil(o.Uuid) { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetUuidOk() (*string, bool) { + if o == nil || IsNil(o.Uuid) { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *Component) HasUuid() bool { + if o != nil && !IsNil(o.Uuid) { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *Component) SetUuid(v string) { + o.Uuid = &v +} + +// GetVendor returns the Vendor field value if set, zero value otherwise. +func (o *Component) GetVendor() string { + if o == nil || IsNil(o.Vendor) { + var ret string + return ret + } + return *o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetVendorOk() (*string, bool) { + if o == nil || IsNil(o.Vendor) { + return nil, false + } + return o.Vendor, true +} + +// HasVendor returns a boolean if a field has been set. +func (o *Component) HasVendor() bool { + if o != nil && !IsNil(o.Vendor) { + return true + } + + return false +} + +// SetVendor gets a reference to the given string and assigns it to the Vendor field. +func (o *Component) SetVendor(v string) { + o.Vendor = &v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *Component) GetModel() []string { + if o == nil || IsNil(o.Model) { + var ret []string + return ret + } + return o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetModelOk() ([]string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *Component) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given []string and assigns it to the Model field. +func (o *Component) SetModel(v []string) { + o.Model = v +} + +// GetFilename returns the Filename field value if set, zero value otherwise. +func (o *Component) GetFilename() string { + if o == nil || IsNil(o.Filename) { + var ret string + return ret + } + return *o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetFilenameOk() (*string, bool) { + if o == nil || IsNil(o.Filename) { + return nil, false + } + return o.Filename, true +} + +// HasFilename returns a boolean if a field has been set. +func (o *Component) HasFilename() bool { + if o != nil && !IsNil(o.Filename) { + return true + } + + return false +} + +// SetFilename gets a reference to the given string and assigns it to the Filename field. +func (o *Component) SetFilename(v string) { + o.Filename = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Component) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Component) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Component) SetVersion(v string) { + o.Version = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *Component) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *Component) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *Component) SetComponent(v string) { + o.Component = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *Component) GetChecksum() string { + if o == nil || IsNil(o.Checksum) { + var ret string + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetChecksumOk() (*string, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *Component) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given string and assigns it to the Checksum field. +func (o *Component) SetChecksum(v string) { + o.Checksum = &v +} + +// GetUpstreamUrl returns the UpstreamUrl field value if set, zero value otherwise. +func (o *Component) GetUpstreamUrl() string { + if o == nil || IsNil(o.UpstreamUrl) { + var ret string + return ret + } + return *o.UpstreamUrl +} + +// GetUpstreamUrlOk returns a tuple with the UpstreamUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetUpstreamUrlOk() (*string, bool) { + if o == nil || IsNil(o.UpstreamUrl) { + return nil, false + } + return o.UpstreamUrl, true +} + +// HasUpstreamUrl returns a boolean if a field has been set. +func (o *Component) HasUpstreamUrl() bool { + if o != nil && !IsNil(o.UpstreamUrl) { + return true + } + + return false +} + +// SetUpstreamUrl gets a reference to the given string and assigns it to the UpstreamUrl field. +func (o *Component) SetUpstreamUrl(v string) { + o.UpstreamUrl = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *Component) GetRepositoryUrl() string { + if o == nil || IsNil(o.RepositoryUrl) { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetRepositoryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RepositoryUrl) { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *Component) HasRepositoryUrl() bool { + if o != nil && !IsNil(o.RepositoryUrl) { + return true + } + + return false +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *Component) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Component) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Component) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Component) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Component) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Component) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Component) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Component) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Component) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Uuid) { + toSerialize["uuid"] = o.Uuid + } + if !IsNil(o.Vendor) { + toSerialize["vendor"] = o.Vendor + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Filename) { + toSerialize["filename"] = o.Filename + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.UpstreamUrl) { + toSerialize["upstream_url"] = o.UpstreamUrl + } + if !IsNil(o.RepositoryUrl) { + toSerialize["repository_url"] = o.RepositoryUrl + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Component) UnmarshalJSON(bytes []byte) (err error) { + varComponent := _Component{} + + err = json.Unmarshal(bytes, &varComponent) + + if err != nil { + return err + } + + *o = Component(varComponent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "vendor") + delete(additionalProperties, "model") + delete(additionalProperties, "filename") + delete(additionalProperties, "version") + delete(additionalProperties, "component") + delete(additionalProperties, "checksum") + delete(additionalProperties, "upstream_url") + delete(additionalProperties, "repository_url") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableComponent struct { + value *Component + isSet bool +} + +func (v NullableComponent) Get() *Component { + return v.value +} + +func (v *NullableComponent) Set(val *Component) { + v.value = val + v.isSet = true +} + +func (v NullableComponent) IsSet() bool { + return v.isSet +} + +func (v *NullableComponent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableComponent(val *Component) *NullableComponent { + return &NullableComponent{value: val, isSet: true} +} + +func (v NullableComponent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableComponent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_coordinates.go b/services/metalv1/model_coordinates.go new file mode 100644 index 00000000..4eb86f90 --- /dev/null +++ b/services/metalv1/model_coordinates.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Coordinates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Coordinates{} + +// Coordinates struct for Coordinates +type Coordinates struct { + Latitude *string `json:"latitude,omitempty"` + Longitude *string `json:"longitude,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Coordinates Coordinates + +// NewCoordinates instantiates a new Coordinates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCoordinates() *Coordinates { + this := Coordinates{} + return &this +} + +// NewCoordinatesWithDefaults instantiates a new Coordinates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCoordinatesWithDefaults() *Coordinates { + this := Coordinates{} + return &this +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise. +func (o *Coordinates) GetLatitude() string { + if o == nil || IsNil(o.Latitude) { + var ret string + return ret + } + return *o.Latitude +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Coordinates) GetLatitudeOk() (*string, bool) { + if o == nil || IsNil(o.Latitude) { + return nil, false + } + return o.Latitude, true +} + +// HasLatitude returns a boolean if a field has been set. +func (o *Coordinates) HasLatitude() bool { + if o != nil && !IsNil(o.Latitude) { + return true + } + + return false +} + +// SetLatitude gets a reference to the given string and assigns it to the Latitude field. +func (o *Coordinates) SetLatitude(v string) { + o.Latitude = &v +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise. +func (o *Coordinates) GetLongitude() string { + if o == nil || IsNil(o.Longitude) { + var ret string + return ret + } + return *o.Longitude +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Coordinates) GetLongitudeOk() (*string, bool) { + if o == nil || IsNil(o.Longitude) { + return nil, false + } + return o.Longitude, true +} + +// HasLongitude returns a boolean if a field has been set. +func (o *Coordinates) HasLongitude() bool { + if o != nil && !IsNil(o.Longitude) { + return true + } + + return false +} + +// SetLongitude gets a reference to the given string and assigns it to the Longitude field. +func (o *Coordinates) SetLongitude(v string) { + o.Longitude = &v +} + +func (o Coordinates) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Coordinates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Latitude) { + toSerialize["latitude"] = o.Latitude + } + if !IsNil(o.Longitude) { + toSerialize["longitude"] = o.Longitude + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Coordinates) UnmarshalJSON(bytes []byte) (err error) { + varCoordinates := _Coordinates{} + + err = json.Unmarshal(bytes, &varCoordinates) + + if err != nil { + return err + } + + *o = Coordinates(varCoordinates) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCoordinates struct { + value *Coordinates + isSet bool +} + +func (v NullableCoordinates) Get() *Coordinates { + return v.value +} + +func (v *NullableCoordinates) Set(val *Coordinates) { + v.value = val + v.isSet = true +} + +func (v NullableCoordinates) IsSet() bool { + return v.isSet +} + +func (v *NullableCoordinates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCoordinates(val *Coordinates) *NullableCoordinates { + return &NullableCoordinates{value: val, isSet: true} +} + +func (v NullableCoordinates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCoordinates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_device_request.go b/services/metalv1/model_create_device_request.go new file mode 100644 index 00000000..187d4365 --- /dev/null +++ b/services/metalv1/model_create_device_request.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// CreateDeviceRequest - struct for CreateDeviceRequest +type CreateDeviceRequest struct { + DeviceCreateInFacilityInput *DeviceCreateInFacilityInput + DeviceCreateInMetroInput *DeviceCreateInMetroInput +} + +// DeviceCreateInFacilityInputAsCreateDeviceRequest is a convenience function that returns DeviceCreateInFacilityInput wrapped in CreateDeviceRequest +func DeviceCreateInFacilityInputAsCreateDeviceRequest(v *DeviceCreateInFacilityInput) CreateDeviceRequest { + return CreateDeviceRequest{ + DeviceCreateInFacilityInput: v, + } +} + +// DeviceCreateInMetroInputAsCreateDeviceRequest is a convenience function that returns DeviceCreateInMetroInput wrapped in CreateDeviceRequest +func DeviceCreateInMetroInputAsCreateDeviceRequest(v *DeviceCreateInMetroInput) CreateDeviceRequest { + return CreateDeviceRequest{ + DeviceCreateInMetroInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateDeviceRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into DeviceCreateInFacilityInput + err = newStrictDecoder(data).Decode(&dst.DeviceCreateInFacilityInput) + if err == nil { + jsonDeviceCreateInFacilityInput, _ := json.Marshal(dst.DeviceCreateInFacilityInput) + if string(jsonDeviceCreateInFacilityInput) == "{}" { // empty struct + dst.DeviceCreateInFacilityInput = nil + } else { + match++ + } + } else { + dst.DeviceCreateInFacilityInput = nil + } + + // try to unmarshal data into DeviceCreateInMetroInput + err = newStrictDecoder(data).Decode(&dst.DeviceCreateInMetroInput) + if err == nil { + jsonDeviceCreateInMetroInput, _ := json.Marshal(dst.DeviceCreateInMetroInput) + if string(jsonDeviceCreateInMetroInput) == "{}" { // empty struct + dst.DeviceCreateInMetroInput = nil + } else { + match++ + } + } else { + dst.DeviceCreateInMetroInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.DeviceCreateInFacilityInput = nil + dst.DeviceCreateInMetroInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateDeviceRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateDeviceRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateDeviceRequest) MarshalJSON() ([]byte, error) { + if src.DeviceCreateInFacilityInput != nil { + return json.Marshal(&src.DeviceCreateInFacilityInput) + } + + if src.DeviceCreateInMetroInput != nil { + return json.Marshal(&src.DeviceCreateInMetroInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateDeviceRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DeviceCreateInFacilityInput != nil { + return obj.DeviceCreateInFacilityInput + } + + if obj.DeviceCreateInMetroInput != nil { + return obj.DeviceCreateInMetroInput + } + + // all schemas are nil + return nil +} + +type NullableCreateDeviceRequest struct { + value *CreateDeviceRequest + isSet bool +} + +func (v NullableCreateDeviceRequest) Get() *CreateDeviceRequest { + return v.value +} + +func (v *NullableCreateDeviceRequest) Set(val *CreateDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDeviceRequest(val *CreateDeviceRequest) *NullableCreateDeviceRequest { + return &NullableCreateDeviceRequest{value: val, isSet: true} +} + +func (v NullableCreateDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_email_input.go b/services/metalv1/model_create_email_input.go new file mode 100644 index 00000000..ebce423a --- /dev/null +++ b/services/metalv1/model_create_email_input.go @@ -0,0 +1,167 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateEmailInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateEmailInput{} + +// CreateEmailInput struct for CreateEmailInput +type CreateEmailInput struct { + Address string `json:"address"` + AdditionalProperties map[string]interface{} +} + +type _CreateEmailInput CreateEmailInput + +// NewCreateEmailInput instantiates a new CreateEmailInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateEmailInput(address string) *CreateEmailInput { + this := CreateEmailInput{} + this.Address = address + return &this +} + +// NewCreateEmailInputWithDefaults instantiates a new CreateEmailInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateEmailInputWithDefaults() *CreateEmailInput { + this := CreateEmailInput{} + return &this +} + +// GetAddress returns the Address field value +func (o *CreateEmailInput) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *CreateEmailInput) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *CreateEmailInput) SetAddress(v string) { + o.Address = v +} + +func (o CreateEmailInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateEmailInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateEmailInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateEmailInput := _CreateEmailInput{} + + err = json.Unmarshal(bytes, &varCreateEmailInput) + + if err != nil { + return err + } + + *o = CreateEmailInput(varCreateEmailInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateEmailInput struct { + value *CreateEmailInput + isSet bool +} + +func (v NullableCreateEmailInput) Get() *CreateEmailInput { + return v.value +} + +func (v *NullableCreateEmailInput) Set(val *CreateEmailInput) { + v.value = val + v.isSet = true +} + +func (v NullableCreateEmailInput) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateEmailInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateEmailInput(val *CreateEmailInput) *NullableCreateEmailInput { + return &NullableCreateEmailInput{value: val, isSet: true} +} + +func (v NullableCreateEmailInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateEmailInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_metal_gateway_request.go b/services/metalv1/model_create_metal_gateway_request.go new file mode 100644 index 00000000..f285af00 --- /dev/null +++ b/services/metalv1/model_create_metal_gateway_request.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// CreateMetalGatewayRequest - struct for CreateMetalGatewayRequest +type CreateMetalGatewayRequest struct { + MetalGatewayCreateInput *MetalGatewayCreateInput + VrfMetalGatewayCreateInput *VrfMetalGatewayCreateInput +} + +// MetalGatewayCreateInputAsCreateMetalGatewayRequest is a convenience function that returns MetalGatewayCreateInput wrapped in CreateMetalGatewayRequest +func MetalGatewayCreateInputAsCreateMetalGatewayRequest(v *MetalGatewayCreateInput) CreateMetalGatewayRequest { + return CreateMetalGatewayRequest{ + MetalGatewayCreateInput: v, + } +} + +// VrfMetalGatewayCreateInputAsCreateMetalGatewayRequest is a convenience function that returns VrfMetalGatewayCreateInput wrapped in CreateMetalGatewayRequest +func VrfMetalGatewayCreateInputAsCreateMetalGatewayRequest(v *VrfMetalGatewayCreateInput) CreateMetalGatewayRequest { + return CreateMetalGatewayRequest{ + VrfMetalGatewayCreateInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateMetalGatewayRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into MetalGatewayCreateInput + err = newStrictDecoder(data).Decode(&dst.MetalGatewayCreateInput) + if err == nil { + jsonMetalGatewayCreateInput, _ := json.Marshal(dst.MetalGatewayCreateInput) + if string(jsonMetalGatewayCreateInput) == "{}" { // empty struct + dst.MetalGatewayCreateInput = nil + } else { + match++ + } + } else { + dst.MetalGatewayCreateInput = nil + } + + // try to unmarshal data into VrfMetalGatewayCreateInput + err = newStrictDecoder(data).Decode(&dst.VrfMetalGatewayCreateInput) + if err == nil { + jsonVrfMetalGatewayCreateInput, _ := json.Marshal(dst.VrfMetalGatewayCreateInput) + if string(jsonVrfMetalGatewayCreateInput) == "{}" { // empty struct + dst.VrfMetalGatewayCreateInput = nil + } else { + match++ + } + } else { + dst.VrfMetalGatewayCreateInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.MetalGatewayCreateInput = nil + dst.VrfMetalGatewayCreateInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateMetalGatewayRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateMetalGatewayRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateMetalGatewayRequest) MarshalJSON() ([]byte, error) { + if src.MetalGatewayCreateInput != nil { + return json.Marshal(&src.MetalGatewayCreateInput) + } + + if src.VrfMetalGatewayCreateInput != nil { + return json.Marshal(&src.VrfMetalGatewayCreateInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateMetalGatewayRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.MetalGatewayCreateInput != nil { + return obj.MetalGatewayCreateInput + } + + if obj.VrfMetalGatewayCreateInput != nil { + return obj.VrfMetalGatewayCreateInput + } + + // all schemas are nil + return nil +} + +type NullableCreateMetalGatewayRequest struct { + value *CreateMetalGatewayRequest + isSet bool +} + +func (v NullableCreateMetalGatewayRequest) Get() *CreateMetalGatewayRequest { + return v.value +} + +func (v *NullableCreateMetalGatewayRequest) Set(val *CreateMetalGatewayRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateMetalGatewayRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateMetalGatewayRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateMetalGatewayRequest(val *CreateMetalGatewayRequest) *NullableCreateMetalGatewayRequest { + return &NullableCreateMetalGatewayRequest{value: val, isSet: true} +} + +func (v NullableCreateMetalGatewayRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateMetalGatewayRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_organization_interconnection_request.go b/services/metalv1/model_create_organization_interconnection_request.go new file mode 100644 index 00000000..5acb16ae --- /dev/null +++ b/services/metalv1/model_create_organization_interconnection_request.go @@ -0,0 +1,176 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// CreateOrganizationInterconnectionRequest - struct for CreateOrganizationInterconnectionRequest +type CreateOrganizationInterconnectionRequest struct { + DedicatedPortCreateInput *DedicatedPortCreateInput + VlanFabricVcCreateInput *VlanFabricVcCreateInput + VrfFabricVcCreateInput *VrfFabricVcCreateInput +} + +// DedicatedPortCreateInputAsCreateOrganizationInterconnectionRequest is a convenience function that returns DedicatedPortCreateInput wrapped in CreateOrganizationInterconnectionRequest +func DedicatedPortCreateInputAsCreateOrganizationInterconnectionRequest(v *DedicatedPortCreateInput) CreateOrganizationInterconnectionRequest { + return CreateOrganizationInterconnectionRequest{ + DedicatedPortCreateInput: v, + } +} + +// VlanFabricVcCreateInputAsCreateOrganizationInterconnectionRequest is a convenience function that returns VlanFabricVcCreateInput wrapped in CreateOrganizationInterconnectionRequest +func VlanFabricVcCreateInputAsCreateOrganizationInterconnectionRequest(v *VlanFabricVcCreateInput) CreateOrganizationInterconnectionRequest { + return CreateOrganizationInterconnectionRequest{ + VlanFabricVcCreateInput: v, + } +} + +// VrfFabricVcCreateInputAsCreateOrganizationInterconnectionRequest is a convenience function that returns VrfFabricVcCreateInput wrapped in CreateOrganizationInterconnectionRequest +func VrfFabricVcCreateInputAsCreateOrganizationInterconnectionRequest(v *VrfFabricVcCreateInput) CreateOrganizationInterconnectionRequest { + return CreateOrganizationInterconnectionRequest{ + VrfFabricVcCreateInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateOrganizationInterconnectionRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into DedicatedPortCreateInput + err = newStrictDecoder(data).Decode(&dst.DedicatedPortCreateInput) + if err == nil { + jsonDedicatedPortCreateInput, _ := json.Marshal(dst.DedicatedPortCreateInput) + if string(jsonDedicatedPortCreateInput) == "{}" { // empty struct + dst.DedicatedPortCreateInput = nil + } else { + match++ + } + } else { + dst.DedicatedPortCreateInput = nil + } + + // try to unmarshal data into VlanFabricVcCreateInput + err = newStrictDecoder(data).Decode(&dst.VlanFabricVcCreateInput) + if err == nil { + jsonVlanFabricVcCreateInput, _ := json.Marshal(dst.VlanFabricVcCreateInput) + if string(jsonVlanFabricVcCreateInput) == "{}" { // empty struct + dst.VlanFabricVcCreateInput = nil + } else { + match++ + } + } else { + dst.VlanFabricVcCreateInput = nil + } + + // try to unmarshal data into VrfFabricVcCreateInput + err = newStrictDecoder(data).Decode(&dst.VrfFabricVcCreateInput) + if err == nil { + jsonVrfFabricVcCreateInput, _ := json.Marshal(dst.VrfFabricVcCreateInput) + if string(jsonVrfFabricVcCreateInput) == "{}" { // empty struct + dst.VrfFabricVcCreateInput = nil + } else { + match++ + } + } else { + dst.VrfFabricVcCreateInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.DedicatedPortCreateInput = nil + dst.VlanFabricVcCreateInput = nil + dst.VrfFabricVcCreateInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateOrganizationInterconnectionRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateOrganizationInterconnectionRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateOrganizationInterconnectionRequest) MarshalJSON() ([]byte, error) { + if src.DedicatedPortCreateInput != nil { + return json.Marshal(&src.DedicatedPortCreateInput) + } + + if src.VlanFabricVcCreateInput != nil { + return json.Marshal(&src.VlanFabricVcCreateInput) + } + + if src.VrfFabricVcCreateInput != nil { + return json.Marshal(&src.VrfFabricVcCreateInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateOrganizationInterconnectionRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DedicatedPortCreateInput != nil { + return obj.DedicatedPortCreateInput + } + + if obj.VlanFabricVcCreateInput != nil { + return obj.VlanFabricVcCreateInput + } + + if obj.VrfFabricVcCreateInput != nil { + return obj.VrfFabricVcCreateInput + } + + // all schemas are nil + return nil +} + +type NullableCreateOrganizationInterconnectionRequest struct { + value *CreateOrganizationInterconnectionRequest + isSet bool +} + +func (v NullableCreateOrganizationInterconnectionRequest) Get() *CreateOrganizationInterconnectionRequest { + return v.value +} + +func (v *NullableCreateOrganizationInterconnectionRequest) Set(val *CreateOrganizationInterconnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateOrganizationInterconnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateOrganizationInterconnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateOrganizationInterconnectionRequest(val *CreateOrganizationInterconnectionRequest) *NullableCreateOrganizationInterconnectionRequest { + return &NullableCreateOrganizationInterconnectionRequest{value: val, isSet: true} +} + +func (v NullableCreateOrganizationInterconnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateOrganizationInterconnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_self_service_reservation_request.go b/services/metalv1/model_create_self_service_reservation_request.go new file mode 100644 index 00000000..439a36a7 --- /dev/null +++ b/services/metalv1/model_create_self_service_reservation_request.go @@ -0,0 +1,266 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the CreateSelfServiceReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSelfServiceReservationRequest{} + +// CreateSelfServiceReservationRequest struct for CreateSelfServiceReservationRequest +type CreateSelfServiceReservationRequest struct { + Item []SelfServiceReservationItemRequest `json:"item,omitempty"` + Notes *string `json:"notes,omitempty"` + Period *CreateSelfServiceReservationRequestPeriod `json:"period,omitempty"` + StartDate *time.Time `json:"start_date,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateSelfServiceReservationRequest CreateSelfServiceReservationRequest + +// NewCreateSelfServiceReservationRequest instantiates a new CreateSelfServiceReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSelfServiceReservationRequest() *CreateSelfServiceReservationRequest { + this := CreateSelfServiceReservationRequest{} + return &this +} + +// NewCreateSelfServiceReservationRequestWithDefaults instantiates a new CreateSelfServiceReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSelfServiceReservationRequestWithDefaults() *CreateSelfServiceReservationRequest { + this := CreateSelfServiceReservationRequest{} + return &this +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequest) GetItem() []SelfServiceReservationItemRequest { + if o == nil || IsNil(o.Item) { + var ret []SelfServiceReservationItemRequest + return ret + } + return o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequest) GetItemOk() ([]SelfServiceReservationItemRequest, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequest) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given []SelfServiceReservationItemRequest and assigns it to the Item field. +func (o *CreateSelfServiceReservationRequest) SetItem(v []SelfServiceReservationItemRequest) { + o.Item = v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequest) GetNotes() string { + if o == nil || IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequest) GetNotesOk() (*string, bool) { + if o == nil || IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequest) HasNotes() bool { + if o != nil && !IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *CreateSelfServiceReservationRequest) SetNotes(v string) { + o.Notes = &v +} + +// GetPeriod returns the Period field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequest) GetPeriod() CreateSelfServiceReservationRequestPeriod { + if o == nil || IsNil(o.Period) { + var ret CreateSelfServiceReservationRequestPeriod + return ret + } + return *o.Period +} + +// GetPeriodOk returns a tuple with the Period field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequest) GetPeriodOk() (*CreateSelfServiceReservationRequestPeriod, bool) { + if o == nil || IsNil(o.Period) { + return nil, false + } + return o.Period, true +} + +// HasPeriod returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequest) HasPeriod() bool { + if o != nil && !IsNil(o.Period) { + return true + } + + return false +} + +// SetPeriod gets a reference to the given CreateSelfServiceReservationRequestPeriod and assigns it to the Period field. +func (o *CreateSelfServiceReservationRequest) SetPeriod(v CreateSelfServiceReservationRequestPeriod) { + o.Period = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequest) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate) { + var ret time.Time + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequest) GetStartDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartDate) { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequest) HasStartDate() bool { + if o != nil && !IsNil(o.StartDate) { + return true + } + + return false +} + +// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field. +func (o *CreateSelfServiceReservationRequest) SetStartDate(v time.Time) { + o.StartDate = &v +} + +func (o CreateSelfServiceReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSelfServiceReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + if !IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !IsNil(o.Period) { + toSerialize["period"] = o.Period + } + if !IsNil(o.StartDate) { + toSerialize["start_date"] = o.StartDate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateSelfServiceReservationRequest) UnmarshalJSON(bytes []byte) (err error) { + varCreateSelfServiceReservationRequest := _CreateSelfServiceReservationRequest{} + + err = json.Unmarshal(bytes, &varCreateSelfServiceReservationRequest) + + if err != nil { + return err + } + + *o = CreateSelfServiceReservationRequest(varCreateSelfServiceReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "item") + delete(additionalProperties, "notes") + delete(additionalProperties, "period") + delete(additionalProperties, "start_date") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateSelfServiceReservationRequest struct { + value *CreateSelfServiceReservationRequest + isSet bool +} + +func (v NullableCreateSelfServiceReservationRequest) Get() *CreateSelfServiceReservationRequest { + return v.value +} + +func (v *NullableCreateSelfServiceReservationRequest) Set(val *CreateSelfServiceReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSelfServiceReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSelfServiceReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSelfServiceReservationRequest(val *CreateSelfServiceReservationRequest) *NullableCreateSelfServiceReservationRequest { + return &NullableCreateSelfServiceReservationRequest{value: val, isSet: true} +} + +func (v NullableCreateSelfServiceReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSelfServiceReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_self_service_reservation_request_period.go b/services/metalv1/model_create_self_service_reservation_request_period.go new file mode 100644 index 00000000..8dc7a501 --- /dev/null +++ b/services/metalv1/model_create_self_service_reservation_request_period.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the CreateSelfServiceReservationRequestPeriod type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSelfServiceReservationRequestPeriod{} + +// CreateSelfServiceReservationRequestPeriod struct for CreateSelfServiceReservationRequestPeriod +type CreateSelfServiceReservationRequestPeriod struct { + Count *CreateSelfServiceReservationRequestPeriodCount `json:"count,omitempty"` + Unit *CreateSelfServiceReservationRequestPeriodUnit `json:"unit,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateSelfServiceReservationRequestPeriod CreateSelfServiceReservationRequestPeriod + +// NewCreateSelfServiceReservationRequestPeriod instantiates a new CreateSelfServiceReservationRequestPeriod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSelfServiceReservationRequestPeriod() *CreateSelfServiceReservationRequestPeriod { + this := CreateSelfServiceReservationRequestPeriod{} + return &this +} + +// NewCreateSelfServiceReservationRequestPeriodWithDefaults instantiates a new CreateSelfServiceReservationRequestPeriod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSelfServiceReservationRequestPeriodWithDefaults() *CreateSelfServiceReservationRequestPeriod { + this := CreateSelfServiceReservationRequestPeriod{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequestPeriod) GetCount() CreateSelfServiceReservationRequestPeriodCount { + if o == nil || IsNil(o.Count) { + var ret CreateSelfServiceReservationRequestPeriodCount + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequestPeriod) GetCountOk() (*CreateSelfServiceReservationRequestPeriodCount, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequestPeriod) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given CreateSelfServiceReservationRequestPeriodCount and assigns it to the Count field. +func (o *CreateSelfServiceReservationRequestPeriod) SetCount(v CreateSelfServiceReservationRequestPeriodCount) { + o.Count = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *CreateSelfServiceReservationRequestPeriod) GetUnit() CreateSelfServiceReservationRequestPeriodUnit { + if o == nil || IsNil(o.Unit) { + var ret CreateSelfServiceReservationRequestPeriodUnit + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSelfServiceReservationRequestPeriod) GetUnitOk() (*CreateSelfServiceReservationRequestPeriodUnit, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *CreateSelfServiceReservationRequestPeriod) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given CreateSelfServiceReservationRequestPeriodUnit and assigns it to the Unit field. +func (o *CreateSelfServiceReservationRequestPeriod) SetUnit(v CreateSelfServiceReservationRequestPeriodUnit) { + o.Unit = &v +} + +func (o CreateSelfServiceReservationRequestPeriod) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSelfServiceReservationRequestPeriod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateSelfServiceReservationRequestPeriod) UnmarshalJSON(bytes []byte) (err error) { + varCreateSelfServiceReservationRequestPeriod := _CreateSelfServiceReservationRequestPeriod{} + + err = json.Unmarshal(bytes, &varCreateSelfServiceReservationRequestPeriod) + + if err != nil { + return err + } + + *o = CreateSelfServiceReservationRequestPeriod(varCreateSelfServiceReservationRequestPeriod) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "unit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateSelfServiceReservationRequestPeriod struct { + value *CreateSelfServiceReservationRequestPeriod + isSet bool +} + +func (v NullableCreateSelfServiceReservationRequestPeriod) Get() *CreateSelfServiceReservationRequestPeriod { + return v.value +} + +func (v *NullableCreateSelfServiceReservationRequestPeriod) Set(val *CreateSelfServiceReservationRequestPeriod) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSelfServiceReservationRequestPeriod) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSelfServiceReservationRequestPeriod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSelfServiceReservationRequestPeriod(val *CreateSelfServiceReservationRequestPeriod) *NullableCreateSelfServiceReservationRequestPeriod { + return &NullableCreateSelfServiceReservationRequestPeriod{value: val, isSet: true} +} + +func (v NullableCreateSelfServiceReservationRequestPeriod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSelfServiceReservationRequestPeriod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_self_service_reservation_request_period_count.go b/services/metalv1/model_create_self_service_reservation_request_period_count.go new file mode 100644 index 00000000..7eddfb5b --- /dev/null +++ b/services/metalv1/model_create_self_service_reservation_request_period_count.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// CreateSelfServiceReservationRequestPeriodCount the model 'CreateSelfServiceReservationRequestPeriodCount' +type CreateSelfServiceReservationRequestPeriodCount int32 + +// List of CreateSelfServiceReservationRequest_period_count +const ( + CREATESELFSERVICERESERVATIONREQUESTPERIODCOUNT__12 CreateSelfServiceReservationRequestPeriodCount = 12 + CREATESELFSERVICERESERVATIONREQUESTPERIODCOUNT__36 CreateSelfServiceReservationRequestPeriodCount = 36 +) + +// All allowed values of CreateSelfServiceReservationRequestPeriodCount enum +var AllowedCreateSelfServiceReservationRequestPeriodCountEnumValues = []CreateSelfServiceReservationRequestPeriodCount{ + 12, + 36, +} + +func (v *CreateSelfServiceReservationRequestPeriodCount) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateSelfServiceReservationRequestPeriodCount(value) + for _, existing := range AllowedCreateSelfServiceReservationRequestPeriodCountEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CreateSelfServiceReservationRequestPeriodCount", value) +} + +// NewCreateSelfServiceReservationRequestPeriodCountFromValue returns a pointer to a valid CreateSelfServiceReservationRequestPeriodCount +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateSelfServiceReservationRequestPeriodCountFromValue(v int32) (*CreateSelfServiceReservationRequestPeriodCount, error) { + ev := CreateSelfServiceReservationRequestPeriodCount(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateSelfServiceReservationRequestPeriodCount: valid values are %v", v, AllowedCreateSelfServiceReservationRequestPeriodCountEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateSelfServiceReservationRequestPeriodCount) IsValid() bool { + for _, existing := range AllowedCreateSelfServiceReservationRequestPeriodCountEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateSelfServiceReservationRequest_period_count value +func (v CreateSelfServiceReservationRequestPeriodCount) Ptr() *CreateSelfServiceReservationRequestPeriodCount { + return &v +} + +type NullableCreateSelfServiceReservationRequestPeriodCount struct { + value *CreateSelfServiceReservationRequestPeriodCount + isSet bool +} + +func (v NullableCreateSelfServiceReservationRequestPeriodCount) Get() *CreateSelfServiceReservationRequestPeriodCount { + return v.value +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodCount) Set(val *CreateSelfServiceReservationRequestPeriodCount) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSelfServiceReservationRequestPeriodCount) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodCount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSelfServiceReservationRequestPeriodCount(val *CreateSelfServiceReservationRequestPeriodCount) *NullableCreateSelfServiceReservationRequestPeriodCount { + return &NullableCreateSelfServiceReservationRequestPeriodCount{value: val, isSet: true} +} + +func (v NullableCreateSelfServiceReservationRequestPeriodCount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodCount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_create_self_service_reservation_request_period_unit.go b/services/metalv1/model_create_self_service_reservation_request_period_unit.go new file mode 100644 index 00000000..c47856b5 --- /dev/null +++ b/services/metalv1/model_create_self_service_reservation_request_period_unit.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// CreateSelfServiceReservationRequestPeriodUnit the model 'CreateSelfServiceReservationRequestPeriodUnit' +type CreateSelfServiceReservationRequestPeriodUnit string + +// List of CreateSelfServiceReservationRequest_period_unit +const ( + CREATESELFSERVICERESERVATIONREQUESTPERIODUNIT_MONTHLY CreateSelfServiceReservationRequestPeriodUnit = "monthly" +) + +// All allowed values of CreateSelfServiceReservationRequestPeriodUnit enum +var AllowedCreateSelfServiceReservationRequestPeriodUnitEnumValues = []CreateSelfServiceReservationRequestPeriodUnit{ + "monthly", +} + +func (v *CreateSelfServiceReservationRequestPeriodUnit) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CreateSelfServiceReservationRequestPeriodUnit(value) + for _, existing := range AllowedCreateSelfServiceReservationRequestPeriodUnitEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CreateSelfServiceReservationRequestPeriodUnit", value) +} + +// NewCreateSelfServiceReservationRequestPeriodUnitFromValue returns a pointer to a valid CreateSelfServiceReservationRequestPeriodUnit +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCreateSelfServiceReservationRequestPeriodUnitFromValue(v string) (*CreateSelfServiceReservationRequestPeriodUnit, error) { + ev := CreateSelfServiceReservationRequestPeriodUnit(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateSelfServiceReservationRequestPeriodUnit: valid values are %v", v, AllowedCreateSelfServiceReservationRequestPeriodUnitEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CreateSelfServiceReservationRequestPeriodUnit) IsValid() bool { + for _, existing := range AllowedCreateSelfServiceReservationRequestPeriodUnitEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateSelfServiceReservationRequest_period_unit value +func (v CreateSelfServiceReservationRequestPeriodUnit) Ptr() *CreateSelfServiceReservationRequestPeriodUnit { + return &v +} + +type NullableCreateSelfServiceReservationRequestPeriodUnit struct { + value *CreateSelfServiceReservationRequestPeriodUnit + isSet bool +} + +func (v NullableCreateSelfServiceReservationRequestPeriodUnit) Get() *CreateSelfServiceReservationRequestPeriodUnit { + return v.value +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodUnit) Set(val *CreateSelfServiceReservationRequestPeriodUnit) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSelfServiceReservationRequestPeriodUnit) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodUnit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSelfServiceReservationRequestPeriodUnit(val *CreateSelfServiceReservationRequestPeriodUnit) *NullableCreateSelfServiceReservationRequestPeriodUnit { + return &NullableCreateSelfServiceReservationRequestPeriodUnit{value: val, isSet: true} +} + +func (v NullableCreateSelfServiceReservationRequestPeriodUnit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSelfServiceReservationRequestPeriodUnit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_dedicated_port_create_input.go b/services/metalv1/model_dedicated_port_create_input.go new file mode 100644 index 00000000..ef7bf9fe --- /dev/null +++ b/services/metalv1/model_dedicated_port_create_input.go @@ -0,0 +1,556 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the DedicatedPortCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DedicatedPortCreateInput{} + +// DedicatedPortCreateInput struct for DedicatedPortCreateInput +type DedicatedPortCreateInput struct { + // The billing account name of the Equinix Fabric account. + BillingAccountName *string `json:"billing_account_name,omitempty"` + // The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + ContactEmail *string `json:"contact_email,omitempty"` + Description *string `json:"description,omitempty"` + // A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. + Metro string `json:"metro"` + Mode *DedicatedPortCreateInputMode `json:"mode,omitempty"` + Name string `json:"name"` + Project *string `json:"project,omitempty"` + // Either 'primary' or 'redundant'. + Redundancy string `json:"redundancy"` + // A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. + Speed *int32 `json:"speed,omitempty"` + Tags []string `json:"tags,omitempty"` + Type DedicatedPortCreateInputType `json:"type"` + // The intended use case of the dedicated port. + UseCase *string `json:"use_case,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DedicatedPortCreateInput DedicatedPortCreateInput + +// NewDedicatedPortCreateInput instantiates a new DedicatedPortCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDedicatedPortCreateInput(metro string, name string, redundancy string, type_ DedicatedPortCreateInputType) *DedicatedPortCreateInput { + this := DedicatedPortCreateInput{} + this.Metro = metro + this.Name = name + this.Redundancy = redundancy + this.Type = type_ + return &this +} + +// NewDedicatedPortCreateInputWithDefaults instantiates a new DedicatedPortCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDedicatedPortCreateInputWithDefaults() *DedicatedPortCreateInput { + this := DedicatedPortCreateInput{} + return &this +} + +// GetBillingAccountName returns the BillingAccountName field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetBillingAccountName() string { + if o == nil || IsNil(o.BillingAccountName) { + var ret string + return ret + } + return *o.BillingAccountName +} + +// GetBillingAccountNameOk returns a tuple with the BillingAccountName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetBillingAccountNameOk() (*string, bool) { + if o == nil || IsNil(o.BillingAccountName) { + return nil, false + } + return o.BillingAccountName, true +} + +// HasBillingAccountName returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasBillingAccountName() bool { + if o != nil && !IsNil(o.BillingAccountName) { + return true + } + + return false +} + +// SetBillingAccountName gets a reference to the given string and assigns it to the BillingAccountName field. +func (o *DedicatedPortCreateInput) SetBillingAccountName(v string) { + o.BillingAccountName = &v +} + +// GetContactEmail returns the ContactEmail field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetContactEmail() string { + if o == nil || IsNil(o.ContactEmail) { + var ret string + return ret + } + return *o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetContactEmailOk() (*string, bool) { + if o == nil || IsNil(o.ContactEmail) { + return nil, false + } + return o.ContactEmail, true +} + +// HasContactEmail returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasContactEmail() bool { + if o != nil && !IsNil(o.ContactEmail) { + return true + } + + return false +} + +// SetContactEmail gets a reference to the given string and assigns it to the ContactEmail field. +func (o *DedicatedPortCreateInput) SetContactEmail(v string) { + o.ContactEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DedicatedPortCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMetro returns the Metro field value +func (o *DedicatedPortCreateInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *DedicatedPortCreateInput) SetMetro(v string) { + o.Metro = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetMode() DedicatedPortCreateInputMode { + if o == nil || IsNil(o.Mode) { + var ret DedicatedPortCreateInputMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetModeOk() (*DedicatedPortCreateInputMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given DedicatedPortCreateInputMode and assigns it to the Mode field. +func (o *DedicatedPortCreateInput) SetMode(v DedicatedPortCreateInputMode) { + o.Mode = &v +} + +// GetName returns the Name field value +func (o *DedicatedPortCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DedicatedPortCreateInput) SetName(v string) { + o.Name = v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetProject() string { + if o == nil || IsNil(o.Project) { + var ret string + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetProjectOk() (*string, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given string and assigns it to the Project field. +func (o *DedicatedPortCreateInput) SetProject(v string) { + o.Project = &v +} + +// GetRedundancy returns the Redundancy field value +func (o *DedicatedPortCreateInput) GetRedundancy() string { + if o == nil { + var ret string + return ret + } + + return o.Redundancy +} + +// GetRedundancyOk returns a tuple with the Redundancy field value +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetRedundancyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Redundancy, true +} + +// SetRedundancy sets field value +func (o *DedicatedPortCreateInput) SetRedundancy(v string) { + o.Redundancy = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *DedicatedPortCreateInput) SetSpeed(v int32) { + o.Speed = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *DedicatedPortCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *DedicatedPortCreateInput) GetType() DedicatedPortCreateInputType { + if o == nil { + var ret DedicatedPortCreateInputType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetTypeOk() (*DedicatedPortCreateInputType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DedicatedPortCreateInput) SetType(v DedicatedPortCreateInputType) { + o.Type = v +} + +// GetUseCase returns the UseCase field value if set, zero value otherwise. +func (o *DedicatedPortCreateInput) GetUseCase() string { + if o == nil || IsNil(o.UseCase) { + var ret string + return ret + } + return *o.UseCase +} + +// GetUseCaseOk returns a tuple with the UseCase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DedicatedPortCreateInput) GetUseCaseOk() (*string, bool) { + if o == nil || IsNil(o.UseCase) { + return nil, false + } + return o.UseCase, true +} + +// HasUseCase returns a boolean if a field has been set. +func (o *DedicatedPortCreateInput) HasUseCase() bool { + if o != nil && !IsNil(o.UseCase) { + return true + } + + return false +} + +// SetUseCase gets a reference to the given string and assigns it to the UseCase field. +func (o *DedicatedPortCreateInput) SetUseCase(v string) { + o.UseCase = &v +} + +func (o DedicatedPortCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DedicatedPortCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BillingAccountName) { + toSerialize["billing_account_name"] = o.BillingAccountName + } + if !IsNil(o.ContactEmail) { + toSerialize["contact_email"] = o.ContactEmail + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["metro"] = o.Metro + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + toSerialize["name"] = o.Name + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + toSerialize["redundancy"] = o.Redundancy + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + if !IsNil(o.UseCase) { + toSerialize["use_case"] = o.UseCase + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DedicatedPortCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "name", + "redundancy", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDedicatedPortCreateInput := _DedicatedPortCreateInput{} + + err = json.Unmarshal(bytes, &varDedicatedPortCreateInput) + + if err != nil { + return err + } + + *o = DedicatedPortCreateInput(varDedicatedPortCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "billing_account_name") + delete(additionalProperties, "contact_email") + delete(additionalProperties, "description") + delete(additionalProperties, "metro") + delete(additionalProperties, "mode") + delete(additionalProperties, "name") + delete(additionalProperties, "project") + delete(additionalProperties, "redundancy") + delete(additionalProperties, "speed") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "use_case") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDedicatedPortCreateInput struct { + value *DedicatedPortCreateInput + isSet bool +} + +func (v NullableDedicatedPortCreateInput) Get() *DedicatedPortCreateInput { + return v.value +} + +func (v *NullableDedicatedPortCreateInput) Set(val *DedicatedPortCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableDedicatedPortCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDedicatedPortCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDedicatedPortCreateInput(val *DedicatedPortCreateInput) *NullableDedicatedPortCreateInput { + return &NullableDedicatedPortCreateInput{value: val, isSet: true} +} + +func (v NullableDedicatedPortCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDedicatedPortCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_dedicated_port_create_input_mode.go b/services/metalv1/model_dedicated_port_create_input_mode.go new file mode 100644 index 00000000..3a867f1b --- /dev/null +++ b/services/metalv1/model_dedicated_port_create_input_mode.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DedicatedPortCreateInputMode The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. +type DedicatedPortCreateInputMode string + +// List of DedicatedPortCreateInput_mode +const ( + DEDICATEDPORTCREATEINPUTMODE_STANDARD DedicatedPortCreateInputMode = "standard" + DEDICATEDPORTCREATEINPUTMODE_TUNNEL DedicatedPortCreateInputMode = "tunnel" +) + +// All allowed values of DedicatedPortCreateInputMode enum +var AllowedDedicatedPortCreateInputModeEnumValues = []DedicatedPortCreateInputMode{ + "standard", + "tunnel", +} + +func (v *DedicatedPortCreateInputMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DedicatedPortCreateInputMode(value) + for _, existing := range AllowedDedicatedPortCreateInputModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DedicatedPortCreateInputMode", value) +} + +// NewDedicatedPortCreateInputModeFromValue returns a pointer to a valid DedicatedPortCreateInputMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDedicatedPortCreateInputModeFromValue(v string) (*DedicatedPortCreateInputMode, error) { + ev := DedicatedPortCreateInputMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DedicatedPortCreateInputMode: valid values are %v", v, AllowedDedicatedPortCreateInputModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DedicatedPortCreateInputMode) IsValid() bool { + for _, existing := range AllowedDedicatedPortCreateInputModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DedicatedPortCreateInput_mode value +func (v DedicatedPortCreateInputMode) Ptr() *DedicatedPortCreateInputMode { + return &v +} + +type NullableDedicatedPortCreateInputMode struct { + value *DedicatedPortCreateInputMode + isSet bool +} + +func (v NullableDedicatedPortCreateInputMode) Get() *DedicatedPortCreateInputMode { + return v.value +} + +func (v *NullableDedicatedPortCreateInputMode) Set(val *DedicatedPortCreateInputMode) { + v.value = val + v.isSet = true +} + +func (v NullableDedicatedPortCreateInputMode) IsSet() bool { + return v.isSet +} + +func (v *NullableDedicatedPortCreateInputMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDedicatedPortCreateInputMode(val *DedicatedPortCreateInputMode) *NullableDedicatedPortCreateInputMode { + return &NullableDedicatedPortCreateInputMode{value: val, isSet: true} +} + +func (v NullableDedicatedPortCreateInputMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDedicatedPortCreateInputMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_dedicated_port_create_input_type.go b/services/metalv1/model_dedicated_port_create_input_type.go new file mode 100644 index 00000000..9e26770a --- /dev/null +++ b/services/metalv1/model_dedicated_port_create_input_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DedicatedPortCreateInputType When requesting for a dedicated port, the value of this field should be 'dedicated'. +type DedicatedPortCreateInputType string + +// List of DedicatedPortCreateInput_type +const ( + DEDICATEDPORTCREATEINPUTTYPE_DEDICATED DedicatedPortCreateInputType = "dedicated" +) + +// All allowed values of DedicatedPortCreateInputType enum +var AllowedDedicatedPortCreateInputTypeEnumValues = []DedicatedPortCreateInputType{ + "dedicated", +} + +func (v *DedicatedPortCreateInputType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DedicatedPortCreateInputType(value) + for _, existing := range AllowedDedicatedPortCreateInputTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DedicatedPortCreateInputType", value) +} + +// NewDedicatedPortCreateInputTypeFromValue returns a pointer to a valid DedicatedPortCreateInputType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDedicatedPortCreateInputTypeFromValue(v string) (*DedicatedPortCreateInputType, error) { + ev := DedicatedPortCreateInputType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DedicatedPortCreateInputType: valid values are %v", v, AllowedDedicatedPortCreateInputTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DedicatedPortCreateInputType) IsValid() bool { + for _, existing := range AllowedDedicatedPortCreateInputTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DedicatedPortCreateInput_type value +func (v DedicatedPortCreateInputType) Ptr() *DedicatedPortCreateInputType { + return &v +} + +type NullableDedicatedPortCreateInputType struct { + value *DedicatedPortCreateInputType + isSet bool +} + +func (v NullableDedicatedPortCreateInputType) Get() *DedicatedPortCreateInputType { + return v.value +} + +func (v *NullableDedicatedPortCreateInputType) Set(val *DedicatedPortCreateInputType) { + v.value = val + v.isSet = true +} + +func (v NullableDedicatedPortCreateInputType) IsSet() bool { + return v.isSet +} + +func (v *NullableDedicatedPortCreateInputType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDedicatedPortCreateInputType(val *DedicatedPortCreateInputType) *NullableDedicatedPortCreateInputType { + return &NullableDedicatedPortCreateInputType{value: val, isSet: true} +} + +func (v NullableDedicatedPortCreateInputType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDedicatedPortCreateInputType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device.go b/services/metalv1/model_device.go new file mode 100644 index 00000000..d059a820 --- /dev/null +++ b/services/metalv1/model_device.go @@ -0,0 +1,1721 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Device type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Device{} + +// Device struct for Device +type Device struct { + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *string `json:"billing_cycle,omitempty"` + BondingMode *int32 `json:"bonding_mode,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedBy *DeviceCreatedBy `json:"created_by,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Description *string `json:"description,omitempty"` + Facility *Facility `json:"facility,omitempty"` + // The UUID of the firmware set to associate with the device. + FirmwareSetId *string `json:"firmware_set_id,omitempty"` + HardwareReservation *HardwareReservation `json:"hardware_reservation,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + ImageUrl *string `json:"image_url,omitempty"` + IpAddresses []IPAssignment `json:"ip_addresses,omitempty"` + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + Iqn *string `json:"iqn,omitempty"` + // Prevents accidental deletion of this resource when set to true. + Locked *bool `json:"locked,omitempty"` + Metro *DeviceMetro `json:"metro,omitempty"` + // Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // By default, servers at Equinix Metal are configured in a “bonded” mode using LACP (Link Aggregation Control Protocol). Each 2-NIC server is configured with a single bond (namely bond0) with both interfaces eth0 and eth1 as members of the bond in a default Layer 3 mode. Some device plans may have a different number of ports and bonds available. + NetworkPorts []Port `json:"network_ports,omitempty"` + OperatingSystem *OperatingSystem `json:"operating_system,omitempty"` + // Actions supported by the device instance. + Actions []DeviceActionsInner `json:"actions,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Project *Project `json:"project,omitempty"` + ProjectLite *DeviceProjectLite `json:"project_lite,omitempty"` + ProvisioningEvents []Event `json:"provisioning_events,omitempty"` + // Only visible while device provisioning + ProvisioningPercentage *float32 `json:"provisioning_percentage,omitempty"` + // Root password is automatically generated when server is provisioned and it is removed after 24 hours + RootPassword *string `json:"root_password,omitempty"` + ShortId *string `json:"short_id,omitempty"` + // Whether or not the device is a spot instance. + SpotInstance *bool `json:"spot_instance,omitempty"` + // The maximum price per hour you are willing to pay to keep this spot instance. If you are outbid, the termination will be set allowing two minutes before shutdown. + SpotPriceMax *float32 `json:"spot_price_max,omitempty"` + SshKeys []Href `json:"ssh_keys,omitempty"` + State *DeviceState `json:"state,omitempty"` + Storage *Storage `json:"storage,omitempty"` + // Switch short id. This can be used to determine if two devices are connected to the same switch, for example. + SwitchUuid *string `json:"switch_uuid,omitempty"` + Tags []string `json:"tags,omitempty"` + // When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. + TerminationTime *time.Time `json:"termination_time,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + User *string `json:"user,omitempty"` + Userdata *string `json:"userdata,omitempty"` + Volumes []Href `json:"volumes,omitempty"` + // Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. + Sos *string `json:"sos,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Device Device + +// NewDevice instantiates a new Device object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDevice() *Device { + this := Device{} + return &this +} + +// NewDeviceWithDefaults instantiates a new Device object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceWithDefaults() *Device { + this := Device{} + return &this +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *Device) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *Device) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *Device) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *Device) GetBillingCycle() string { + if o == nil || IsNil(o.BillingCycle) { + var ret string + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetBillingCycleOk() (*string, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *Device) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given string and assigns it to the BillingCycle field. +func (o *Device) SetBillingCycle(v string) { + o.BillingCycle = &v +} + +// GetBondingMode returns the BondingMode field value if set, zero value otherwise. +func (o *Device) GetBondingMode() int32 { + if o == nil || IsNil(o.BondingMode) { + var ret int32 + return ret + } + return *o.BondingMode +} + +// GetBondingModeOk returns a tuple with the BondingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetBondingModeOk() (*int32, bool) { + if o == nil || IsNil(o.BondingMode) { + return nil, false + } + return o.BondingMode, true +} + +// HasBondingMode returns a boolean if a field has been set. +func (o *Device) HasBondingMode() bool { + if o != nil && !IsNil(o.BondingMode) { + return true + } + + return false +} + +// SetBondingMode gets a reference to the given int32 and assigns it to the BondingMode field. +func (o *Device) SetBondingMode(v int32) { + o.BondingMode = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Device) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Device) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Device) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *Device) GetCreatedBy() DeviceCreatedBy { + if o == nil || IsNil(o.CreatedBy) { + var ret DeviceCreatedBy + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetCreatedByOk() (*DeviceCreatedBy, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *Device) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given DeviceCreatedBy and assigns it to the CreatedBy field. +func (o *Device) SetCreatedBy(v DeviceCreatedBy) { + o.CreatedBy = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *Device) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *Device) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *Device) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Device) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Device) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Device) SetDescription(v string) { + o.Description = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *Device) GetFacility() Facility { + if o == nil || IsNil(o.Facility) { + var ret Facility + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetFacilityOk() (*Facility, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *Device) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given Facility and assigns it to the Facility field. +func (o *Device) SetFacility(v Facility) { + o.Facility = &v +} + +// GetFirmwareSetId returns the FirmwareSetId field value if set, zero value otherwise. +func (o *Device) GetFirmwareSetId() string { + if o == nil || IsNil(o.FirmwareSetId) { + var ret string + return ret + } + return *o.FirmwareSetId +} + +// GetFirmwareSetIdOk returns a tuple with the FirmwareSetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetFirmwareSetIdOk() (*string, bool) { + if o == nil || IsNil(o.FirmwareSetId) { + return nil, false + } + return o.FirmwareSetId, true +} + +// HasFirmwareSetId returns a boolean if a field has been set. +func (o *Device) HasFirmwareSetId() bool { + if o != nil && !IsNil(o.FirmwareSetId) { + return true + } + + return false +} + +// SetFirmwareSetId gets a reference to the given string and assigns it to the FirmwareSetId field. +func (o *Device) SetFirmwareSetId(v string) { + o.FirmwareSetId = &v +} + +// GetHardwareReservation returns the HardwareReservation field value if set, zero value otherwise. +func (o *Device) GetHardwareReservation() HardwareReservation { + if o == nil || IsNil(o.HardwareReservation) { + var ret HardwareReservation + return ret + } + return *o.HardwareReservation +} + +// GetHardwareReservationOk returns a tuple with the HardwareReservation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetHardwareReservationOk() (*HardwareReservation, bool) { + if o == nil || IsNil(o.HardwareReservation) { + return nil, false + } + return o.HardwareReservation, true +} + +// HasHardwareReservation returns a boolean if a field has been set. +func (o *Device) HasHardwareReservation() bool { + if o != nil && !IsNil(o.HardwareReservation) { + return true + } + + return false +} + +// SetHardwareReservation gets a reference to the given HardwareReservation and assigns it to the HardwareReservation field. +func (o *Device) SetHardwareReservation(v HardwareReservation) { + o.HardwareReservation = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *Device) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *Device) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *Device) SetHostname(v string) { + o.Hostname = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Device) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Device) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Device) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Device) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Device) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Device) SetId(v string) { + o.Id = &v +} + +// GetImageUrl returns the ImageUrl field value if set, zero value otherwise. +func (o *Device) GetImageUrl() string { + if o == nil || IsNil(o.ImageUrl) { + var ret string + return ret + } + return *o.ImageUrl +} + +// GetImageUrlOk returns a tuple with the ImageUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetImageUrlOk() (*string, bool) { + if o == nil || IsNil(o.ImageUrl) { + return nil, false + } + return o.ImageUrl, true +} + +// HasImageUrl returns a boolean if a field has been set. +func (o *Device) HasImageUrl() bool { + if o != nil && !IsNil(o.ImageUrl) { + return true + } + + return false +} + +// SetImageUrl gets a reference to the given string and assigns it to the ImageUrl field. +func (o *Device) SetImageUrl(v string) { + o.ImageUrl = &v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *Device) GetIpAddresses() []IPAssignment { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAssignment + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetIpAddressesOk() ([]IPAssignment, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *Device) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAssignment and assigns it to the IpAddresses field. +func (o *Device) SetIpAddresses(v []IPAssignment) { + o.IpAddresses = v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *Device) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *Device) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *Device) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetIqn returns the Iqn field value if set, zero value otherwise. +func (o *Device) GetIqn() string { + if o == nil || IsNil(o.Iqn) { + var ret string + return ret + } + return *o.Iqn +} + +// GetIqnOk returns a tuple with the Iqn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetIqnOk() (*string, bool) { + if o == nil || IsNil(o.Iqn) { + return nil, false + } + return o.Iqn, true +} + +// HasIqn returns a boolean if a field has been set. +func (o *Device) HasIqn() bool { + if o != nil && !IsNil(o.Iqn) { + return true + } + + return false +} + +// SetIqn gets a reference to the given string and assigns it to the Iqn field. +func (o *Device) SetIqn(v string) { + o.Iqn = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *Device) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *Device) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *Device) SetLocked(v bool) { + o.Locked = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *Device) GetMetro() DeviceMetro { + if o == nil || IsNil(o.Metro) { + var ret DeviceMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetMetroOk() (*DeviceMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *Device) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given DeviceMetro and assigns it to the Metro field. +func (o *Device) SetMetro(v DeviceMetro) { + o.Metro = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *Device) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *Device) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *Device) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetNetworkPorts returns the NetworkPorts field value if set, zero value otherwise. +func (o *Device) GetNetworkPorts() []Port { + if o == nil || IsNil(o.NetworkPorts) { + var ret []Port + return ret + } + return o.NetworkPorts +} + +// GetNetworkPortsOk returns a tuple with the NetworkPorts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetNetworkPortsOk() ([]Port, bool) { + if o == nil || IsNil(o.NetworkPorts) { + return nil, false + } + return o.NetworkPorts, true +} + +// HasNetworkPorts returns a boolean if a field has been set. +func (o *Device) HasNetworkPorts() bool { + if o != nil && !IsNil(o.NetworkPorts) { + return true + } + + return false +} + +// SetNetworkPorts gets a reference to the given []Port and assigns it to the NetworkPorts field. +func (o *Device) SetNetworkPorts(v []Port) { + o.NetworkPorts = v +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *Device) GetOperatingSystem() OperatingSystem { + if o == nil || IsNil(o.OperatingSystem) { + var ret OperatingSystem + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetOperatingSystemOk() (*OperatingSystem, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *Device) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given OperatingSystem and assigns it to the OperatingSystem field. +func (o *Device) SetOperatingSystem(v OperatingSystem) { + o.OperatingSystem = &v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *Device) GetActions() []DeviceActionsInner { + if o == nil || IsNil(o.Actions) { + var ret []DeviceActionsInner + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetActionsOk() ([]DeviceActionsInner, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *Device) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []DeviceActionsInner and assigns it to the Actions field. +func (o *Device) SetActions(v []DeviceActionsInner) { + o.Actions = v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *Device) GetPlan() Plan { + if o == nil || IsNil(o.Plan) { + var ret Plan + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetPlanOk() (*Plan, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *Device) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given Plan and assigns it to the Plan field. +func (o *Device) SetPlan(v Plan) { + o.Plan = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *Device) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *Device) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *Device) SetProject(v Project) { + o.Project = &v +} + +// GetProjectLite returns the ProjectLite field value if set, zero value otherwise. +func (o *Device) GetProjectLite() DeviceProjectLite { + if o == nil || IsNil(o.ProjectLite) { + var ret DeviceProjectLite + return ret + } + return *o.ProjectLite +} + +// GetProjectLiteOk returns a tuple with the ProjectLite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetProjectLiteOk() (*DeviceProjectLite, bool) { + if o == nil || IsNil(o.ProjectLite) { + return nil, false + } + return o.ProjectLite, true +} + +// HasProjectLite returns a boolean if a field has been set. +func (o *Device) HasProjectLite() bool { + if o != nil && !IsNil(o.ProjectLite) { + return true + } + + return false +} + +// SetProjectLite gets a reference to the given DeviceProjectLite and assigns it to the ProjectLite field. +func (o *Device) SetProjectLite(v DeviceProjectLite) { + o.ProjectLite = &v +} + +// GetProvisioningEvents returns the ProvisioningEvents field value if set, zero value otherwise. +func (o *Device) GetProvisioningEvents() []Event { + if o == nil || IsNil(o.ProvisioningEvents) { + var ret []Event + return ret + } + return o.ProvisioningEvents +} + +// GetProvisioningEventsOk returns a tuple with the ProvisioningEvents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetProvisioningEventsOk() ([]Event, bool) { + if o == nil || IsNil(o.ProvisioningEvents) { + return nil, false + } + return o.ProvisioningEvents, true +} + +// HasProvisioningEvents returns a boolean if a field has been set. +func (o *Device) HasProvisioningEvents() bool { + if o != nil && !IsNil(o.ProvisioningEvents) { + return true + } + + return false +} + +// SetProvisioningEvents gets a reference to the given []Event and assigns it to the ProvisioningEvents field. +func (o *Device) SetProvisioningEvents(v []Event) { + o.ProvisioningEvents = v +} + +// GetProvisioningPercentage returns the ProvisioningPercentage field value if set, zero value otherwise. +func (o *Device) GetProvisioningPercentage() float32 { + if o == nil || IsNil(o.ProvisioningPercentage) { + var ret float32 + return ret + } + return *o.ProvisioningPercentage +} + +// GetProvisioningPercentageOk returns a tuple with the ProvisioningPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetProvisioningPercentageOk() (*float32, bool) { + if o == nil || IsNil(o.ProvisioningPercentage) { + return nil, false + } + return o.ProvisioningPercentage, true +} + +// HasProvisioningPercentage returns a boolean if a field has been set. +func (o *Device) HasProvisioningPercentage() bool { + if o != nil && !IsNil(o.ProvisioningPercentage) { + return true + } + + return false +} + +// SetProvisioningPercentage gets a reference to the given float32 and assigns it to the ProvisioningPercentage field. +func (o *Device) SetProvisioningPercentage(v float32) { + o.ProvisioningPercentage = &v +} + +// GetRootPassword returns the RootPassword field value if set, zero value otherwise. +func (o *Device) GetRootPassword() string { + if o == nil || IsNil(o.RootPassword) { + var ret string + return ret + } + return *o.RootPassword +} + +// GetRootPasswordOk returns a tuple with the RootPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetRootPasswordOk() (*string, bool) { + if o == nil || IsNil(o.RootPassword) { + return nil, false + } + return o.RootPassword, true +} + +// HasRootPassword returns a boolean if a field has been set. +func (o *Device) HasRootPassword() bool { + if o != nil && !IsNil(o.RootPassword) { + return true + } + + return false +} + +// SetRootPassword gets a reference to the given string and assigns it to the RootPassword field. +func (o *Device) SetRootPassword(v string) { + o.RootPassword = &v +} + +// GetShortId returns the ShortId field value if set, zero value otherwise. +func (o *Device) GetShortId() string { + if o == nil || IsNil(o.ShortId) { + var ret string + return ret + } + return *o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetShortIdOk() (*string, bool) { + if o == nil || IsNil(o.ShortId) { + return nil, false + } + return o.ShortId, true +} + +// HasShortId returns a boolean if a field has been set. +func (o *Device) HasShortId() bool { + if o != nil && !IsNil(o.ShortId) { + return true + } + + return false +} + +// SetShortId gets a reference to the given string and assigns it to the ShortId field. +func (o *Device) SetShortId(v string) { + o.ShortId = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *Device) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *Device) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *Device) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetSpotPriceMax returns the SpotPriceMax field value if set, zero value otherwise. +func (o *Device) GetSpotPriceMax() float32 { + if o == nil || IsNil(o.SpotPriceMax) { + var ret float32 + return ret + } + return *o.SpotPriceMax +} + +// GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSpotPriceMaxOk() (*float32, bool) { + if o == nil || IsNil(o.SpotPriceMax) { + return nil, false + } + return o.SpotPriceMax, true +} + +// HasSpotPriceMax returns a boolean if a field has been set. +func (o *Device) HasSpotPriceMax() bool { + if o != nil && !IsNil(o.SpotPriceMax) { + return true + } + + return false +} + +// SetSpotPriceMax gets a reference to the given float32 and assigns it to the SpotPriceMax field. +func (o *Device) SetSpotPriceMax(v float32) { + o.SpotPriceMax = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *Device) GetSshKeys() []Href { + if o == nil || IsNil(o.SshKeys) { + var ret []Href + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSshKeysOk() ([]Href, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *Device) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []Href and assigns it to the SshKeys field. +func (o *Device) SetSshKeys(v []Href) { + o.SshKeys = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Device) GetState() DeviceState { + if o == nil || IsNil(o.State) { + var ret DeviceState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetStateOk() (*DeviceState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Device) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given DeviceState and assigns it to the State field. +func (o *Device) SetState(v DeviceState) { + o.State = &v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *Device) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *Device) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *Device) SetStorage(v Storage) { + o.Storage = &v +} + +// GetSwitchUuid returns the SwitchUuid field value if set, zero value otherwise. +func (o *Device) GetSwitchUuid() string { + if o == nil || IsNil(o.SwitchUuid) { + var ret string + return ret + } + return *o.SwitchUuid +} + +// GetSwitchUuidOk returns a tuple with the SwitchUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSwitchUuidOk() (*string, bool) { + if o == nil || IsNil(o.SwitchUuid) { + return nil, false + } + return o.SwitchUuid, true +} + +// HasSwitchUuid returns a boolean if a field has been set. +func (o *Device) HasSwitchUuid() bool { + if o != nil && !IsNil(o.SwitchUuid) { + return true + } + + return false +} + +// SetSwitchUuid gets a reference to the given string and assigns it to the SwitchUuid field. +func (o *Device) SetSwitchUuid(v string) { + o.SwitchUuid = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Device) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Device) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Device) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *Device) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *Device) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *Device) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Device) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Device) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Device) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *Device) GetUser() string { + if o == nil || IsNil(o.User) { + var ret string + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetUserOk() (*string, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *Device) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given string and assigns it to the User field. +func (o *Device) SetUser(v string) { + o.User = &v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *Device) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *Device) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *Device) SetUserdata(v string) { + o.Userdata = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Device) GetVolumes() []Href { + if o == nil || IsNil(o.Volumes) { + var ret []Href + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetVolumesOk() ([]Href, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Device) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []Href and assigns it to the Volumes field. +func (o *Device) SetVolumes(v []Href) { + o.Volumes = v +} + +// GetSos returns the Sos field value if set, zero value otherwise. +func (o *Device) GetSos() string { + if o == nil || IsNil(o.Sos) { + var ret string + return ret + } + return *o.Sos +} + +// GetSosOk returns a tuple with the Sos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Device) GetSosOk() (*string, bool) { + if o == nil || IsNil(o.Sos) { + return nil, false + } + return o.Sos, true +} + +// HasSos returns a boolean if a field has been set. +func (o *Device) HasSos() bool { + if o != nil && !IsNil(o.Sos) { + return true + } + + return false +} + +// SetSos gets a reference to the given string and assigns it to the Sos field. +func (o *Device) SetSos(v string) { + o.Sos = &v +} + +func (o Device) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Device) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.BondingMode) { + toSerialize["bonding_mode"] = o.BondingMode + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.FirmwareSetId) { + toSerialize["firmware_set_id"] = o.FirmwareSetId + } + if !IsNil(o.HardwareReservation) { + toSerialize["hardware_reservation"] = o.HardwareReservation + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageUrl) { + toSerialize["image_url"] = o.ImageUrl + } + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Iqn) { + toSerialize["iqn"] = o.Iqn + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.NetworkPorts) { + toSerialize["network_ports"] = o.NetworkPorts + } + if !IsNil(o.OperatingSystem) { + toSerialize["operating_system"] = o.OperatingSystem + } + if !IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.ProjectLite) { + toSerialize["project_lite"] = o.ProjectLite + } + if !IsNil(o.ProvisioningEvents) { + toSerialize["provisioning_events"] = o.ProvisioningEvents + } + if !IsNil(o.ProvisioningPercentage) { + toSerialize["provisioning_percentage"] = o.ProvisioningPercentage + } + if !IsNil(o.RootPassword) { + toSerialize["root_password"] = o.RootPassword + } + if !IsNil(o.ShortId) { + toSerialize["short_id"] = o.ShortId + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.SpotPriceMax) { + toSerialize["spot_price_max"] = o.SpotPriceMax + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.SwitchUuid) { + toSerialize["switch_uuid"] = o.SwitchUuid + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + if !IsNil(o.Sos) { + toSerialize["sos"] = o.Sos + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Device) UnmarshalJSON(bytes []byte) (err error) { + varDevice := _Device{} + + err = json.Unmarshal(bytes, &varDevice) + + if err != nil { + return err + } + + *o = Device(varDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "bonding_mode") + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "facility") + delete(additionalProperties, "firmware_set_id") + delete(additionalProperties, "hardware_reservation") + delete(additionalProperties, "hostname") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "image_url") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "iqn") + delete(additionalProperties, "locked") + delete(additionalProperties, "metro") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "network_ports") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "actions") + delete(additionalProperties, "plan") + delete(additionalProperties, "project") + delete(additionalProperties, "project_lite") + delete(additionalProperties, "provisioning_events") + delete(additionalProperties, "provisioning_percentage") + delete(additionalProperties, "root_password") + delete(additionalProperties, "short_id") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "spot_price_max") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "state") + delete(additionalProperties, "storage") + delete(additionalProperties, "switch_uuid") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "user") + delete(additionalProperties, "userdata") + delete(additionalProperties, "volumes") + delete(additionalProperties, "sos") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDevice struct { + value *Device + isSet bool +} + +func (v NullableDevice) Get() *Device { + return v.value +} + +func (v *NullableDevice) Set(val *Device) { + v.value = val + v.isSet = true +} + +func (v NullableDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDevice(val *Device) *NullableDevice { + return &NullableDevice{value: val, isSet: true} +} + +func (v NullableDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_action_input.go b/services/metalv1/model_device_action_input.go new file mode 100644 index 00000000..4c473776 --- /dev/null +++ b/services/metalv1/model_device_action_input.go @@ -0,0 +1,357 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceActionInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceActionInput{} + +// DeviceActionInput struct for DeviceActionInput +type DeviceActionInput struct { + Type DeviceActionInputType `json:"type"` + // May be required to perform actions under certain conditions + ForceDelete *bool `json:"force_delete,omitempty"` + // When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. + DeprovisionFast *bool `json:"deprovision_fast,omitempty"` + // When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. + PreserveData *bool `json:"preserve_data,omitempty"` + // When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) + OperatingSystem *string `json:"operating_system,omitempty"` + // When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceActionInput DeviceActionInput + +// NewDeviceActionInput instantiates a new DeviceActionInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceActionInput(type_ DeviceActionInputType) *DeviceActionInput { + this := DeviceActionInput{} + this.Type = type_ + return &this +} + +// NewDeviceActionInputWithDefaults instantiates a new DeviceActionInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceActionInputWithDefaults() *DeviceActionInput { + this := DeviceActionInput{} + return &this +} + +// GetType returns the Type field value +func (o *DeviceActionInput) GetType() DeviceActionInputType { + if o == nil { + var ret DeviceActionInputType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetTypeOk() (*DeviceActionInputType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DeviceActionInput) SetType(v DeviceActionInputType) { + o.Type = v +} + +// GetForceDelete returns the ForceDelete field value if set, zero value otherwise. +func (o *DeviceActionInput) GetForceDelete() bool { + if o == nil || IsNil(o.ForceDelete) { + var ret bool + return ret + } + return *o.ForceDelete +} + +// GetForceDeleteOk returns a tuple with the ForceDelete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetForceDeleteOk() (*bool, bool) { + if o == nil || IsNil(o.ForceDelete) { + return nil, false + } + return o.ForceDelete, true +} + +// HasForceDelete returns a boolean if a field has been set. +func (o *DeviceActionInput) HasForceDelete() bool { + if o != nil && !IsNil(o.ForceDelete) { + return true + } + + return false +} + +// SetForceDelete gets a reference to the given bool and assigns it to the ForceDelete field. +func (o *DeviceActionInput) SetForceDelete(v bool) { + o.ForceDelete = &v +} + +// GetDeprovisionFast returns the DeprovisionFast field value if set, zero value otherwise. +func (o *DeviceActionInput) GetDeprovisionFast() bool { + if o == nil || IsNil(o.DeprovisionFast) { + var ret bool + return ret + } + return *o.DeprovisionFast +} + +// GetDeprovisionFastOk returns a tuple with the DeprovisionFast field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetDeprovisionFastOk() (*bool, bool) { + if o == nil || IsNil(o.DeprovisionFast) { + return nil, false + } + return o.DeprovisionFast, true +} + +// HasDeprovisionFast returns a boolean if a field has been set. +func (o *DeviceActionInput) HasDeprovisionFast() bool { + if o != nil && !IsNil(o.DeprovisionFast) { + return true + } + + return false +} + +// SetDeprovisionFast gets a reference to the given bool and assigns it to the DeprovisionFast field. +func (o *DeviceActionInput) SetDeprovisionFast(v bool) { + o.DeprovisionFast = &v +} + +// GetPreserveData returns the PreserveData field value if set, zero value otherwise. +func (o *DeviceActionInput) GetPreserveData() bool { + if o == nil || IsNil(o.PreserveData) { + var ret bool + return ret + } + return *o.PreserveData +} + +// GetPreserveDataOk returns a tuple with the PreserveData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetPreserveDataOk() (*bool, bool) { + if o == nil || IsNil(o.PreserveData) { + return nil, false + } + return o.PreserveData, true +} + +// HasPreserveData returns a boolean if a field has been set. +func (o *DeviceActionInput) HasPreserveData() bool { + if o != nil && !IsNil(o.PreserveData) { + return true + } + + return false +} + +// SetPreserveData gets a reference to the given bool and assigns it to the PreserveData field. +func (o *DeviceActionInput) SetPreserveData(v bool) { + o.PreserveData = &v +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *DeviceActionInput) GetOperatingSystem() string { + if o == nil || IsNil(o.OperatingSystem) { + var ret string + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetOperatingSystemOk() (*string, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *DeviceActionInput) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +func (o *DeviceActionInput) SetOperatingSystem(v string) { + o.OperatingSystem = &v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *DeviceActionInput) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionInput) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *DeviceActionInput) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *DeviceActionInput) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +func (o DeviceActionInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceActionInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if !IsNil(o.ForceDelete) { + toSerialize["force_delete"] = o.ForceDelete + } + if !IsNil(o.DeprovisionFast) { + toSerialize["deprovision_fast"] = o.DeprovisionFast + } + if !IsNil(o.PreserveData) { + toSerialize["preserve_data"] = o.PreserveData + } + if !IsNil(o.OperatingSystem) { + toSerialize["operating_system"] = o.OperatingSystem + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceActionInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceActionInput := _DeviceActionInput{} + + err = json.Unmarshal(bytes, &varDeviceActionInput) + + if err != nil { + return err + } + + *o = DeviceActionInput(varDeviceActionInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "force_delete") + delete(additionalProperties, "deprovision_fast") + delete(additionalProperties, "preserve_data") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "ipxe_script_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceActionInput struct { + value *DeviceActionInput + isSet bool +} + +func (v NullableDeviceActionInput) Get() *DeviceActionInput { + return v.value +} + +func (v *NullableDeviceActionInput) Set(val *DeviceActionInput) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceActionInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceActionInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceActionInput(val *DeviceActionInput) *NullableDeviceActionInput { + return &NullableDeviceActionInput{value: val, isSet: true} +} + +func (v NullableDeviceActionInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceActionInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_action_input_type.go b/services/metalv1/model_device_action_input_type.go new file mode 100644 index 00000000..da3446d4 --- /dev/null +++ b/services/metalv1/model_device_action_input_type.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DeviceActionInputType Action to perform. See Device.actions for possible actions. +type DeviceActionInputType string + +// List of DeviceActionInput_type +const ( + DEVICEACTIONINPUTTYPE_POWER_ON DeviceActionInputType = "power_on" + DEVICEACTIONINPUTTYPE_POWER_OFF DeviceActionInputType = "power_off" + DEVICEACTIONINPUTTYPE_REBOOT DeviceActionInputType = "reboot" + DEVICEACTIONINPUTTYPE_RESCUE DeviceActionInputType = "rescue" + DEVICEACTIONINPUTTYPE_REINSTALL DeviceActionInputType = "reinstall" +) + +// All allowed values of DeviceActionInputType enum +var AllowedDeviceActionInputTypeEnumValues = []DeviceActionInputType{ + "power_on", + "power_off", + "reboot", + "rescue", + "reinstall", +} + +func (v *DeviceActionInputType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceActionInputType(value) + for _, existing := range AllowedDeviceActionInputTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceActionInputType", value) +} + +// NewDeviceActionInputTypeFromValue returns a pointer to a valid DeviceActionInputType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceActionInputTypeFromValue(v string) (*DeviceActionInputType, error) { + ev := DeviceActionInputType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceActionInputType: valid values are %v", v, AllowedDeviceActionInputTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceActionInputType) IsValid() bool { + for _, existing := range AllowedDeviceActionInputTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceActionInput_type value +func (v DeviceActionInputType) Ptr() *DeviceActionInputType { + return &v +} + +type NullableDeviceActionInputType struct { + value *DeviceActionInputType + isSet bool +} + +func (v NullableDeviceActionInputType) Get() *DeviceActionInputType { + return v.value +} + +func (v *NullableDeviceActionInputType) Set(val *DeviceActionInputType) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceActionInputType) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceActionInputType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceActionInputType(val *DeviceActionInputType) *NullableDeviceActionInputType { + return &NullableDeviceActionInputType{value: val, isSet: true} +} + +func (v NullableDeviceActionInputType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceActionInputType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_actions_inner.go b/services/metalv1/model_device_actions_inner.go new file mode 100644 index 00000000..d05eb149 --- /dev/null +++ b/services/metalv1/model_device_actions_inner.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceActionsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceActionsInner{} + +// DeviceActionsInner struct for DeviceActionsInner +type DeviceActionsInner struct { + Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceActionsInner DeviceActionsInner + +// NewDeviceActionsInner instantiates a new DeviceActionsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceActionsInner() *DeviceActionsInner { + this := DeviceActionsInner{} + return &this +} + +// NewDeviceActionsInnerWithDefaults instantiates a new DeviceActionsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceActionsInnerWithDefaults() *DeviceActionsInner { + this := DeviceActionsInner{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DeviceActionsInner) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionsInner) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DeviceActionsInner) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *DeviceActionsInner) SetType(v string) { + o.Type = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceActionsInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceActionsInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceActionsInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceActionsInner) SetName(v string) { + o.Name = &v +} + +func (o DeviceActionsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceActionsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceActionsInner) UnmarshalJSON(bytes []byte) (err error) { + varDeviceActionsInner := _DeviceActionsInner{} + + err = json.Unmarshal(bytes, &varDeviceActionsInner) + + if err != nil { + return err + } + + *o = DeviceActionsInner(varDeviceActionsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceActionsInner struct { + value *DeviceActionsInner + isSet bool +} + +func (v NullableDeviceActionsInner) Get() *DeviceActionsInner { + return v.value +} + +func (v *NullableDeviceActionsInner) Set(val *DeviceActionsInner) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceActionsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceActionsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceActionsInner(val *DeviceActionsInner) *NullableDeviceActionsInner { + return &NullableDeviceActionsInner{value: val, isSet: true} +} + +func (v NullableDeviceActionsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceActionsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_create_in_facility_input.go b/services/metalv1/model_device_create_in_facility_input.go new file mode 100644 index 00000000..6aee2c76 --- /dev/null +++ b/services/metalv1/model_device_create_in_facility_input.go @@ -0,0 +1,1128 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceCreateInFacilityInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceCreateInFacilityInput{} + +// DeviceCreateInFacilityInput struct for DeviceCreateInFacilityInput +type DeviceCreateInFacilityInput struct { + // The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + // Deprecated + Facility []string `json:"facility"` + // When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *DeviceCreateInputBillingCycle `json:"billing_cycle,omitempty"` + // Customdata is an arbitrary JSON value that can be accessed via the metadata service. + Customdata map[string]interface{} `json:"customdata,omitempty"` + // Any description of the device or how it will be used. This may be used to inform other API consumers with project access. + Description *string `json:"description,omitempty"` + // The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. + Features []string `json:"features,omitempty"` + // The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + HardwareReservationId *string `json:"hardware_reservation_id,omitempty"` + // The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. + Hostname *string `json:"hostname,omitempty"` + // The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + IpAddresses []IPAddress `json:"ip_addresses,omitempty"` + // When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + // If true, this instance can not be converted to a different network type. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified + NoSshKeys *bool `json:"no_ssh_keys,omitempty"` + // The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. + OperatingSystem string `json:"operating_system"` + // The slug of the device plan to provision. + Plan string `json:"plan"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + // A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + ProjectSshKeys []string `json:"project_ssh_keys,omitempty"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. + PublicIpv4SubnetSize *int32 `json:"public_ipv4_subnet_size,omitempty"` + // Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + SpotInstance *bool `json:"spot_instance,omitempty"` + // The maximum amount to bid for a spot instance. + SpotPriceMax *float32 `json:"spot_price_max,omitempty"` + // A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. + SshKeys []SSHKeyInput `json:"ssh_keys,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Tags []string `json:"tags,omitempty"` + // When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. + TerminationTime *time.Time `json:"termination_time,omitempty"` + // A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + UserSshKeys []string `json:"user_ssh_keys,omitempty"` + // The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceCreateInFacilityInput DeviceCreateInFacilityInput + +// NewDeviceCreateInFacilityInput instantiates a new DeviceCreateInFacilityInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceCreateInFacilityInput(facility []string, operatingSystem string, plan string) *DeviceCreateInFacilityInput { + this := DeviceCreateInFacilityInput{} + this.Facility = facility + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + this.OperatingSystem = operatingSystem + this.Plan = plan + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// NewDeviceCreateInFacilityInputWithDefaults instantiates a new DeviceCreateInFacilityInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceCreateInFacilityInputWithDefaults() *DeviceCreateInFacilityInput { + this := DeviceCreateInFacilityInput{} + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// GetFacility returns the Facility field value +// Deprecated +func (o *DeviceCreateInFacilityInput) GetFacility() []string { + if o == nil { + var ret []string + return ret + } + + return o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *DeviceCreateInFacilityInput) GetFacilityOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Facility, true +} + +// SetFacility sets field value +// Deprecated +func (o *DeviceCreateInFacilityInput) SetFacility(v []string) { + o.Facility = v +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *DeviceCreateInFacilityInput) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetBillingCycle() DeviceCreateInputBillingCycle { + if o == nil || IsNil(o.BillingCycle) { + var ret DeviceCreateInputBillingCycle + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given DeviceCreateInputBillingCycle and assigns it to the BillingCycle field. +func (o *DeviceCreateInFacilityInput) SetBillingCycle(v DeviceCreateInputBillingCycle) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *DeviceCreateInFacilityInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceCreateInFacilityInput) SetDescription(v string) { + o.Description = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetFeatures() []string { + if o == nil || IsNil(o.Features) { + var ret []string + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetFeaturesOk() ([]string, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []string and assigns it to the Features field. +func (o *DeviceCreateInFacilityInput) SetFeatures(v []string) { + o.Features = v +} + +// GetHardwareReservationId returns the HardwareReservationId field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetHardwareReservationId() string { + if o == nil || IsNil(o.HardwareReservationId) { + var ret string + return ret + } + return *o.HardwareReservationId +} + +// GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetHardwareReservationIdOk() (*string, bool) { + if o == nil || IsNil(o.HardwareReservationId) { + return nil, false + } + return o.HardwareReservationId, true +} + +// HasHardwareReservationId returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasHardwareReservationId() bool { + if o != nil && !IsNil(o.HardwareReservationId) { + return true + } + + return false +} + +// SetHardwareReservationId gets a reference to the given string and assigns it to the HardwareReservationId field. +func (o *DeviceCreateInFacilityInput) SetHardwareReservationId(v string) { + o.HardwareReservationId = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *DeviceCreateInFacilityInput) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetIpAddresses() []IPAddress { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAddress + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetIpAddressesOk() ([]IPAddress, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAddress and assigns it to the IpAddresses field. +func (o *DeviceCreateInFacilityInput) SetIpAddresses(v []IPAddress) { + o.IpAddresses = v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *DeviceCreateInFacilityInput) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *DeviceCreateInFacilityInput) SetLocked(v bool) { + o.Locked = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *DeviceCreateInFacilityInput) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetNoSshKeys returns the NoSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetNoSshKeys() bool { + if o == nil || IsNil(o.NoSshKeys) { + var ret bool + return ret + } + return *o.NoSshKeys +} + +// GetNoSshKeysOk returns a tuple with the NoSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetNoSshKeysOk() (*bool, bool) { + if o == nil || IsNil(o.NoSshKeys) { + return nil, false + } + return o.NoSshKeys, true +} + +// HasNoSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasNoSshKeys() bool { + if o != nil && !IsNil(o.NoSshKeys) { + return true + } + + return false +} + +// SetNoSshKeys gets a reference to the given bool and assigns it to the NoSshKeys field. +func (o *DeviceCreateInFacilityInput) SetNoSshKeys(v bool) { + o.NoSshKeys = &v +} + +// GetOperatingSystem returns the OperatingSystem field value +func (o *DeviceCreateInFacilityInput) GetOperatingSystem() string { + if o == nil { + var ret string + return ret + } + + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetOperatingSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OperatingSystem, true +} + +// SetOperatingSystem sets field value +func (o *DeviceCreateInFacilityInput) SetOperatingSystem(v string) { + o.OperatingSystem = v +} + +// GetPlan returns the Plan field value +func (o *DeviceCreateInFacilityInput) GetPlan() string { + if o == nil { + var ret string + return ret + } + + return o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetPlanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Plan, true +} + +// SetPlan sets field value +func (o *DeviceCreateInFacilityInput) SetPlan(v string) { + o.Plan = v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *DeviceCreateInFacilityInput) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetProjectSshKeys returns the ProjectSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetProjectSshKeys() []string { + if o == nil || IsNil(o.ProjectSshKeys) { + var ret []string + return ret + } + return o.ProjectSshKeys +} + +// GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetProjectSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectSshKeys) { + return nil, false + } + return o.ProjectSshKeys, true +} + +// HasProjectSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasProjectSshKeys() bool { + if o != nil && !IsNil(o.ProjectSshKeys) { + return true + } + + return false +} + +// SetProjectSshKeys gets a reference to the given []string and assigns it to the ProjectSshKeys field. +func (o *DeviceCreateInFacilityInput) SetProjectSshKeys(v []string) { + o.ProjectSshKeys = v +} + +// GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetPublicIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PublicIpv4SubnetSize +} + +// GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetPublicIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + return nil, false + } + return o.PublicIpv4SubnetSize, true +} + +// HasPublicIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasPublicIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PublicIpv4SubnetSize) { + return true + } + + return false +} + +// SetPublicIpv4SubnetSize gets a reference to the given int32 and assigns it to the PublicIpv4SubnetSize field. +func (o *DeviceCreateInFacilityInput) SetPublicIpv4SubnetSize(v int32) { + o.PublicIpv4SubnetSize = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *DeviceCreateInFacilityInput) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetSpotPriceMax returns the SpotPriceMax field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetSpotPriceMax() float32 { + if o == nil || IsNil(o.SpotPriceMax) { + var ret float32 + return ret + } + return *o.SpotPriceMax +} + +// GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetSpotPriceMaxOk() (*float32, bool) { + if o == nil || IsNil(o.SpotPriceMax) { + return nil, false + } + return o.SpotPriceMax, true +} + +// HasSpotPriceMax returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasSpotPriceMax() bool { + if o != nil && !IsNil(o.SpotPriceMax) { + return true + } + + return false +} + +// SetSpotPriceMax gets a reference to the given float32 and assigns it to the SpotPriceMax field. +func (o *DeviceCreateInFacilityInput) SetSpotPriceMax(v float32) { + o.SpotPriceMax = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetSshKeys() []SSHKeyInput { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKeyInput + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetSshKeysOk() ([]SSHKeyInput, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKeyInput and assigns it to the SshKeys field. +func (o *DeviceCreateInFacilityInput) SetSshKeys(v []SSHKeyInput) { + o.SshKeys = v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *DeviceCreateInFacilityInput) SetStorage(v Storage) { + o.Storage = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *DeviceCreateInFacilityInput) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *DeviceCreateInFacilityInput) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUserSshKeys returns the UserSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetUserSshKeys() []string { + if o == nil || IsNil(o.UserSshKeys) { + var ret []string + return ret + } + return o.UserSshKeys +} + +// GetUserSshKeysOk returns a tuple with the UserSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetUserSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.UserSshKeys) { + return nil, false + } + return o.UserSshKeys, true +} + +// HasUserSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasUserSshKeys() bool { + if o != nil && !IsNil(o.UserSshKeys) { + return true + } + + return false +} + +// SetUserSshKeys gets a reference to the given []string and assigns it to the UserSshKeys field. +func (o *DeviceCreateInFacilityInput) SetUserSshKeys(v []string) { + o.UserSshKeys = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *DeviceCreateInFacilityInput) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInFacilityInput) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *DeviceCreateInFacilityInput) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *DeviceCreateInFacilityInput) SetUserdata(v string) { + o.Userdata = &v +} + +func (o DeviceCreateInFacilityInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceCreateInFacilityInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["facility"] = o.Facility + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.HardwareReservationId) { + toSerialize["hardware_reservation_id"] = o.HardwareReservationId + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.NoSshKeys) { + toSerialize["no_ssh_keys"] = o.NoSshKeys + } + toSerialize["operating_system"] = o.OperatingSystem + toSerialize["plan"] = o.Plan + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + if !IsNil(o.ProjectSshKeys) { + toSerialize["project_ssh_keys"] = o.ProjectSshKeys + } + if !IsNil(o.PublicIpv4SubnetSize) { + toSerialize["public_ipv4_subnet_size"] = o.PublicIpv4SubnetSize + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.SpotPriceMax) { + toSerialize["spot_price_max"] = o.SpotPriceMax + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UserSshKeys) { + toSerialize["user_ssh_keys"] = o.UserSshKeys + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceCreateInFacilityInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "facility", + "operating_system", + "plan", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceCreateInFacilityInput := _DeviceCreateInFacilityInput{} + + err = json.Unmarshal(bytes, &varDeviceCreateInFacilityInput) + + if err != nil { + return err + } + + *o = DeviceCreateInFacilityInput(varDeviceCreateInFacilityInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "facility") + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "features") + delete(additionalProperties, "hardware_reservation_id") + delete(additionalProperties, "hostname") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "locked") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "no_ssh_keys") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "project_ssh_keys") + delete(additionalProperties, "public_ipv4_subnet_size") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "spot_price_max") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "storage") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "user_ssh_keys") + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceCreateInFacilityInput struct { + value *DeviceCreateInFacilityInput + isSet bool +} + +func (v NullableDeviceCreateInFacilityInput) Get() *DeviceCreateInFacilityInput { + return v.value +} + +func (v *NullableDeviceCreateInFacilityInput) Set(val *DeviceCreateInFacilityInput) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceCreateInFacilityInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceCreateInFacilityInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceCreateInFacilityInput(val *DeviceCreateInFacilityInput) *NullableDeviceCreateInFacilityInput { + return &NullableDeviceCreateInFacilityInput{value: val, isSet: true} +} + +func (v NullableDeviceCreateInFacilityInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceCreateInFacilityInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_create_in_metro_input.go b/services/metalv1/model_device_create_in_metro_input.go new file mode 100644 index 00000000..a81ebb1c --- /dev/null +++ b/services/metalv1/model_device_create_in_metro_input.go @@ -0,0 +1,1124 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceCreateInMetroInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceCreateInMetroInput{} + +// DeviceCreateInMetroInput struct for DeviceCreateInMetroInput +type DeviceCreateInMetroInput struct { + // Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. + Metro string `json:"metro"` + // When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *DeviceCreateInputBillingCycle `json:"billing_cycle,omitempty"` + // Customdata is an arbitrary JSON value that can be accessed via the metadata service. + Customdata map[string]interface{} `json:"customdata,omitempty"` + // Any description of the device or how it will be used. This may be used to inform other API consumers with project access. + Description *string `json:"description,omitempty"` + // The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. + Features []string `json:"features,omitempty"` + // The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + HardwareReservationId *string `json:"hardware_reservation_id,omitempty"` + // The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. + Hostname *string `json:"hostname,omitempty"` + // The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + IpAddresses []IPAddress `json:"ip_addresses,omitempty"` + // When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + // If true, this instance can not be converted to a different network type. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified + NoSshKeys *bool `json:"no_ssh_keys,omitempty"` + // The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. + OperatingSystem string `json:"operating_system"` + // The slug of the device plan to provision. + Plan string `json:"plan"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + // A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + ProjectSshKeys []string `json:"project_ssh_keys,omitempty"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. + PublicIpv4SubnetSize *int32 `json:"public_ipv4_subnet_size,omitempty"` + // Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + SpotInstance *bool `json:"spot_instance,omitempty"` + // The maximum amount to bid for a spot instance. + SpotPriceMax *float32 `json:"spot_price_max,omitempty"` + // A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. + SshKeys []SSHKeyInput `json:"ssh_keys,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Tags []string `json:"tags,omitempty"` + // When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. + TerminationTime *time.Time `json:"termination_time,omitempty"` + // A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + UserSshKeys []string `json:"user_ssh_keys,omitempty"` + // The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceCreateInMetroInput DeviceCreateInMetroInput + +// NewDeviceCreateInMetroInput instantiates a new DeviceCreateInMetroInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceCreateInMetroInput(metro string, operatingSystem string, plan string) *DeviceCreateInMetroInput { + this := DeviceCreateInMetroInput{} + this.Metro = metro + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + this.OperatingSystem = operatingSystem + this.Plan = plan + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// NewDeviceCreateInMetroInputWithDefaults instantiates a new DeviceCreateInMetroInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceCreateInMetroInputWithDefaults() *DeviceCreateInMetroInput { + this := DeviceCreateInMetroInput{} + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// GetMetro returns the Metro field value +func (o *DeviceCreateInMetroInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *DeviceCreateInMetroInput) SetMetro(v string) { + o.Metro = v +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *DeviceCreateInMetroInput) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetBillingCycle() DeviceCreateInputBillingCycle { + if o == nil || IsNil(o.BillingCycle) { + var ret DeviceCreateInputBillingCycle + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given DeviceCreateInputBillingCycle and assigns it to the BillingCycle field. +func (o *DeviceCreateInMetroInput) SetBillingCycle(v DeviceCreateInputBillingCycle) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *DeviceCreateInMetroInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceCreateInMetroInput) SetDescription(v string) { + o.Description = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetFeatures() []string { + if o == nil || IsNil(o.Features) { + var ret []string + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetFeaturesOk() ([]string, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []string and assigns it to the Features field. +func (o *DeviceCreateInMetroInput) SetFeatures(v []string) { + o.Features = v +} + +// GetHardwareReservationId returns the HardwareReservationId field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetHardwareReservationId() string { + if o == nil || IsNil(o.HardwareReservationId) { + var ret string + return ret + } + return *o.HardwareReservationId +} + +// GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetHardwareReservationIdOk() (*string, bool) { + if o == nil || IsNil(o.HardwareReservationId) { + return nil, false + } + return o.HardwareReservationId, true +} + +// HasHardwareReservationId returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasHardwareReservationId() bool { + if o != nil && !IsNil(o.HardwareReservationId) { + return true + } + + return false +} + +// SetHardwareReservationId gets a reference to the given string and assigns it to the HardwareReservationId field. +func (o *DeviceCreateInMetroInput) SetHardwareReservationId(v string) { + o.HardwareReservationId = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *DeviceCreateInMetroInput) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetIpAddresses() []IPAddress { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAddress + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetIpAddressesOk() ([]IPAddress, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAddress and assigns it to the IpAddresses field. +func (o *DeviceCreateInMetroInput) SetIpAddresses(v []IPAddress) { + o.IpAddresses = v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *DeviceCreateInMetroInput) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *DeviceCreateInMetroInput) SetLocked(v bool) { + o.Locked = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *DeviceCreateInMetroInput) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetNoSshKeys returns the NoSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetNoSshKeys() bool { + if o == nil || IsNil(o.NoSshKeys) { + var ret bool + return ret + } + return *o.NoSshKeys +} + +// GetNoSshKeysOk returns a tuple with the NoSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetNoSshKeysOk() (*bool, bool) { + if o == nil || IsNil(o.NoSshKeys) { + return nil, false + } + return o.NoSshKeys, true +} + +// HasNoSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasNoSshKeys() bool { + if o != nil && !IsNil(o.NoSshKeys) { + return true + } + + return false +} + +// SetNoSshKeys gets a reference to the given bool and assigns it to the NoSshKeys field. +func (o *DeviceCreateInMetroInput) SetNoSshKeys(v bool) { + o.NoSshKeys = &v +} + +// GetOperatingSystem returns the OperatingSystem field value +func (o *DeviceCreateInMetroInput) GetOperatingSystem() string { + if o == nil { + var ret string + return ret + } + + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetOperatingSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OperatingSystem, true +} + +// SetOperatingSystem sets field value +func (o *DeviceCreateInMetroInput) SetOperatingSystem(v string) { + o.OperatingSystem = v +} + +// GetPlan returns the Plan field value +func (o *DeviceCreateInMetroInput) GetPlan() string { + if o == nil { + var ret string + return ret + } + + return o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetPlanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Plan, true +} + +// SetPlan sets field value +func (o *DeviceCreateInMetroInput) SetPlan(v string) { + o.Plan = v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *DeviceCreateInMetroInput) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetProjectSshKeys returns the ProjectSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetProjectSshKeys() []string { + if o == nil || IsNil(o.ProjectSshKeys) { + var ret []string + return ret + } + return o.ProjectSshKeys +} + +// GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetProjectSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectSshKeys) { + return nil, false + } + return o.ProjectSshKeys, true +} + +// HasProjectSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasProjectSshKeys() bool { + if o != nil && !IsNil(o.ProjectSshKeys) { + return true + } + + return false +} + +// SetProjectSshKeys gets a reference to the given []string and assigns it to the ProjectSshKeys field. +func (o *DeviceCreateInMetroInput) SetProjectSshKeys(v []string) { + o.ProjectSshKeys = v +} + +// GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetPublicIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PublicIpv4SubnetSize +} + +// GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetPublicIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + return nil, false + } + return o.PublicIpv4SubnetSize, true +} + +// HasPublicIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasPublicIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PublicIpv4SubnetSize) { + return true + } + + return false +} + +// SetPublicIpv4SubnetSize gets a reference to the given int32 and assigns it to the PublicIpv4SubnetSize field. +func (o *DeviceCreateInMetroInput) SetPublicIpv4SubnetSize(v int32) { + o.PublicIpv4SubnetSize = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *DeviceCreateInMetroInput) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetSpotPriceMax returns the SpotPriceMax field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetSpotPriceMax() float32 { + if o == nil || IsNil(o.SpotPriceMax) { + var ret float32 + return ret + } + return *o.SpotPriceMax +} + +// GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetSpotPriceMaxOk() (*float32, bool) { + if o == nil || IsNil(o.SpotPriceMax) { + return nil, false + } + return o.SpotPriceMax, true +} + +// HasSpotPriceMax returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasSpotPriceMax() bool { + if o != nil && !IsNil(o.SpotPriceMax) { + return true + } + + return false +} + +// SetSpotPriceMax gets a reference to the given float32 and assigns it to the SpotPriceMax field. +func (o *DeviceCreateInMetroInput) SetSpotPriceMax(v float32) { + o.SpotPriceMax = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetSshKeys() []SSHKeyInput { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKeyInput + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetSshKeysOk() ([]SSHKeyInput, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKeyInput and assigns it to the SshKeys field. +func (o *DeviceCreateInMetroInput) SetSshKeys(v []SSHKeyInput) { + o.SshKeys = v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *DeviceCreateInMetroInput) SetStorage(v Storage) { + o.Storage = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *DeviceCreateInMetroInput) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *DeviceCreateInMetroInput) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUserSshKeys returns the UserSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetUserSshKeys() []string { + if o == nil || IsNil(o.UserSshKeys) { + var ret []string + return ret + } + return o.UserSshKeys +} + +// GetUserSshKeysOk returns a tuple with the UserSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetUserSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.UserSshKeys) { + return nil, false + } + return o.UserSshKeys, true +} + +// HasUserSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasUserSshKeys() bool { + if o != nil && !IsNil(o.UserSshKeys) { + return true + } + + return false +} + +// SetUserSshKeys gets a reference to the given []string and assigns it to the UserSshKeys field. +func (o *DeviceCreateInMetroInput) SetUserSshKeys(v []string) { + o.UserSshKeys = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *DeviceCreateInMetroInput) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInMetroInput) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *DeviceCreateInMetroInput) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *DeviceCreateInMetroInput) SetUserdata(v string) { + o.Userdata = &v +} + +func (o DeviceCreateInMetroInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceCreateInMetroInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["metro"] = o.Metro + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.HardwareReservationId) { + toSerialize["hardware_reservation_id"] = o.HardwareReservationId + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.NoSshKeys) { + toSerialize["no_ssh_keys"] = o.NoSshKeys + } + toSerialize["operating_system"] = o.OperatingSystem + toSerialize["plan"] = o.Plan + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + if !IsNil(o.ProjectSshKeys) { + toSerialize["project_ssh_keys"] = o.ProjectSshKeys + } + if !IsNil(o.PublicIpv4SubnetSize) { + toSerialize["public_ipv4_subnet_size"] = o.PublicIpv4SubnetSize + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.SpotPriceMax) { + toSerialize["spot_price_max"] = o.SpotPriceMax + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UserSshKeys) { + toSerialize["user_ssh_keys"] = o.UserSshKeys + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceCreateInMetroInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "operating_system", + "plan", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceCreateInMetroInput := _DeviceCreateInMetroInput{} + + err = json.Unmarshal(bytes, &varDeviceCreateInMetroInput) + + if err != nil { + return err + } + + *o = DeviceCreateInMetroInput(varDeviceCreateInMetroInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "metro") + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "features") + delete(additionalProperties, "hardware_reservation_id") + delete(additionalProperties, "hostname") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "locked") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "no_ssh_keys") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "project_ssh_keys") + delete(additionalProperties, "public_ipv4_subnet_size") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "spot_price_max") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "storage") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "user_ssh_keys") + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceCreateInMetroInput struct { + value *DeviceCreateInMetroInput + isSet bool +} + +func (v NullableDeviceCreateInMetroInput) Get() *DeviceCreateInMetroInput { + return v.value +} + +func (v *NullableDeviceCreateInMetroInput) Set(val *DeviceCreateInMetroInput) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceCreateInMetroInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceCreateInMetroInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceCreateInMetroInput(val *DeviceCreateInMetroInput) *NullableDeviceCreateInMetroInput { + return &NullableDeviceCreateInMetroInput{value: val, isSet: true} +} + +func (v NullableDeviceCreateInMetroInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceCreateInMetroInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_create_input.go b/services/metalv1/model_device_create_input.go new file mode 100644 index 00000000..f12c053c --- /dev/null +++ b/services/metalv1/model_device_create_input.go @@ -0,0 +1,1094 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceCreateInput{} + +// DeviceCreateInput struct for DeviceCreateInput +type DeviceCreateInput struct { + // When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *DeviceCreateInputBillingCycle `json:"billing_cycle,omitempty"` + // Customdata is an arbitrary JSON value that can be accessed via the metadata service. + Customdata map[string]interface{} `json:"customdata,omitempty"` + // Any description of the device or how it will be used. This may be used to inform other API consumers with project access. + Description *string `json:"description,omitempty"` + // The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. + Features []string `json:"features,omitempty"` + // The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + HardwareReservationId *string `json:"hardware_reservation_id,omitempty"` + // The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. + Hostname *string `json:"hostname,omitempty"` + // The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + IpAddresses []IPAddress `json:"ip_addresses,omitempty"` + // When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + // If true, this instance can not be converted to a different network type. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified + NoSshKeys *bool `json:"no_ssh_keys,omitempty"` + // The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. + OperatingSystem string `json:"operating_system"` + // The slug of the device plan to provision. + Plan string `json:"plan"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + // A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + ProjectSshKeys []string `json:"project_ssh_keys,omitempty"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. + PublicIpv4SubnetSize *int32 `json:"public_ipv4_subnet_size,omitempty"` + // Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + SpotInstance *bool `json:"spot_instance,omitempty"` + // The maximum amount to bid for a spot instance. + SpotPriceMax *float32 `json:"spot_price_max,omitempty"` + // A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. + SshKeys []SSHKeyInput `json:"ssh_keys,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Tags []string `json:"tags,omitempty"` + // When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. + TerminationTime *time.Time `json:"termination_time,omitempty"` + // A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + UserSshKeys []string `json:"user_ssh_keys,omitempty"` + // The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceCreateInput DeviceCreateInput + +// NewDeviceCreateInput instantiates a new DeviceCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceCreateInput(operatingSystem string, plan string) *DeviceCreateInput { + this := DeviceCreateInput{} + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + this.OperatingSystem = operatingSystem + this.Plan = plan + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// NewDeviceCreateInputWithDefaults instantiates a new DeviceCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceCreateInputWithDefaults() *DeviceCreateInput { + this := DeviceCreateInput{} + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *DeviceCreateInput) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetBillingCycle() DeviceCreateInputBillingCycle { + if o == nil || IsNil(o.BillingCycle) { + var ret DeviceCreateInputBillingCycle + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given DeviceCreateInputBillingCycle and assigns it to the BillingCycle field. +func (o *DeviceCreateInput) SetBillingCycle(v DeviceCreateInputBillingCycle) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *DeviceCreateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetFeatures() []string { + if o == nil || IsNil(o.Features) { + var ret []string + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetFeaturesOk() ([]string, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []string and assigns it to the Features field. +func (o *DeviceCreateInput) SetFeatures(v []string) { + o.Features = v +} + +// GetHardwareReservationId returns the HardwareReservationId field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetHardwareReservationId() string { + if o == nil || IsNil(o.HardwareReservationId) { + var ret string + return ret + } + return *o.HardwareReservationId +} + +// GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetHardwareReservationIdOk() (*string, bool) { + if o == nil || IsNil(o.HardwareReservationId) { + return nil, false + } + return o.HardwareReservationId, true +} + +// HasHardwareReservationId returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasHardwareReservationId() bool { + if o != nil && !IsNil(o.HardwareReservationId) { + return true + } + + return false +} + +// SetHardwareReservationId gets a reference to the given string and assigns it to the HardwareReservationId field. +func (o *DeviceCreateInput) SetHardwareReservationId(v string) { + o.HardwareReservationId = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *DeviceCreateInput) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetIpAddresses() []IPAddress { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAddress + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetIpAddressesOk() ([]IPAddress, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAddress and assigns it to the IpAddresses field. +func (o *DeviceCreateInput) SetIpAddresses(v []IPAddress) { + o.IpAddresses = v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *DeviceCreateInput) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *DeviceCreateInput) SetLocked(v bool) { + o.Locked = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *DeviceCreateInput) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetNoSshKeys returns the NoSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetNoSshKeys() bool { + if o == nil || IsNil(o.NoSshKeys) { + var ret bool + return ret + } + return *o.NoSshKeys +} + +// GetNoSshKeysOk returns a tuple with the NoSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetNoSshKeysOk() (*bool, bool) { + if o == nil || IsNil(o.NoSshKeys) { + return nil, false + } + return o.NoSshKeys, true +} + +// HasNoSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasNoSshKeys() bool { + if o != nil && !IsNil(o.NoSshKeys) { + return true + } + + return false +} + +// SetNoSshKeys gets a reference to the given bool and assigns it to the NoSshKeys field. +func (o *DeviceCreateInput) SetNoSshKeys(v bool) { + o.NoSshKeys = &v +} + +// GetOperatingSystem returns the OperatingSystem field value +func (o *DeviceCreateInput) GetOperatingSystem() string { + if o == nil { + var ret string + return ret + } + + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetOperatingSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OperatingSystem, true +} + +// SetOperatingSystem sets field value +func (o *DeviceCreateInput) SetOperatingSystem(v string) { + o.OperatingSystem = v +} + +// GetPlan returns the Plan field value +func (o *DeviceCreateInput) GetPlan() string { + if o == nil { + var ret string + return ret + } + + return o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetPlanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Plan, true +} + +// SetPlan sets field value +func (o *DeviceCreateInput) SetPlan(v string) { + o.Plan = v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *DeviceCreateInput) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetProjectSshKeys returns the ProjectSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetProjectSshKeys() []string { + if o == nil || IsNil(o.ProjectSshKeys) { + var ret []string + return ret + } + return o.ProjectSshKeys +} + +// GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetProjectSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectSshKeys) { + return nil, false + } + return o.ProjectSshKeys, true +} + +// HasProjectSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasProjectSshKeys() bool { + if o != nil && !IsNil(o.ProjectSshKeys) { + return true + } + + return false +} + +// SetProjectSshKeys gets a reference to the given []string and assigns it to the ProjectSshKeys field. +func (o *DeviceCreateInput) SetProjectSshKeys(v []string) { + o.ProjectSshKeys = v +} + +// GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetPublicIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PublicIpv4SubnetSize +} + +// GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetPublicIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + return nil, false + } + return o.PublicIpv4SubnetSize, true +} + +// HasPublicIpv4SubnetSize returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasPublicIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PublicIpv4SubnetSize) { + return true + } + + return false +} + +// SetPublicIpv4SubnetSize gets a reference to the given int32 and assigns it to the PublicIpv4SubnetSize field. +func (o *DeviceCreateInput) SetPublicIpv4SubnetSize(v int32) { + o.PublicIpv4SubnetSize = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *DeviceCreateInput) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetSpotPriceMax returns the SpotPriceMax field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetSpotPriceMax() float32 { + if o == nil || IsNil(o.SpotPriceMax) { + var ret float32 + return ret + } + return *o.SpotPriceMax +} + +// GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetSpotPriceMaxOk() (*float32, bool) { + if o == nil || IsNil(o.SpotPriceMax) { + return nil, false + } + return o.SpotPriceMax, true +} + +// HasSpotPriceMax returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasSpotPriceMax() bool { + if o != nil && !IsNil(o.SpotPriceMax) { + return true + } + + return false +} + +// SetSpotPriceMax gets a reference to the given float32 and assigns it to the SpotPriceMax field. +func (o *DeviceCreateInput) SetSpotPriceMax(v float32) { + o.SpotPriceMax = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetSshKeys() []SSHKeyInput { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKeyInput + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetSshKeysOk() ([]SSHKeyInput, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKeyInput and assigns it to the SshKeys field. +func (o *DeviceCreateInput) SetSshKeys(v []SSHKeyInput) { + o.SshKeys = v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *DeviceCreateInput) SetStorage(v Storage) { + o.Storage = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *DeviceCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *DeviceCreateInput) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUserSshKeys returns the UserSshKeys field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetUserSshKeys() []string { + if o == nil || IsNil(o.UserSshKeys) { + var ret []string + return ret + } + return o.UserSshKeys +} + +// GetUserSshKeysOk returns a tuple with the UserSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetUserSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.UserSshKeys) { + return nil, false + } + return o.UserSshKeys, true +} + +// HasUserSshKeys returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasUserSshKeys() bool { + if o != nil && !IsNil(o.UserSshKeys) { + return true + } + + return false +} + +// SetUserSshKeys gets a reference to the given []string and assigns it to the UserSshKeys field. +func (o *DeviceCreateInput) SetUserSshKeys(v []string) { + o.UserSshKeys = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *DeviceCreateInput) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreateInput) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *DeviceCreateInput) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *DeviceCreateInput) SetUserdata(v string) { + o.Userdata = &v +} + +func (o DeviceCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.HardwareReservationId) { + toSerialize["hardware_reservation_id"] = o.HardwareReservationId + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.NoSshKeys) { + toSerialize["no_ssh_keys"] = o.NoSshKeys + } + toSerialize["operating_system"] = o.OperatingSystem + toSerialize["plan"] = o.Plan + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + if !IsNil(o.ProjectSshKeys) { + toSerialize["project_ssh_keys"] = o.ProjectSshKeys + } + if !IsNil(o.PublicIpv4SubnetSize) { + toSerialize["public_ipv4_subnet_size"] = o.PublicIpv4SubnetSize + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.SpotPriceMax) { + toSerialize["spot_price_max"] = o.SpotPriceMax + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UserSshKeys) { + toSerialize["user_ssh_keys"] = o.UserSshKeys + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "operating_system", + "plan", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceCreateInput := _DeviceCreateInput{} + + err = json.Unmarshal(bytes, &varDeviceCreateInput) + + if err != nil { + return err + } + + *o = DeviceCreateInput(varDeviceCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "features") + delete(additionalProperties, "hardware_reservation_id") + delete(additionalProperties, "hostname") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "locked") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "no_ssh_keys") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "project_ssh_keys") + delete(additionalProperties, "public_ipv4_subnet_size") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "spot_price_max") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "storage") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "user_ssh_keys") + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceCreateInput struct { + value *DeviceCreateInput + isSet bool +} + +func (v NullableDeviceCreateInput) Get() *DeviceCreateInput { + return v.value +} + +func (v *NullableDeviceCreateInput) Set(val *DeviceCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceCreateInput(val *DeviceCreateInput) *NullableDeviceCreateInput { + return &NullableDeviceCreateInput{value: val, isSet: true} +} + +func (v NullableDeviceCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_create_input_billing_cycle.go b/services/metalv1/model_device_create_input_billing_cycle.go new file mode 100644 index 00000000..ae42ef76 --- /dev/null +++ b/services/metalv1/model_device_create_input_billing_cycle.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DeviceCreateInputBillingCycle The billing cycle of the device. +type DeviceCreateInputBillingCycle string + +// List of DeviceCreateInput_billing_cycle +const ( + DEVICECREATEINPUTBILLINGCYCLE_HOURLY DeviceCreateInputBillingCycle = "hourly" + DEVICECREATEINPUTBILLINGCYCLE_DAILY DeviceCreateInputBillingCycle = "daily" + DEVICECREATEINPUTBILLINGCYCLE_MONTHLY DeviceCreateInputBillingCycle = "monthly" + DEVICECREATEINPUTBILLINGCYCLE_YEARLY DeviceCreateInputBillingCycle = "yearly" +) + +// All allowed values of DeviceCreateInputBillingCycle enum +var AllowedDeviceCreateInputBillingCycleEnumValues = []DeviceCreateInputBillingCycle{ + "hourly", + "daily", + "monthly", + "yearly", +} + +func (v *DeviceCreateInputBillingCycle) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceCreateInputBillingCycle(value) + for _, existing := range AllowedDeviceCreateInputBillingCycleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceCreateInputBillingCycle", value) +} + +// NewDeviceCreateInputBillingCycleFromValue returns a pointer to a valid DeviceCreateInputBillingCycle +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceCreateInputBillingCycleFromValue(v string) (*DeviceCreateInputBillingCycle, error) { + ev := DeviceCreateInputBillingCycle(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceCreateInputBillingCycle: valid values are %v", v, AllowedDeviceCreateInputBillingCycleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceCreateInputBillingCycle) IsValid() bool { + for _, existing := range AllowedDeviceCreateInputBillingCycleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceCreateInput_billing_cycle value +func (v DeviceCreateInputBillingCycle) Ptr() *DeviceCreateInputBillingCycle { + return &v +} + +type NullableDeviceCreateInputBillingCycle struct { + value *DeviceCreateInputBillingCycle + isSet bool +} + +func (v NullableDeviceCreateInputBillingCycle) Get() *DeviceCreateInputBillingCycle { + return v.value +} + +func (v *NullableDeviceCreateInputBillingCycle) Set(val *DeviceCreateInputBillingCycle) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceCreateInputBillingCycle) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceCreateInputBillingCycle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceCreateInputBillingCycle(val *DeviceCreateInputBillingCycle) *NullableDeviceCreateInputBillingCycle { + return &NullableDeviceCreateInputBillingCycle{value: val, isSet: true} +} + +func (v NullableDeviceCreateInputBillingCycle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceCreateInputBillingCycle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_created_by.go b/services/metalv1/model_device_created_by.go new file mode 100644 index 00000000..5bee70cd --- /dev/null +++ b/services/metalv1/model_device_created_by.go @@ -0,0 +1,503 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceCreatedBy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceCreatedBy{} + +// DeviceCreatedBy struct for DeviceCreatedBy +type DeviceCreatedBy struct { + // Avatar thumbnail URL of the User + AvatarThumbUrl *string `json:"avatar_thumb_url,omitempty"` + // When the user was created + CreatedAt *time.Time `json:"created_at,omitempty"` + // Primary email address of the User + Email *string `json:"email,omitempty"` + // First name of the User + FirstName *string `json:"first_name,omitempty"` + // Full name of the User + FullName *string `json:"full_name,omitempty"` + // API URL uniquely representing the User + Href *string `json:"href,omitempty"` + // ID of the User + Id string `json:"id"` + // Last name of the User + LastName *string `json:"last_name,omitempty"` + // Short ID of the User + ShortId string `json:"short_id"` + // When the user details were last updated + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceCreatedBy DeviceCreatedBy + +// NewDeviceCreatedBy instantiates a new DeviceCreatedBy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceCreatedBy(id string, shortId string) *DeviceCreatedBy { + this := DeviceCreatedBy{} + this.Id = id + this.ShortId = shortId + return &this +} + +// NewDeviceCreatedByWithDefaults instantiates a new DeviceCreatedBy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceCreatedByWithDefaults() *DeviceCreatedBy { + this := DeviceCreatedBy{} + return &this +} + +// GetAvatarThumbUrl returns the AvatarThumbUrl field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetAvatarThumbUrl() string { + if o == nil || IsNil(o.AvatarThumbUrl) { + var ret string + return ret + } + return *o.AvatarThumbUrl +} + +// GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetAvatarThumbUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarThumbUrl) { + return nil, false + } + return o.AvatarThumbUrl, true +} + +// HasAvatarThumbUrl returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasAvatarThumbUrl() bool { + if o != nil && !IsNil(o.AvatarThumbUrl) { + return true + } + + return false +} + +// SetAvatarThumbUrl gets a reference to the given string and assigns it to the AvatarThumbUrl field. +func (o *DeviceCreatedBy) SetAvatarThumbUrl(v string) { + o.AvatarThumbUrl = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *DeviceCreatedBy) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *DeviceCreatedBy) SetEmail(v string) { + o.Email = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *DeviceCreatedBy) SetFirstName(v string) { + o.FirstName = &v +} + +// GetFullName returns the FullName field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetFullName() string { + if o == nil || IsNil(o.FullName) { + var ret string + return ret + } + return *o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetFullNameOk() (*string, bool) { + if o == nil || IsNil(o.FullName) { + return nil, false + } + return o.FullName, true +} + +// HasFullName returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasFullName() bool { + if o != nil && !IsNil(o.FullName) { + return true + } + + return false +} + +// SetFullName gets a reference to the given string and assigns it to the FullName field. +func (o *DeviceCreatedBy) SetFullName(v string) { + o.FullName = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *DeviceCreatedBy) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value +func (o *DeviceCreatedBy) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceCreatedBy) SetId(v string) { + o.Id = v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *DeviceCreatedBy) SetLastName(v string) { + o.LastName = &v +} + +// GetShortId returns the ShortId field value +func (o *DeviceCreatedBy) GetShortId() string { + if o == nil { + var ret string + return ret + } + + return o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetShortIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortId, true +} + +// SetShortId sets field value +func (o *DeviceCreatedBy) SetShortId(v string) { + o.ShortId = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *DeviceCreatedBy) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceCreatedBy) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *DeviceCreatedBy) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *DeviceCreatedBy) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o DeviceCreatedBy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceCreatedBy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvatarThumbUrl) { + toSerialize["avatar_thumb_url"] = o.AvatarThumbUrl + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.FullName) { + toSerialize["full_name"] = o.FullName + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + toSerialize["id"] = o.Id + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + toSerialize["short_id"] = o.ShortId + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceCreatedBy) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "short_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceCreatedBy := _DeviceCreatedBy{} + + err = json.Unmarshal(bytes, &varDeviceCreatedBy) + + if err != nil { + return err + } + + *o = DeviceCreatedBy(varDeviceCreatedBy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar_thumb_url") + delete(additionalProperties, "created_at") + delete(additionalProperties, "email") + delete(additionalProperties, "first_name") + delete(additionalProperties, "full_name") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "last_name") + delete(additionalProperties, "short_id") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceCreatedBy struct { + value *DeviceCreatedBy + isSet bool +} + +func (v NullableDeviceCreatedBy) Get() *DeviceCreatedBy { + return v.value +} + +func (v *NullableDeviceCreatedBy) Set(val *DeviceCreatedBy) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceCreatedBy) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceCreatedBy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceCreatedBy(val *DeviceCreatedBy) *NullableDeviceCreatedBy { + return &NullableDeviceCreatedBy{value: val, isSet: true} +} + +func (v NullableDeviceCreatedBy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceCreatedBy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_health_rollup.go b/services/metalv1/model_device_health_rollup.go new file mode 100644 index 00000000..6d0bcc7d --- /dev/null +++ b/services/metalv1/model_device_health_rollup.go @@ -0,0 +1,193 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the DeviceHealthRollup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceHealthRollup{} + +// DeviceHealthRollup Represents a Device Health Status +type DeviceHealthRollup struct { + HealthRollup *DeviceHealthRollupHealthRollup `json:"health_rollup,omitempty"` + // Last update of health status. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceHealthRollup DeviceHealthRollup + +// NewDeviceHealthRollup instantiates a new DeviceHealthRollup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceHealthRollup() *DeviceHealthRollup { + this := DeviceHealthRollup{} + return &this +} + +// NewDeviceHealthRollupWithDefaults instantiates a new DeviceHealthRollup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceHealthRollupWithDefaults() *DeviceHealthRollup { + this := DeviceHealthRollup{} + return &this +} + +// GetHealthRollup returns the HealthRollup field value if set, zero value otherwise. +func (o *DeviceHealthRollup) GetHealthRollup() DeviceHealthRollupHealthRollup { + if o == nil || IsNil(o.HealthRollup) { + var ret DeviceHealthRollupHealthRollup + return ret + } + return *o.HealthRollup +} + +// GetHealthRollupOk returns a tuple with the HealthRollup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceHealthRollup) GetHealthRollupOk() (*DeviceHealthRollupHealthRollup, bool) { + if o == nil || IsNil(o.HealthRollup) { + return nil, false + } + return o.HealthRollup, true +} + +// HasHealthRollup returns a boolean if a field has been set. +func (o *DeviceHealthRollup) HasHealthRollup() bool { + if o != nil && !IsNil(o.HealthRollup) { + return true + } + + return false +} + +// SetHealthRollup gets a reference to the given DeviceHealthRollupHealthRollup and assigns it to the HealthRollup field. +func (o *DeviceHealthRollup) SetHealthRollup(v DeviceHealthRollupHealthRollup) { + o.HealthRollup = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *DeviceHealthRollup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceHealthRollup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *DeviceHealthRollup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *DeviceHealthRollup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o DeviceHealthRollup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceHealthRollup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HealthRollup) { + toSerialize["health_rollup"] = o.HealthRollup + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceHealthRollup) UnmarshalJSON(bytes []byte) (err error) { + varDeviceHealthRollup := _DeviceHealthRollup{} + + err = json.Unmarshal(bytes, &varDeviceHealthRollup) + + if err != nil { + return err + } + + *o = DeviceHealthRollup(varDeviceHealthRollup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "health_rollup") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceHealthRollup struct { + value *DeviceHealthRollup + isSet bool +} + +func (v NullableDeviceHealthRollup) Get() *DeviceHealthRollup { + return v.value +} + +func (v *NullableDeviceHealthRollup) Set(val *DeviceHealthRollup) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceHealthRollup) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceHealthRollup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceHealthRollup(val *DeviceHealthRollup) *NullableDeviceHealthRollup { + return &NullableDeviceHealthRollup{value: val, isSet: true} +} + +func (v NullableDeviceHealthRollup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceHealthRollup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_health_rollup_health_rollup.go b/services/metalv1/model_device_health_rollup_health_rollup.go new file mode 100644 index 00000000..36569030 --- /dev/null +++ b/services/metalv1/model_device_health_rollup_health_rollup.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DeviceHealthRollupHealthRollup Health Status +type DeviceHealthRollupHealthRollup string + +// List of DeviceHealthRollup_health_rollup +const ( + DEVICEHEALTHROLLUPHEALTHROLLUP_OK DeviceHealthRollupHealthRollup = "ok" + DEVICEHEALTHROLLUPHEALTHROLLUP_WARNING DeviceHealthRollupHealthRollup = "warning" + DEVICEHEALTHROLLUPHEALTHROLLUP_CRITICAL DeviceHealthRollupHealthRollup = "critical" +) + +// All allowed values of DeviceHealthRollupHealthRollup enum +var AllowedDeviceHealthRollupHealthRollupEnumValues = []DeviceHealthRollupHealthRollup{ + "ok", + "warning", + "critical", +} + +func (v *DeviceHealthRollupHealthRollup) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceHealthRollupHealthRollup(value) + for _, existing := range AllowedDeviceHealthRollupHealthRollupEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceHealthRollupHealthRollup", value) +} + +// NewDeviceHealthRollupHealthRollupFromValue returns a pointer to a valid DeviceHealthRollupHealthRollup +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceHealthRollupHealthRollupFromValue(v string) (*DeviceHealthRollupHealthRollup, error) { + ev := DeviceHealthRollupHealthRollup(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceHealthRollupHealthRollup: valid values are %v", v, AllowedDeviceHealthRollupHealthRollupEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceHealthRollupHealthRollup) IsValid() bool { + for _, existing := range AllowedDeviceHealthRollupHealthRollupEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceHealthRollup_health_rollup value +func (v DeviceHealthRollupHealthRollup) Ptr() *DeviceHealthRollupHealthRollup { + return &v +} + +type NullableDeviceHealthRollupHealthRollup struct { + value *DeviceHealthRollupHealthRollup + isSet bool +} + +func (v NullableDeviceHealthRollupHealthRollup) Get() *DeviceHealthRollupHealthRollup { + return v.value +} + +func (v *NullableDeviceHealthRollupHealthRollup) Set(val *DeviceHealthRollupHealthRollup) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceHealthRollupHealthRollup) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceHealthRollupHealthRollup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceHealthRollupHealthRollup(val *DeviceHealthRollupHealthRollup) *NullableDeviceHealthRollupHealthRollup { + return &NullableDeviceHealthRollupHealthRollup{value: val, isSet: true} +} + +func (v NullableDeviceHealthRollupHealthRollup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceHealthRollupHealthRollup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_list.go b/services/metalv1/model_device_list.go new file mode 100644 index 00000000..11c93c97 --- /dev/null +++ b/services/metalv1/model_device_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceList{} + +// DeviceList struct for DeviceList +type DeviceList struct { + Devices []Device `json:"devices,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceList DeviceList + +// NewDeviceList instantiates a new DeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceList() *DeviceList { + this := DeviceList{} + return &this +} + +// NewDeviceListWithDefaults instantiates a new DeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceListWithDefaults() *DeviceList { + this := DeviceList{} + return &this +} + +// GetDevices returns the Devices field value if set, zero value otherwise. +func (o *DeviceList) GetDevices() []Device { + if o == nil || IsNil(o.Devices) { + var ret []Device + return ret + } + return o.Devices +} + +// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceList) GetDevicesOk() ([]Device, bool) { + if o == nil || IsNil(o.Devices) { + return nil, false + } + return o.Devices, true +} + +// HasDevices returns a boolean if a field has been set. +func (o *DeviceList) HasDevices() bool { + if o != nil && !IsNil(o.Devices) { + return true + } + + return false +} + +// SetDevices gets a reference to the given []Device and assigns it to the Devices field. +func (o *DeviceList) SetDevices(v []Device) { + o.Devices = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *DeviceList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *DeviceList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *DeviceList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o DeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Devices) { + toSerialize["devices"] = o.Devices + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceList) UnmarshalJSON(bytes []byte) (err error) { + varDeviceList := _DeviceList{} + + err = json.Unmarshal(bytes, &varDeviceList) + + if err != nil { + return err + } + + *o = DeviceList(varDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "devices") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceList struct { + value *DeviceList + isSet bool +} + +func (v NullableDeviceList) Get() *DeviceList { + return v.value +} + +func (v *NullableDeviceList) Set(val *DeviceList) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceList(val *DeviceList) *NullableDeviceList { + return &NullableDeviceList{value: val, isSet: true} +} + +func (v NullableDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_metro.go b/services/metalv1/model_device_metro.go new file mode 100644 index 00000000..8fa27b61 --- /dev/null +++ b/services/metalv1/model_device_metro.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceMetro type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceMetro{} + +// DeviceMetro struct for DeviceMetro +type DeviceMetro struct { + Code *string `json:"code,omitempty"` + Country *string `json:"country,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceMetro DeviceMetro + +// NewDeviceMetro instantiates a new DeviceMetro object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceMetro() *DeviceMetro { + this := DeviceMetro{} + return &this +} + +// NewDeviceMetroWithDefaults instantiates a new DeviceMetro object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceMetroWithDefaults() *DeviceMetro { + this := DeviceMetro{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *DeviceMetro) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceMetro) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *DeviceMetro) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *DeviceMetro) SetCode(v string) { + o.Code = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *DeviceMetro) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceMetro) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *DeviceMetro) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *DeviceMetro) SetCountry(v string) { + o.Country = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DeviceMetro) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceMetro) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DeviceMetro) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DeviceMetro) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceMetro) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceMetro) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceMetro) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceMetro) SetName(v string) { + o.Name = &v +} + +func (o DeviceMetro) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceMetro) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceMetro) UnmarshalJSON(bytes []byte) (err error) { + varDeviceMetro := _DeviceMetro{} + + err = json.Unmarshal(bytes, &varDeviceMetro) + + if err != nil { + return err + } + + *o = DeviceMetro(varDeviceMetro) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "country") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceMetro struct { + value *DeviceMetro + isSet bool +} + +func (v NullableDeviceMetro) Get() *DeviceMetro { + return v.value +} + +func (v *NullableDeviceMetro) Set(val *DeviceMetro) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceMetro) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceMetro) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceMetro(val *DeviceMetro) *NullableDeviceMetro { + return &NullableDeviceMetro{value: val, isSet: true} +} + +func (v NullableDeviceMetro) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceMetro) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_project_lite.go b/services/metalv1/model_device_project_lite.go new file mode 100644 index 00000000..f536e7d5 --- /dev/null +++ b/services/metalv1/model_device_project_lite.go @@ -0,0 +1,167 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceProjectLite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceProjectLite{} + +// DeviceProjectLite struct for DeviceProjectLite +type DeviceProjectLite struct { + Href string `json:"href"` + AdditionalProperties map[string]interface{} +} + +type _DeviceProjectLite DeviceProjectLite + +// NewDeviceProjectLite instantiates a new DeviceProjectLite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceProjectLite(href string) *DeviceProjectLite { + this := DeviceProjectLite{} + this.Href = href + return &this +} + +// NewDeviceProjectLiteWithDefaults instantiates a new DeviceProjectLite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceProjectLiteWithDefaults() *DeviceProjectLite { + this := DeviceProjectLite{} + return &this +} + +// GetHref returns the Href field value +func (o *DeviceProjectLite) GetHref() string { + if o == nil { + var ret string + return ret + } + + return o.Href +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +func (o *DeviceProjectLite) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Href, true +} + +// SetHref sets field value +func (o *DeviceProjectLite) SetHref(v string) { + o.Href = v +} + +func (o DeviceProjectLite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceProjectLite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["href"] = o.Href + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceProjectLite) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "href", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceProjectLite := _DeviceProjectLite{} + + err = json.Unmarshal(bytes, &varDeviceProjectLite) + + if err != nil { + return err + } + + *o = DeviceProjectLite(varDeviceProjectLite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "href") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceProjectLite struct { + value *DeviceProjectLite + isSet bool +} + +func (v NullableDeviceProjectLite) Get() *DeviceProjectLite { + return v.value +} + +func (v *NullableDeviceProjectLite) Set(val *DeviceProjectLite) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceProjectLite) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceProjectLite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceProjectLite(val *DeviceProjectLite) *NullableDeviceProjectLite { + return &NullableDeviceProjectLite{value: val, isSet: true} +} + +func (v NullableDeviceProjectLite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceProjectLite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_state.go b/services/metalv1/model_device_state.go new file mode 100644 index 00000000..4184a792 --- /dev/null +++ b/services/metalv1/model_device_state.go @@ -0,0 +1,127 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// DeviceState The current state the instance is in. * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. * Once provisioning has begun on the instance it's state will move to `provisioning`. * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. * If an instance fails to provision or deprovision it will move to `failed` state. * Once an instance has completed provisioning it will move to `active` state. * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. * When the instance is powered off completely it will move to the `inactive` state. * When an instance is powered on completely it will move to the `active` state. * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. * When the reinstall action is complete the instance will move to `active` state. +type DeviceState string + +// List of Device_state +const ( + DEVICESTATE_QUEUED DeviceState = "queued" + DEVICESTATE_PROVISIONING DeviceState = "provisioning" + DEVICESTATE_DEPROVISIONING DeviceState = "deprovisioning" + DEVICESTATE_REINSTALLING DeviceState = "reinstalling" + DEVICESTATE_ACTIVE DeviceState = "active" + DEVICESTATE_INACTIVE DeviceState = "inactive" + DEVICESTATE_FAILED DeviceState = "failed" + DEVICESTATE_POWERING_ON DeviceState = "powering_on" + DEVICESTATE_POWERING_OFF DeviceState = "powering_off" + DEVICESTATE_DELETED DeviceState = "deleted" +) + +// All allowed values of DeviceState enum +var AllowedDeviceStateEnumValues = []DeviceState{ + "queued", + "provisioning", + "deprovisioning", + "reinstalling", + "active", + "inactive", + "failed", + "powering_on", + "powering_off", + "deleted", +} + +func (v *DeviceState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceState(value) + for _, existing := range AllowedDeviceStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceState", value) +} + +// NewDeviceStateFromValue returns a pointer to a valid DeviceState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceStateFromValue(v string) (*DeviceState, error) { + ev := DeviceState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceState: valid values are %v", v, AllowedDeviceStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceState) IsValid() bool { + for _, existing := range AllowedDeviceStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Device_state value +func (v DeviceState) Ptr() *DeviceState { + return &v +} + +type NullableDeviceState struct { + value *DeviceState + isSet bool +} + +func (v NullableDeviceState) Get() *DeviceState { + return v.value +} + +func (v *NullableDeviceState) Set(val *DeviceState) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceState) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceState(val *DeviceState) *NullableDeviceState { + return &NullableDeviceState{value: val, isSet: true} +} + +func (v NullableDeviceState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_update_input.go b/services/metalv1/model_device_update_input.go new file mode 100644 index 00000000..6b4e21ec --- /dev/null +++ b/services/metalv1/model_device_update_input.go @@ -0,0 +1,564 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUpdateInput{} + +// DeviceUpdateInput struct for DeviceUpdateInput +type DeviceUpdateInput struct { + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *string `json:"billing_cycle,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Description *string `json:"description,omitempty"` + Hostname *string `json:"hostname,omitempty"` + FirmwareSetId *string `json:"firmware_set_id,omitempty"` + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + // If true, this instance can not be converted to a different network type. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // Can be set to false to convert a spot-market instance to on-demand. + SpotInstance *bool `json:"spot_instance,omitempty"` + Tags []string `json:"tags,omitempty"` + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUpdateInput DeviceUpdateInput + +// NewDeviceUpdateInput instantiates a new DeviceUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUpdateInput() *DeviceUpdateInput { + this := DeviceUpdateInput{} + return &this +} + +// NewDeviceUpdateInputWithDefaults instantiates a new DeviceUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUpdateInputWithDefaults() *DeviceUpdateInput { + this := DeviceUpdateInput{} + return &this +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *DeviceUpdateInput) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetBillingCycle() string { + if o == nil || IsNil(o.BillingCycle) { + var ret string + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetBillingCycleOk() (*string, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given string and assigns it to the BillingCycle field. +func (o *DeviceUpdateInput) SetBillingCycle(v string) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *DeviceUpdateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *DeviceUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *DeviceUpdateInput) SetHostname(v string) { + o.Hostname = &v +} + +// GetFirmwareSetId returns the FirmwareSetId field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetFirmwareSetId() string { + if o == nil || IsNil(o.FirmwareSetId) { + var ret string + return ret + } + return *o.FirmwareSetId +} + +// GetFirmwareSetIdOk returns a tuple with the FirmwareSetId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetFirmwareSetIdOk() (*string, bool) { + if o == nil || IsNil(o.FirmwareSetId) { + return nil, false + } + return o.FirmwareSetId, true +} + +// HasFirmwareSetId returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasFirmwareSetId() bool { + if o != nil && !IsNil(o.FirmwareSetId) { + return true + } + + return false +} + +// SetFirmwareSetId gets a reference to the given string and assigns it to the FirmwareSetId field. +func (o *DeviceUpdateInput) SetFirmwareSetId(v string) { + o.FirmwareSetId = &v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *DeviceUpdateInput) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *DeviceUpdateInput) SetLocked(v bool) { + o.Locked = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *DeviceUpdateInput) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *DeviceUpdateInput) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *DeviceUpdateInput) SetTags(v []string) { + o.Tags = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *DeviceUpdateInput) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUpdateInput) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *DeviceUpdateInput) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *DeviceUpdateInput) SetUserdata(v string) { + o.Userdata = &v +} + +func (o DeviceUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.FirmwareSetId) { + toSerialize["firmware_set_id"] = o.FirmwareSetId + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varDeviceUpdateInput := _DeviceUpdateInput{} + + err = json.Unmarshal(bytes, &varDeviceUpdateInput) + + if err != nil { + return err + } + + *o = DeviceUpdateInput(varDeviceUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "hostname") + delete(additionalProperties, "firmware_set_id") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "locked") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "tags") + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUpdateInput struct { + value *DeviceUpdateInput + isSet bool +} + +func (v NullableDeviceUpdateInput) Get() *DeviceUpdateInput { + return v.value +} + +func (v *NullableDeviceUpdateInput) Set(val *DeviceUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUpdateInput(val *DeviceUpdateInput) *NullableDeviceUpdateInput { + return &NullableDeviceUpdateInput{value: val, isSet: true} +} + +func (v NullableDeviceUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_usage.go b/services/metalv1/model_device_usage.go new file mode 100644 index 00000000..9188e383 --- /dev/null +++ b/services/metalv1/model_device_usage.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUsage{} + +// DeviceUsage struct for DeviceUsage +type DeviceUsage struct { + Quantity *string `json:"quantity,omitempty"` + Total *string `json:"total,omitempty"` + Unit *string `json:"unit,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUsage DeviceUsage + +// NewDeviceUsage instantiates a new DeviceUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUsage() *DeviceUsage { + this := DeviceUsage{} + return &this +} + +// NewDeviceUsageWithDefaults instantiates a new DeviceUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUsageWithDefaults() *DeviceUsage { + this := DeviceUsage{} + return &this +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *DeviceUsage) GetQuantity() string { + if o == nil || IsNil(o.Quantity) { + var ret string + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUsage) GetQuantityOk() (*string, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *DeviceUsage) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given string and assigns it to the Quantity field. +func (o *DeviceUsage) SetQuantity(v string) { + o.Quantity = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *DeviceUsage) GetTotal() string { + if o == nil || IsNil(o.Total) { + var ret string + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUsage) GetTotalOk() (*string, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *DeviceUsage) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *DeviceUsage) SetTotal(v string) { + o.Total = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *DeviceUsage) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUsage) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *DeviceUsage) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *DeviceUsage) SetUnit(v string) { + o.Unit = &v +} + +func (o DeviceUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUsage) UnmarshalJSON(bytes []byte) (err error) { + varDeviceUsage := _DeviceUsage{} + + err = json.Unmarshal(bytes, &varDeviceUsage) + + if err != nil { + return err + } + + *o = DeviceUsage(varDeviceUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "quantity") + delete(additionalProperties, "total") + delete(additionalProperties, "unit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUsage struct { + value *DeviceUsage + isSet bool +} + +func (v NullableDeviceUsage) Get() *DeviceUsage { + return v.value +} + +func (v *NullableDeviceUsage) Set(val *DeviceUsage) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUsage(val *DeviceUsage) *NullableDeviceUsage { + return &NullableDeviceUsage{value: val, isSet: true} +} + +func (v NullableDeviceUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_device_usage_list.go b/services/metalv1/model_device_usage_list.go new file mode 100644 index 00000000..c6d2d041 --- /dev/null +++ b/services/metalv1/model_device_usage_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the DeviceUsageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUsageList{} + +// DeviceUsageList struct for DeviceUsageList +type DeviceUsageList struct { + Usages []DeviceUsage `json:"usages,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUsageList DeviceUsageList + +// NewDeviceUsageList instantiates a new DeviceUsageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUsageList() *DeviceUsageList { + this := DeviceUsageList{} + return &this +} + +// NewDeviceUsageListWithDefaults instantiates a new DeviceUsageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUsageListWithDefaults() *DeviceUsageList { + this := DeviceUsageList{} + return &this +} + +// GetUsages returns the Usages field value if set, zero value otherwise. +func (o *DeviceUsageList) GetUsages() []DeviceUsage { + if o == nil || IsNil(o.Usages) { + var ret []DeviceUsage + return ret + } + return o.Usages +} + +// GetUsagesOk returns a tuple with the Usages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUsageList) GetUsagesOk() ([]DeviceUsage, bool) { + if o == nil || IsNil(o.Usages) { + return nil, false + } + return o.Usages, true +} + +// HasUsages returns a boolean if a field has been set. +func (o *DeviceUsageList) HasUsages() bool { + if o != nil && !IsNil(o.Usages) { + return true + } + + return false +} + +// SetUsages gets a reference to the given []DeviceUsage and assigns it to the Usages field. +func (o *DeviceUsageList) SetUsages(v []DeviceUsage) { + o.Usages = v +} + +func (o DeviceUsageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUsageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Usages) { + toSerialize["usages"] = o.Usages + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUsageList) UnmarshalJSON(bytes []byte) (err error) { + varDeviceUsageList := _DeviceUsageList{} + + err = json.Unmarshal(bytes, &varDeviceUsageList) + + if err != nil { + return err + } + + *o = DeviceUsageList(varDeviceUsageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "usages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUsageList struct { + value *DeviceUsageList + isSet bool +} + +func (v NullableDeviceUsageList) Get() *DeviceUsageList { + return v.value +} + +func (v *NullableDeviceUsageList) Set(val *DeviceUsageList) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUsageList) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUsageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUsageList(val *DeviceUsageList) *NullableDeviceUsageList { + return &NullableDeviceUsageList{value: val, isSet: true} +} + +func (v NullableDeviceUsageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUsageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_disk.go b/services/metalv1/model_disk.go new file mode 100644 index 00000000..7f0186f5 --- /dev/null +++ b/services/metalv1/model_disk.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Disk type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Disk{} + +// Disk struct for Disk +type Disk struct { + Device *string `json:"device,omitempty"` + WipeTable *bool `json:"wipeTable,omitempty"` + Partitions []Partition `json:"partitions,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Disk Disk + +// NewDisk instantiates a new Disk object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDisk() *Disk { + this := Disk{} + return &this +} + +// NewDiskWithDefaults instantiates a new Disk object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiskWithDefaults() *Disk { + this := Disk{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *Disk) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *Disk) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *Disk) SetDevice(v string) { + o.Device = &v +} + +// GetWipeTable returns the WipeTable field value if set, zero value otherwise. +func (o *Disk) GetWipeTable() bool { + if o == nil || IsNil(o.WipeTable) { + var ret bool + return ret + } + return *o.WipeTable +} + +// GetWipeTableOk returns a tuple with the WipeTable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetWipeTableOk() (*bool, bool) { + if o == nil || IsNil(o.WipeTable) { + return nil, false + } + return o.WipeTable, true +} + +// HasWipeTable returns a boolean if a field has been set. +func (o *Disk) HasWipeTable() bool { + if o != nil && !IsNil(o.WipeTable) { + return true + } + + return false +} + +// SetWipeTable gets a reference to the given bool and assigns it to the WipeTable field. +func (o *Disk) SetWipeTable(v bool) { + o.WipeTable = &v +} + +// GetPartitions returns the Partitions field value if set, zero value otherwise. +func (o *Disk) GetPartitions() []Partition { + if o == nil || IsNil(o.Partitions) { + var ret []Partition + return ret + } + return o.Partitions +} + +// GetPartitionsOk returns a tuple with the Partitions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetPartitionsOk() ([]Partition, bool) { + if o == nil || IsNil(o.Partitions) { + return nil, false + } + return o.Partitions, true +} + +// HasPartitions returns a boolean if a field has been set. +func (o *Disk) HasPartitions() bool { + if o != nil && !IsNil(o.Partitions) { + return true + } + + return false +} + +// SetPartitions gets a reference to the given []Partition and assigns it to the Partitions field. +func (o *Disk) SetPartitions(v []Partition) { + o.Partitions = v +} + +func (o Disk) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Disk) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.WipeTable) { + toSerialize["wipeTable"] = o.WipeTable + } + if !IsNil(o.Partitions) { + toSerialize["partitions"] = o.Partitions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Disk) UnmarshalJSON(bytes []byte) (err error) { + varDisk := _Disk{} + + err = json.Unmarshal(bytes, &varDisk) + + if err != nil { + return err + } + + *o = Disk(varDisk) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "wipeTable") + delete(additionalProperties, "partitions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDisk struct { + value *Disk + isSet bool +} + +func (v NullableDisk) Get() *Disk { + return v.value +} + +func (v *NullableDisk) Set(val *Disk) { + v.value = val + v.isSet = true +} + +func (v NullableDisk) IsSet() bool { + return v.isSet +} + +func (v *NullableDisk) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDisk(val *Disk) *NullableDisk { + return &NullableDisk{value: val, isSet: true} +} + +func (v NullableDisk) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDisk) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_email.go b/services/metalv1/model_email.go new file mode 100644 index 00000000..78e129f2 --- /dev/null +++ b/services/metalv1/model_email.go @@ -0,0 +1,302 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Email type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Email{} + +// Email struct for Email +type Email struct { + Address *string `json:"address,omitempty"` + Default *bool `json:"default,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Verified *bool `json:"verified,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Email Email + +// NewEmail instantiates a new Email object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmail() *Email { + this := Email{} + return &this +} + +// NewEmailWithDefaults instantiates a new Email object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailWithDefaults() *Email { + this := Email{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Email) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Email) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Email) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *Email) SetAddress(v string) { + o.Address = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *Email) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Email) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *Email) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *Email) SetDefault(v bool) { + o.Default = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Email) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Email) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Email) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Email) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Email) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Email) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Email) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Email) SetId(v string) { + o.Id = &v +} + +// GetVerified returns the Verified field value if set, zero value otherwise. +func (o *Email) GetVerified() bool { + if o == nil || IsNil(o.Verified) { + var ret bool + return ret + } + return *o.Verified +} + +// GetVerifiedOk returns a tuple with the Verified field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Email) GetVerifiedOk() (*bool, bool) { + if o == nil || IsNil(o.Verified) { + return nil, false + } + return o.Verified, true +} + +// HasVerified returns a boolean if a field has been set. +func (o *Email) HasVerified() bool { + if o != nil && !IsNil(o.Verified) { + return true + } + + return false +} + +// SetVerified gets a reference to the given bool and assigns it to the Verified field. +func (o *Email) SetVerified(v bool) { + o.Verified = &v +} + +func (o Email) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Email) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Verified) { + toSerialize["verified"] = o.Verified + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Email) UnmarshalJSON(bytes []byte) (err error) { + varEmail := _Email{} + + err = json.Unmarshal(bytes, &varEmail) + + if err != nil { + return err + } + + *o = Email(varEmail) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "default") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "verified") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmail struct { + value *Email + isSet bool +} + +func (v NullableEmail) Get() *Email { + return v.value +} + +func (v *NullableEmail) Set(val *Email) { + v.value = val + v.isSet = true +} + +func (v NullableEmail) IsSet() bool { + return v.isSet +} + +func (v *NullableEmail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmail(val *Email) *NullableEmail { + return &NullableEmail{value: val, isSet: true} +} + +func (v NullableEmail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_email_input.go b/services/metalv1/model_email_input.go new file mode 100644 index 00000000..a28b0255 --- /dev/null +++ b/services/metalv1/model_email_input.go @@ -0,0 +1,204 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the EmailInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailInput{} + +// EmailInput struct for EmailInput +type EmailInput struct { + Address string `json:"address"` + Default *bool `json:"default,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EmailInput EmailInput + +// NewEmailInput instantiates a new EmailInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailInput(address string) *EmailInput { + this := EmailInput{} + this.Address = address + return &this +} + +// NewEmailInputWithDefaults instantiates a new EmailInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailInputWithDefaults() *EmailInput { + this := EmailInput{} + return &this +} + +// GetAddress returns the Address field value +func (o *EmailInput) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *EmailInput) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *EmailInput) SetAddress(v string) { + o.Address = v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *EmailInput) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailInput) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *EmailInput) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *EmailInput) SetDefault(v bool) { + o.Default = &v +} + +func (o EmailInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEmailInput := _EmailInput{} + + err = json.Unmarshal(bytes, &varEmailInput) + + if err != nil { + return err + } + + *o = EmailInput(varEmailInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "default") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailInput struct { + value *EmailInput + isSet bool +} + +func (v NullableEmailInput) Get() *EmailInput { + return v.value +} + +func (v *NullableEmailInput) Set(val *EmailInput) { + v.value = val + v.isSet = true +} + +func (v NullableEmailInput) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailInput(val *EmailInput) *NullableEmailInput { + return &NullableEmailInput{value: val, isSet: true} +} + +func (v NullableEmailInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_entitlement.go b/services/metalv1/model_entitlement.go new file mode 100644 index 00000000..ad198674 --- /dev/null +++ b/services/metalv1/model_entitlement.go @@ -0,0 +1,562 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the Entitlement type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Entitlement{} + +// Entitlement struct for Entitlement +type Entitlement struct { + Description *string `json:"description,omitempty"` + FeatureAccess map[string]interface{} `json:"feature_access,omitempty"` + Href *string `json:"href,omitempty"` + Id string `json:"id"` + InstanceQuota map[string]interface{} `json:"instance_quota,omitempty"` + IpQuota map[string]interface{} `json:"ip_quota,omitempty"` + Name *string `json:"name,omitempty"` + ProjectQuota *int32 `json:"project_quota,omitempty"` + Slug string `json:"slug"` + VolumeLimits map[string]interface{} `json:"volume_limits,omitempty"` + VolumeQuota map[string]interface{} `json:"volume_quota,omitempty"` + Weight int32 `json:"weight"` + AdditionalProperties map[string]interface{} +} + +type _Entitlement Entitlement + +// NewEntitlement instantiates a new Entitlement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEntitlement(id string, slug string, weight int32) *Entitlement { + this := Entitlement{} + this.Id = id + var projectQuota int32 = 0 + this.ProjectQuota = &projectQuota + this.Slug = slug + this.Weight = weight + return &this +} + +// NewEntitlementWithDefaults instantiates a new Entitlement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEntitlementWithDefaults() *Entitlement { + this := Entitlement{} + var projectQuota int32 = 0 + this.ProjectQuota = &projectQuota + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Entitlement) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Entitlement) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Entitlement) SetDescription(v string) { + o.Description = &v +} + +// GetFeatureAccess returns the FeatureAccess field value if set, zero value otherwise. +func (o *Entitlement) GetFeatureAccess() map[string]interface{} { + if o == nil || IsNil(o.FeatureAccess) { + var ret map[string]interface{} + return ret + } + return o.FeatureAccess +} + +// GetFeatureAccessOk returns a tuple with the FeatureAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetFeatureAccessOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FeatureAccess) { + return map[string]interface{}{}, false + } + return o.FeatureAccess, true +} + +// HasFeatureAccess returns a boolean if a field has been set. +func (o *Entitlement) HasFeatureAccess() bool { + if o != nil && !IsNil(o.FeatureAccess) { + return true + } + + return false +} + +// SetFeatureAccess gets a reference to the given map[string]interface{} and assigns it to the FeatureAccess field. +func (o *Entitlement) SetFeatureAccess(v map[string]interface{}) { + o.FeatureAccess = v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Entitlement) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Entitlement) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Entitlement) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value +func (o *Entitlement) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Entitlement) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Entitlement) SetId(v string) { + o.Id = v +} + +// GetInstanceQuota returns the InstanceQuota field value if set, zero value otherwise. +func (o *Entitlement) GetInstanceQuota() map[string]interface{} { + if o == nil || IsNil(o.InstanceQuota) { + var ret map[string]interface{} + return ret + } + return o.InstanceQuota +} + +// GetInstanceQuotaOk returns a tuple with the InstanceQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetInstanceQuotaOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.InstanceQuota) { + return map[string]interface{}{}, false + } + return o.InstanceQuota, true +} + +// HasInstanceQuota returns a boolean if a field has been set. +func (o *Entitlement) HasInstanceQuota() bool { + if o != nil && !IsNil(o.InstanceQuota) { + return true + } + + return false +} + +// SetInstanceQuota gets a reference to the given map[string]interface{} and assigns it to the InstanceQuota field. +func (o *Entitlement) SetInstanceQuota(v map[string]interface{}) { + o.InstanceQuota = v +} + +// GetIpQuota returns the IpQuota field value if set, zero value otherwise. +func (o *Entitlement) GetIpQuota() map[string]interface{} { + if o == nil || IsNil(o.IpQuota) { + var ret map[string]interface{} + return ret + } + return o.IpQuota +} + +// GetIpQuotaOk returns a tuple with the IpQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetIpQuotaOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.IpQuota) { + return map[string]interface{}{}, false + } + return o.IpQuota, true +} + +// HasIpQuota returns a boolean if a field has been set. +func (o *Entitlement) HasIpQuota() bool { + if o != nil && !IsNil(o.IpQuota) { + return true + } + + return false +} + +// SetIpQuota gets a reference to the given map[string]interface{} and assigns it to the IpQuota field. +func (o *Entitlement) SetIpQuota(v map[string]interface{}) { + o.IpQuota = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Entitlement) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Entitlement) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Entitlement) SetName(v string) { + o.Name = &v +} + +// GetProjectQuota returns the ProjectQuota field value if set, zero value otherwise. +func (o *Entitlement) GetProjectQuota() int32 { + if o == nil || IsNil(o.ProjectQuota) { + var ret int32 + return ret + } + return *o.ProjectQuota +} + +// GetProjectQuotaOk returns a tuple with the ProjectQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetProjectQuotaOk() (*int32, bool) { + if o == nil || IsNil(o.ProjectQuota) { + return nil, false + } + return o.ProjectQuota, true +} + +// HasProjectQuota returns a boolean if a field has been set. +func (o *Entitlement) HasProjectQuota() bool { + if o != nil && !IsNil(o.ProjectQuota) { + return true + } + + return false +} + +// SetProjectQuota gets a reference to the given int32 and assigns it to the ProjectQuota field. +func (o *Entitlement) SetProjectQuota(v int32) { + o.ProjectQuota = &v +} + +// GetSlug returns the Slug field value +func (o *Entitlement) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Entitlement) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Entitlement) SetSlug(v string) { + o.Slug = v +} + +// GetVolumeLimits returns the VolumeLimits field value if set, zero value otherwise. +func (o *Entitlement) GetVolumeLimits() map[string]interface{} { + if o == nil || IsNil(o.VolumeLimits) { + var ret map[string]interface{} + return ret + } + return o.VolumeLimits +} + +// GetVolumeLimitsOk returns a tuple with the VolumeLimits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetVolumeLimitsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.VolumeLimits) { + return map[string]interface{}{}, false + } + return o.VolumeLimits, true +} + +// HasVolumeLimits returns a boolean if a field has been set. +func (o *Entitlement) HasVolumeLimits() bool { + if o != nil && !IsNil(o.VolumeLimits) { + return true + } + + return false +} + +// SetVolumeLimits gets a reference to the given map[string]interface{} and assigns it to the VolumeLimits field. +func (o *Entitlement) SetVolumeLimits(v map[string]interface{}) { + o.VolumeLimits = v +} + +// GetVolumeQuota returns the VolumeQuota field value if set, zero value otherwise. +func (o *Entitlement) GetVolumeQuota() map[string]interface{} { + if o == nil || IsNil(o.VolumeQuota) { + var ret map[string]interface{} + return ret + } + return o.VolumeQuota +} + +// GetVolumeQuotaOk returns a tuple with the VolumeQuota field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Entitlement) GetVolumeQuotaOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.VolumeQuota) { + return map[string]interface{}{}, false + } + return o.VolumeQuota, true +} + +// HasVolumeQuota returns a boolean if a field has been set. +func (o *Entitlement) HasVolumeQuota() bool { + if o != nil && !IsNil(o.VolumeQuota) { + return true + } + + return false +} + +// SetVolumeQuota gets a reference to the given map[string]interface{} and assigns it to the VolumeQuota field. +func (o *Entitlement) SetVolumeQuota(v map[string]interface{}) { + o.VolumeQuota = v +} + +// GetWeight returns the Weight field value +func (o *Entitlement) GetWeight() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Weight +} + +// GetWeightOk returns a tuple with the Weight field value +// and a boolean to check if the value has been set. +func (o *Entitlement) GetWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Weight, true +} + +// SetWeight sets field value +func (o *Entitlement) SetWeight(v int32) { + o.Weight = v +} + +func (o Entitlement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Entitlement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.FeatureAccess) { + toSerialize["feature_access"] = o.FeatureAccess + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + toSerialize["id"] = o.Id + if !IsNil(o.InstanceQuota) { + toSerialize["instance_quota"] = o.InstanceQuota + } + if !IsNil(o.IpQuota) { + toSerialize["ip_quota"] = o.IpQuota + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ProjectQuota) { + toSerialize["project_quota"] = o.ProjectQuota + } + toSerialize["slug"] = o.Slug + if !IsNil(o.VolumeLimits) { + toSerialize["volume_limits"] = o.VolumeLimits + } + if !IsNil(o.VolumeQuota) { + toSerialize["volume_quota"] = o.VolumeQuota + } + toSerialize["weight"] = o.Weight + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Entitlement) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "slug", + "weight", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEntitlement := _Entitlement{} + + err = json.Unmarshal(bytes, &varEntitlement) + + if err != nil { + return err + } + + *o = Entitlement(varEntitlement) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "feature_access") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "instance_quota") + delete(additionalProperties, "ip_quota") + delete(additionalProperties, "name") + delete(additionalProperties, "project_quota") + delete(additionalProperties, "slug") + delete(additionalProperties, "volume_limits") + delete(additionalProperties, "volume_quota") + delete(additionalProperties, "weight") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEntitlement struct { + value *Entitlement + isSet bool +} + +func (v NullableEntitlement) Get() *Entitlement { + return v.value +} + +func (v *NullableEntitlement) Set(val *Entitlement) { + v.value = val + v.isSet = true +} + +func (v NullableEntitlement) IsSet() bool { + return v.isSet +} + +func (v *NullableEntitlement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEntitlement(val *Entitlement) *NullableEntitlement { + return &NullableEntitlement{value: val, isSet: true} +} + +func (v NullableEntitlement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEntitlement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_error.go b/services/metalv1/model_error.go new file mode 100644 index 00000000..048b31c4 --- /dev/null +++ b/services/metalv1/model_error.go @@ -0,0 +1,193 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error Error responses are included with 4xx and 5xx HTTP responses from the API service. Either \"error\" or \"errors\" will be set. +type Error struct { + // A description of the error that caused the request to fail. + Error *string `json:"error,omitempty"` + // A list of errors that contributed to the request failing. + Errors []string `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError() *Error { + this := Error{} + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *Error) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *Error) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *Error) SetError(v string) { + o.Error = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Error) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Error) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *Error) SetErrors(v []string) { + o.Errors = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(bytes []byte) (err error) { + varError := _Error{} + + err = json.Unmarshal(bytes, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "error") + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_event.go b/services/metalv1/model_event.go new file mode 100644 index 00000000..a9edcdab --- /dev/null +++ b/services/metalv1/model_event.go @@ -0,0 +1,488 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Event type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Event{} + +// Event struct for Event +type Event struct { + Body *string `json:"body,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Interpolated *string `json:"interpolated,omitempty"` + Relationships []Href `json:"relationships,omitempty"` + State *string `json:"state,omitempty"` + Type *string `json:"type,omitempty"` + ModifiedBy map[string]interface{} `json:"modified_by,omitempty"` + Ip *string `json:"ip,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Event Event + +// NewEvent instantiates a new Event object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEvent() *Event { + this := Event{} + return &this +} + +// NewEventWithDefaults instantiates a new Event object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventWithDefaults() *Event { + this := Event{} + return &this +} + +// GetBody returns the Body field value if set, zero value otherwise. +func (o *Event) GetBody() string { + if o == nil || IsNil(o.Body) { + var ret string + return ret + } + return *o.Body +} + +// GetBodyOk returns a tuple with the Body field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetBodyOk() (*string, bool) { + if o == nil || IsNil(o.Body) { + return nil, false + } + return o.Body, true +} + +// HasBody returns a boolean if a field has been set. +func (o *Event) HasBody() bool { + if o != nil && !IsNil(o.Body) { + return true + } + + return false +} + +// SetBody gets a reference to the given string and assigns it to the Body field. +func (o *Event) SetBody(v string) { + o.Body = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Event) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Event) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Event) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Event) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Event) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Event) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Event) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Event) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Event) SetId(v string) { + o.Id = &v +} + +// GetInterpolated returns the Interpolated field value if set, zero value otherwise. +func (o *Event) GetInterpolated() string { + if o == nil || IsNil(o.Interpolated) { + var ret string + return ret + } + return *o.Interpolated +} + +// GetInterpolatedOk returns a tuple with the Interpolated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetInterpolatedOk() (*string, bool) { + if o == nil || IsNil(o.Interpolated) { + return nil, false + } + return o.Interpolated, true +} + +// HasInterpolated returns a boolean if a field has been set. +func (o *Event) HasInterpolated() bool { + if o != nil && !IsNil(o.Interpolated) { + return true + } + + return false +} + +// SetInterpolated gets a reference to the given string and assigns it to the Interpolated field. +func (o *Event) SetInterpolated(v string) { + o.Interpolated = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *Event) GetRelationships() []Href { + if o == nil || IsNil(o.Relationships) { + var ret []Href + return ret + } + return o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetRelationshipsOk() ([]Href, bool) { + if o == nil || IsNil(o.Relationships) { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *Event) HasRelationships() bool { + if o != nil && !IsNil(o.Relationships) { + return true + } + + return false +} + +// SetRelationships gets a reference to the given []Href and assigns it to the Relationships field. +func (o *Event) SetRelationships(v []Href) { + o.Relationships = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Event) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Event) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *Event) SetState(v string) { + o.State = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Event) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Event) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *Event) SetType(v string) { + o.Type = &v +} + +// GetModifiedBy returns the ModifiedBy field value if set, zero value otherwise. +func (o *Event) GetModifiedBy() map[string]interface{} { + if o == nil || IsNil(o.ModifiedBy) { + var ret map[string]interface{} + return ret + } + return o.ModifiedBy +} + +// GetModifiedByOk returns a tuple with the ModifiedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetModifiedByOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ModifiedBy) { + return map[string]interface{}{}, false + } + return o.ModifiedBy, true +} + +// HasModifiedBy returns a boolean if a field has been set. +func (o *Event) HasModifiedBy() bool { + if o != nil && !IsNil(o.ModifiedBy) { + return true + } + + return false +} + +// SetModifiedBy gets a reference to the given map[string]interface{} and assigns it to the ModifiedBy field. +func (o *Event) SetModifiedBy(v map[string]interface{}) { + o.ModifiedBy = v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *Event) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *Event) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *Event) SetIp(v string) { + o.Ip = &v +} + +func (o Event) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Event) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Body) { + toSerialize["body"] = o.Body + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Interpolated) { + toSerialize["interpolated"] = o.Interpolated + } + if !IsNil(o.Relationships) { + toSerialize["relationships"] = o.Relationships + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.ModifiedBy) { + toSerialize["modified_by"] = o.ModifiedBy + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Event) UnmarshalJSON(bytes []byte) (err error) { + varEvent := _Event{} + + err = json.Unmarshal(bytes, &varEvent) + + if err != nil { + return err + } + + *o = Event(varEvent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "body") + delete(additionalProperties, "created_at") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "interpolated") + delete(additionalProperties, "relationships") + delete(additionalProperties, "state") + delete(additionalProperties, "type") + delete(additionalProperties, "modified_by") + delete(additionalProperties, "ip") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEvent struct { + value *Event + isSet bool +} + +func (v NullableEvent) Get() *Event { + return v.value +} + +func (v *NullableEvent) Set(val *Event) { + v.value = val + v.isSet = true +} + +func (v NullableEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvent(val *Event) *NullableEvent { + return &NullableEvent{value: val, isSet: true} +} + +func (v NullableEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_event_list.go b/services/metalv1/model_event_list.go new file mode 100644 index 00000000..43199085 --- /dev/null +++ b/services/metalv1/model_event_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the EventList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventList{} + +// EventList struct for EventList +type EventList struct { + Events []Event `json:"events,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventList EventList + +// NewEventList instantiates a new EventList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventList() *EventList { + this := EventList{} + return &this +} + +// NewEventListWithDefaults instantiates a new EventList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventListWithDefaults() *EventList { + this := EventList{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *EventList) GetEvents() []Event { + if o == nil || IsNil(o.Events) { + var ret []Event + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventList) GetEventsOk() ([]Event, bool) { + if o == nil || IsNil(o.Events) { + return nil, false + } + return o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *EventList) HasEvents() bool { + if o != nil && !IsNil(o.Events) { + return true + } + + return false +} + +// SetEvents gets a reference to the given []Event and assigns it to the Events field. +func (o *EventList) SetEvents(v []Event) { + o.Events = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *EventList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *EventList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *EventList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o EventList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Events) { + toSerialize["events"] = o.Events + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventList) UnmarshalJSON(bytes []byte) (err error) { + varEventList := _EventList{} + + err = json.Unmarshal(bytes, &varEventList) + + if err != nil { + return err + } + + *o = EventList(varEventList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "events") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventList struct { + value *EventList + isSet bool +} + +func (v NullableEventList) Get() *EventList { + return v.value +} + +func (v *NullableEventList) Set(val *EventList) { + v.value = val + v.isSet = true +} + +func (v NullableEventList) IsSet() bool { + return v.isSet +} + +func (v *NullableEventList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventList(val *EventList) *NullableEventList { + return &NullableEventList{value: val, isSet: true} +} + +func (v NullableEventList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_fabric_service_token.go b/services/metalv1/model_fabric_service_token.go new file mode 100644 index 00000000..57046446 --- /dev/null +++ b/services/metalv1/model_fabric_service_token.go @@ -0,0 +1,343 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the FabricServiceToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FabricServiceToken{} + +// FabricServiceToken struct for FabricServiceToken +type FabricServiceToken struct { + // The expiration date and time of the Fabric service token. Once a service token is expired, it is no longer redeemable. + ExpiresAt *time.Time `json:"expires_at,omitempty"` + // The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or Virtual Device to Equinix Metal. + Id *string `json:"id,omitempty"` + // The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs (Fabric Billed), this will default to 10Gbps. + MaxAllowedSpeed *int32 `json:"max_allowed_speed,omitempty"` + Role *FabricServiceTokenRole `json:"role,omitempty"` + ServiceTokenType *FabricServiceTokenServiceTokenType `json:"service_token_type,omitempty"` + State *FabricServiceTokenState `json:"state,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FabricServiceToken FabricServiceToken + +// NewFabricServiceToken instantiates a new FabricServiceToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFabricServiceToken() *FabricServiceToken { + this := FabricServiceToken{} + return &this +} + +// NewFabricServiceTokenWithDefaults instantiates a new FabricServiceToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFabricServiceTokenWithDefaults() *FabricServiceToken { + this := FabricServiceToken{} + return &this +} + +// GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise. +func (o *FabricServiceToken) GetExpiresAt() time.Time { + if o == nil || IsNil(o.ExpiresAt) { + var ret time.Time + return ret + } + return *o.ExpiresAt +} + +// GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetExpiresAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExpiresAt) { + return nil, false + } + return o.ExpiresAt, true +} + +// HasExpiresAt returns a boolean if a field has been set. +func (o *FabricServiceToken) HasExpiresAt() bool { + if o != nil && !IsNil(o.ExpiresAt) { + return true + } + + return false +} + +// SetExpiresAt gets a reference to the given time.Time and assigns it to the ExpiresAt field. +func (o *FabricServiceToken) SetExpiresAt(v time.Time) { + o.ExpiresAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *FabricServiceToken) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *FabricServiceToken) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *FabricServiceToken) SetId(v string) { + o.Id = &v +} + +// GetMaxAllowedSpeed returns the MaxAllowedSpeed field value if set, zero value otherwise. +func (o *FabricServiceToken) GetMaxAllowedSpeed() int32 { + if o == nil || IsNil(o.MaxAllowedSpeed) { + var ret int32 + return ret + } + return *o.MaxAllowedSpeed +} + +// GetMaxAllowedSpeedOk returns a tuple with the MaxAllowedSpeed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetMaxAllowedSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.MaxAllowedSpeed) { + return nil, false + } + return o.MaxAllowedSpeed, true +} + +// HasMaxAllowedSpeed returns a boolean if a field has been set. +func (o *FabricServiceToken) HasMaxAllowedSpeed() bool { + if o != nil && !IsNil(o.MaxAllowedSpeed) { + return true + } + + return false +} + +// SetMaxAllowedSpeed gets a reference to the given int32 and assigns it to the MaxAllowedSpeed field. +func (o *FabricServiceToken) SetMaxAllowedSpeed(v int32) { + o.MaxAllowedSpeed = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *FabricServiceToken) GetRole() FabricServiceTokenRole { + if o == nil || IsNil(o.Role) { + var ret FabricServiceTokenRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetRoleOk() (*FabricServiceTokenRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *FabricServiceToken) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given FabricServiceTokenRole and assigns it to the Role field. +func (o *FabricServiceToken) SetRole(v FabricServiceTokenRole) { + o.Role = &v +} + +// GetServiceTokenType returns the ServiceTokenType field value if set, zero value otherwise. +func (o *FabricServiceToken) GetServiceTokenType() FabricServiceTokenServiceTokenType { + if o == nil || IsNil(o.ServiceTokenType) { + var ret FabricServiceTokenServiceTokenType + return ret + } + return *o.ServiceTokenType +} + +// GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetServiceTokenTypeOk() (*FabricServiceTokenServiceTokenType, bool) { + if o == nil || IsNil(o.ServiceTokenType) { + return nil, false + } + return o.ServiceTokenType, true +} + +// HasServiceTokenType returns a boolean if a field has been set. +func (o *FabricServiceToken) HasServiceTokenType() bool { + if o != nil && !IsNil(o.ServiceTokenType) { + return true + } + + return false +} + +// SetServiceTokenType gets a reference to the given FabricServiceTokenServiceTokenType and assigns it to the ServiceTokenType field. +func (o *FabricServiceToken) SetServiceTokenType(v FabricServiceTokenServiceTokenType) { + o.ServiceTokenType = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *FabricServiceToken) GetState() FabricServiceTokenState { + if o == nil || IsNil(o.State) { + var ret FabricServiceTokenState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FabricServiceToken) GetStateOk() (*FabricServiceTokenState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *FabricServiceToken) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given FabricServiceTokenState and assigns it to the State field. +func (o *FabricServiceToken) SetState(v FabricServiceTokenState) { + o.State = &v +} + +func (o FabricServiceToken) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FabricServiceToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ExpiresAt) { + toSerialize["expires_at"] = o.ExpiresAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.MaxAllowedSpeed) { + toSerialize["max_allowed_speed"] = o.MaxAllowedSpeed + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.ServiceTokenType) { + toSerialize["service_token_type"] = o.ServiceTokenType + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FabricServiceToken) UnmarshalJSON(bytes []byte) (err error) { + varFabricServiceToken := _FabricServiceToken{} + + err = json.Unmarshal(bytes, &varFabricServiceToken) + + if err != nil { + return err + } + + *o = FabricServiceToken(varFabricServiceToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "expires_at") + delete(additionalProperties, "id") + delete(additionalProperties, "max_allowed_speed") + delete(additionalProperties, "role") + delete(additionalProperties, "service_token_type") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFabricServiceToken struct { + value *FabricServiceToken + isSet bool +} + +func (v NullableFabricServiceToken) Get() *FabricServiceToken { + return v.value +} + +func (v *NullableFabricServiceToken) Set(val *FabricServiceToken) { + v.value = val + v.isSet = true +} + +func (v NullableFabricServiceToken) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricServiceToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricServiceToken(val *FabricServiceToken) *NullableFabricServiceToken { + return &NullableFabricServiceToken{value: val, isSet: true} +} + +func (v NullableFabricServiceToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricServiceToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_fabric_service_token_role.go b/services/metalv1/model_fabric_service_token_role.go new file mode 100644 index 00000000..859d5e43 --- /dev/null +++ b/services/metalv1/model_fabric_service_token_role.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FabricServiceTokenRole Either primary or secondary, depending on which interconnection the service token is associated to. +type FabricServiceTokenRole string + +// List of FabricServiceToken_role +const ( + FABRICSERVICETOKENROLE_PRIMARY FabricServiceTokenRole = "primary" + FABRICSERVICETOKENROLE_SECONDARY FabricServiceTokenRole = "secondary" +) + +// All allowed values of FabricServiceTokenRole enum +var AllowedFabricServiceTokenRoleEnumValues = []FabricServiceTokenRole{ + "primary", + "secondary", +} + +func (v *FabricServiceTokenRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricServiceTokenRole(value) + for _, existing := range AllowedFabricServiceTokenRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricServiceTokenRole", value) +} + +// NewFabricServiceTokenRoleFromValue returns a pointer to a valid FabricServiceTokenRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricServiceTokenRoleFromValue(v string) (*FabricServiceTokenRole, error) { + ev := FabricServiceTokenRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricServiceTokenRole: valid values are %v", v, AllowedFabricServiceTokenRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricServiceTokenRole) IsValid() bool { + for _, existing := range AllowedFabricServiceTokenRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricServiceToken_role value +func (v FabricServiceTokenRole) Ptr() *FabricServiceTokenRole { + return &v +} + +type NullableFabricServiceTokenRole struct { + value *FabricServiceTokenRole + isSet bool +} + +func (v NullableFabricServiceTokenRole) Get() *FabricServiceTokenRole { + return v.value +} + +func (v *NullableFabricServiceTokenRole) Set(val *FabricServiceTokenRole) { + v.value = val + v.isSet = true +} + +func (v NullableFabricServiceTokenRole) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricServiceTokenRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricServiceTokenRole(val *FabricServiceTokenRole) *NullableFabricServiceTokenRole { + return &NullableFabricServiceTokenRole{value: val, isSet: true} +} + +func (v NullableFabricServiceTokenRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricServiceTokenRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_fabric_service_token_service_token_type.go b/services/metalv1/model_fabric_service_token_service_token_type.go new file mode 100644 index 00000000..af7474b8 --- /dev/null +++ b/services/metalv1/model_fabric_service_token_service_token_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FabricServiceTokenServiceTokenType Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested. +type FabricServiceTokenServiceTokenType string + +// List of FabricServiceToken_service_token_type +const ( + FABRICSERVICETOKENSERVICETOKENTYPE_A_SIDE FabricServiceTokenServiceTokenType = "a_side" + FABRICSERVICETOKENSERVICETOKENTYPE_Z_SIDE FabricServiceTokenServiceTokenType = "z_side" +) + +// All allowed values of FabricServiceTokenServiceTokenType enum +var AllowedFabricServiceTokenServiceTokenTypeEnumValues = []FabricServiceTokenServiceTokenType{ + "a_side", + "z_side", +} + +func (v *FabricServiceTokenServiceTokenType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricServiceTokenServiceTokenType(value) + for _, existing := range AllowedFabricServiceTokenServiceTokenTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricServiceTokenServiceTokenType", value) +} + +// NewFabricServiceTokenServiceTokenTypeFromValue returns a pointer to a valid FabricServiceTokenServiceTokenType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricServiceTokenServiceTokenTypeFromValue(v string) (*FabricServiceTokenServiceTokenType, error) { + ev := FabricServiceTokenServiceTokenType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricServiceTokenServiceTokenType: valid values are %v", v, AllowedFabricServiceTokenServiceTokenTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricServiceTokenServiceTokenType) IsValid() bool { + for _, existing := range AllowedFabricServiceTokenServiceTokenTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricServiceToken_service_token_type value +func (v FabricServiceTokenServiceTokenType) Ptr() *FabricServiceTokenServiceTokenType { + return &v +} + +type NullableFabricServiceTokenServiceTokenType struct { + value *FabricServiceTokenServiceTokenType + isSet bool +} + +func (v NullableFabricServiceTokenServiceTokenType) Get() *FabricServiceTokenServiceTokenType { + return v.value +} + +func (v *NullableFabricServiceTokenServiceTokenType) Set(val *FabricServiceTokenServiceTokenType) { + v.value = val + v.isSet = true +} + +func (v NullableFabricServiceTokenServiceTokenType) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricServiceTokenServiceTokenType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricServiceTokenServiceTokenType(val *FabricServiceTokenServiceTokenType) *NullableFabricServiceTokenServiceTokenType { + return &NullableFabricServiceTokenServiceTokenType{value: val, isSet: true} +} + +func (v NullableFabricServiceTokenServiceTokenType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricServiceTokenServiceTokenType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_fabric_service_token_state.go b/services/metalv1/model_fabric_service_token_state.go new file mode 100644 index 00000000..935da44c --- /dev/null +++ b/services/metalv1/model_fabric_service_token_state.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FabricServiceTokenState The state of the service token that corresponds with the service token state on Fabric. An 'inactive' state refers to a token that has not been redeemed yet on the Fabric side, an 'active' state refers to a token that has already been redeemed, and an 'expired' state refers to a token that has reached its expiry time. +type FabricServiceTokenState string + +// List of FabricServiceToken_state +const ( + FABRICSERVICETOKENSTATE_INACTIVE FabricServiceTokenState = "inactive" + FABRICSERVICETOKENSTATE_ACTIVE FabricServiceTokenState = "active" + FABRICSERVICETOKENSTATE_EXPIRED FabricServiceTokenState = "expired" +) + +// All allowed values of FabricServiceTokenState enum +var AllowedFabricServiceTokenStateEnumValues = []FabricServiceTokenState{ + "inactive", + "active", + "expired", +} + +func (v *FabricServiceTokenState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FabricServiceTokenState(value) + for _, existing := range AllowedFabricServiceTokenStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FabricServiceTokenState", value) +} + +// NewFabricServiceTokenStateFromValue returns a pointer to a valid FabricServiceTokenState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFabricServiceTokenStateFromValue(v string) (*FabricServiceTokenState, error) { + ev := FabricServiceTokenState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FabricServiceTokenState: valid values are %v", v, AllowedFabricServiceTokenStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FabricServiceTokenState) IsValid() bool { + for _, existing := range AllowedFabricServiceTokenStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FabricServiceToken_state value +func (v FabricServiceTokenState) Ptr() *FabricServiceTokenState { + return &v +} + +type NullableFabricServiceTokenState struct { + value *FabricServiceTokenState + isSet bool +} + +func (v NullableFabricServiceTokenState) Get() *FabricServiceTokenState { + return v.value +} + +func (v *NullableFabricServiceTokenState) Set(val *FabricServiceTokenState) { + v.value = val + v.isSet = true +} + +func (v NullableFabricServiceTokenState) IsSet() bool { + return v.isSet +} + +func (v *NullableFabricServiceTokenState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFabricServiceTokenState(val *FabricServiceTokenState) *NullableFabricServiceTokenState { + return &NullableFabricServiceTokenState{value: val, isSet: true} +} + +func (v NullableFabricServiceTokenState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFabricServiceTokenState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_facility.go b/services/metalv1/model_facility.go new file mode 100644 index 00000000..1393bb5f --- /dev/null +++ b/services/metalv1/model_facility.go @@ -0,0 +1,377 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Facility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Facility{} + +// Facility struct for Facility +type Facility struct { + Address *Address `json:"address,omitempty"` + Code *string `json:"code,omitempty"` + Features []FacilityFeaturesInner `json:"features,omitempty"` + Id *string `json:"id,omitempty"` + // IP ranges registered in facility. Can be used for GeoIP location + IpRanges []string `json:"ip_ranges,omitempty"` + Metro *DeviceMetro `json:"metro,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Facility Facility + +// NewFacility instantiates a new Facility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFacility() *Facility { + this := Facility{} + return &this +} + +// NewFacilityWithDefaults instantiates a new Facility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFacilityWithDefaults() *Facility { + this := Facility{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Facility) GetAddress() Address { + if o == nil || IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetAddressOk() (*Address, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Facility) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *Facility) SetAddress(v Address) { + o.Address = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Facility) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Facility) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *Facility) SetCode(v string) { + o.Code = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *Facility) GetFeatures() []FacilityFeaturesInner { + if o == nil || IsNil(o.Features) { + var ret []FacilityFeaturesInner + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetFeaturesOk() ([]FacilityFeaturesInner, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *Facility) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []FacilityFeaturesInner and assigns it to the Features field. +func (o *Facility) SetFeatures(v []FacilityFeaturesInner) { + o.Features = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Facility) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Facility) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Facility) SetId(v string) { + o.Id = &v +} + +// GetIpRanges returns the IpRanges field value if set, zero value otherwise. +func (o *Facility) GetIpRanges() []string { + if o == nil || IsNil(o.IpRanges) { + var ret []string + return ret + } + return o.IpRanges +} + +// GetIpRangesOk returns a tuple with the IpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetIpRangesOk() ([]string, bool) { + if o == nil || IsNil(o.IpRanges) { + return nil, false + } + return o.IpRanges, true +} + +// HasIpRanges returns a boolean if a field has been set. +func (o *Facility) HasIpRanges() bool { + if o != nil && !IsNil(o.IpRanges) { + return true + } + + return false +} + +// SetIpRanges gets a reference to the given []string and assigns it to the IpRanges field. +func (o *Facility) SetIpRanges(v []string) { + o.IpRanges = v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *Facility) GetMetro() DeviceMetro { + if o == nil || IsNil(o.Metro) { + var ret DeviceMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetMetroOk() (*DeviceMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *Facility) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given DeviceMetro and assigns it to the Metro field. +func (o *Facility) SetMetro(v DeviceMetro) { + o.Metro = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Facility) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Facility) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Facility) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Facility) SetName(v string) { + o.Name = &v +} + +func (o Facility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Facility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRanges) { + toSerialize["ip_ranges"] = o.IpRanges + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Facility) UnmarshalJSON(bytes []byte) (err error) { + varFacility := _Facility{} + + err = json.Unmarshal(bytes, &varFacility) + + if err != nil { + return err + } + + *o = Facility(varFacility) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "code") + delete(additionalProperties, "features") + delete(additionalProperties, "id") + delete(additionalProperties, "ip_ranges") + delete(additionalProperties, "metro") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFacility struct { + value *Facility + isSet bool +} + +func (v NullableFacility) Get() *Facility { + return v.value +} + +func (v *NullableFacility) Set(val *Facility) { + v.value = val + v.isSet = true +} + +func (v NullableFacility) IsSet() bool { + return v.isSet +} + +func (v *NullableFacility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFacility(val *Facility) *NullableFacility { + return &NullableFacility{value: val, isSet: true} +} + +func (v NullableFacility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFacility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_facility_features_inner.go b/services/metalv1/model_facility_features_inner.go new file mode 100644 index 00000000..e10b9d08 --- /dev/null +++ b/services/metalv1/model_facility_features_inner.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FacilityFeaturesInner the model 'FacilityFeaturesInner' +type FacilityFeaturesInner string + +// List of Facility_features_inner +const ( + FACILITYFEATURESINNER_BAREMETAL FacilityFeaturesInner = "baremetal" + FACILITYFEATURESINNER_BACKEND_TRANSFER FacilityFeaturesInner = "backend_transfer" + FACILITYFEATURESINNER_LAYER_2 FacilityFeaturesInner = "layer_2" + FACILITYFEATURESINNER_GLOBAL_IPV4 FacilityFeaturesInner = "global_ipv4" + FACILITYFEATURESINNER_IBX FacilityFeaturesInner = "ibx" +) + +// All allowed values of FacilityFeaturesInner enum +var AllowedFacilityFeaturesInnerEnumValues = []FacilityFeaturesInner{ + "baremetal", + "backend_transfer", + "layer_2", + "global_ipv4", + "ibx", +} + +func (v *FacilityFeaturesInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FacilityFeaturesInner(value) + for _, existing := range AllowedFacilityFeaturesInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FacilityFeaturesInner", value) +} + +// NewFacilityFeaturesInnerFromValue returns a pointer to a valid FacilityFeaturesInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFacilityFeaturesInnerFromValue(v string) (*FacilityFeaturesInner, error) { + ev := FacilityFeaturesInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FacilityFeaturesInner: valid values are %v", v, AllowedFacilityFeaturesInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FacilityFeaturesInner) IsValid() bool { + for _, existing := range AllowedFacilityFeaturesInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Facility_features_inner value +func (v FacilityFeaturesInner) Ptr() *FacilityFeaturesInner { + return &v +} + +type NullableFacilityFeaturesInner struct { + value *FacilityFeaturesInner + isSet bool +} + +func (v NullableFacilityFeaturesInner) Get() *FacilityFeaturesInner { + return v.value +} + +func (v *NullableFacilityFeaturesInner) Set(val *FacilityFeaturesInner) { + v.value = val + v.isSet = true +} + +func (v NullableFacilityFeaturesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableFacilityFeaturesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFacilityFeaturesInner(val *FacilityFeaturesInner) *NullableFacilityFeaturesInner { + return &NullableFacilityFeaturesInner{value: val, isSet: true} +} + +func (v NullableFacilityFeaturesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFacilityFeaturesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_facility_input.go b/services/metalv1/model_facility_input.go new file mode 100644 index 00000000..30db4ba7 --- /dev/null +++ b/services/metalv1/model_facility_input.go @@ -0,0 +1,172 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the FacilityInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FacilityInput{} + +// FacilityInput struct for FacilityInput +type FacilityInput struct { + // The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + // Deprecated + Facility []string `json:"facility"` + AdditionalProperties map[string]interface{} +} + +type _FacilityInput FacilityInput + +// NewFacilityInput instantiates a new FacilityInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFacilityInput(facility []string) *FacilityInput { + this := FacilityInput{} + this.Facility = facility + return &this +} + +// NewFacilityInputWithDefaults instantiates a new FacilityInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFacilityInputWithDefaults() *FacilityInput { + this := FacilityInput{} + return &this +} + +// GetFacility returns the Facility field value +// Deprecated +func (o *FacilityInput) GetFacility() []string { + if o == nil { + var ret []string + return ret + } + + return o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *FacilityInput) GetFacilityOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Facility, true +} + +// SetFacility sets field value +// Deprecated +func (o *FacilityInput) SetFacility(v []string) { + o.Facility = v +} + +func (o FacilityInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FacilityInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["facility"] = o.Facility + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FacilityInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "facility", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFacilityInput := _FacilityInput{} + + err = json.Unmarshal(bytes, &varFacilityInput) + + if err != nil { + return err + } + + *o = FacilityInput(varFacilityInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "facility") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFacilityInput struct { + value *FacilityInput + isSet bool +} + +func (v NullableFacilityInput) Get() *FacilityInput { + return v.value +} + +func (v *NullableFacilityInput) Set(val *FacilityInput) { + v.value = val + v.isSet = true +} + +func (v NullableFacilityInput) IsSet() bool { + return v.isSet +} + +func (v *NullableFacilityInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFacilityInput(val *FacilityInput) *NullableFacilityInput { + return &NullableFacilityInput{value: val, isSet: true} +} + +func (v NullableFacilityInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFacilityInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_facility_list.go b/services/metalv1/model_facility_list.go new file mode 100644 index 00000000..957b720d --- /dev/null +++ b/services/metalv1/model_facility_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the FacilityList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FacilityList{} + +// FacilityList struct for FacilityList +type FacilityList struct { + Facilities []Facility `json:"facilities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FacilityList FacilityList + +// NewFacilityList instantiates a new FacilityList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFacilityList() *FacilityList { + this := FacilityList{} + return &this +} + +// NewFacilityListWithDefaults instantiates a new FacilityList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFacilityListWithDefaults() *FacilityList { + this := FacilityList{} + return &this +} + +// GetFacilities returns the Facilities field value if set, zero value otherwise. +func (o *FacilityList) GetFacilities() []Facility { + if o == nil || IsNil(o.Facilities) { + var ret []Facility + return ret + } + return o.Facilities +} + +// GetFacilitiesOk returns a tuple with the Facilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FacilityList) GetFacilitiesOk() ([]Facility, bool) { + if o == nil || IsNil(o.Facilities) { + return nil, false + } + return o.Facilities, true +} + +// HasFacilities returns a boolean if a field has been set. +func (o *FacilityList) HasFacilities() bool { + if o != nil && !IsNil(o.Facilities) { + return true + } + + return false +} + +// SetFacilities gets a reference to the given []Facility and assigns it to the Facilities field. +func (o *FacilityList) SetFacilities(v []Facility) { + o.Facilities = v +} + +func (o FacilityList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FacilityList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Facilities) { + toSerialize["facilities"] = o.Facilities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FacilityList) UnmarshalJSON(bytes []byte) (err error) { + varFacilityList := _FacilityList{} + + err = json.Unmarshal(bytes, &varFacilityList) + + if err != nil { + return err + } + + *o = FacilityList(varFacilityList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "facilities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFacilityList struct { + value *FacilityList + isSet bool +} + +func (v NullableFacilityList) Get() *FacilityList { + return v.value +} + +func (v *NullableFacilityList) Set(val *FacilityList) { + v.value = val + v.isSet = true +} + +func (v NullableFacilityList) IsSet() bool { + return v.isSet +} + +func (v *NullableFacilityList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFacilityList(val *FacilityList) *NullableFacilityList { + return &NullableFacilityList{value: val, isSet: true} +} + +func (v NullableFacilityList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFacilityList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_filesystem.go b/services/metalv1/model_filesystem.go new file mode 100644 index 00000000..fcbee177 --- /dev/null +++ b/services/metalv1/model_filesystem.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Filesystem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Filesystem{} + +// Filesystem struct for Filesystem +type Filesystem struct { + Mount *Mount `json:"mount,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Filesystem Filesystem + +// NewFilesystem instantiates a new Filesystem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFilesystem() *Filesystem { + this := Filesystem{} + return &this +} + +// NewFilesystemWithDefaults instantiates a new Filesystem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFilesystemWithDefaults() *Filesystem { + this := Filesystem{} + return &this +} + +// GetMount returns the Mount field value if set, zero value otherwise. +func (o *Filesystem) GetMount() Mount { + if o == nil || IsNil(o.Mount) { + var ret Mount + return ret + } + return *o.Mount +} + +// GetMountOk returns a tuple with the Mount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Filesystem) GetMountOk() (*Mount, bool) { + if o == nil || IsNil(o.Mount) { + return nil, false + } + return o.Mount, true +} + +// HasMount returns a boolean if a field has been set. +func (o *Filesystem) HasMount() bool { + if o != nil && !IsNil(o.Mount) { + return true + } + + return false +} + +// SetMount gets a reference to the given Mount and assigns it to the Mount field. +func (o *Filesystem) SetMount(v Mount) { + o.Mount = &v +} + +func (o Filesystem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Filesystem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mount) { + toSerialize["mount"] = o.Mount + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Filesystem) UnmarshalJSON(bytes []byte) (err error) { + varFilesystem := _Filesystem{} + + err = json.Unmarshal(bytes, &varFilesystem) + + if err != nil { + return err + } + + *o = Filesystem(varFilesystem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "mount") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFilesystem struct { + value *Filesystem + isSet bool +} + +func (v NullableFilesystem) Get() *Filesystem { + return v.value +} + +func (v *NullableFilesystem) Set(val *Filesystem) { + v.value = val + v.isSet = true +} + +func (v NullableFilesystem) IsSet() bool { + return v.isSet +} + +func (v *NullableFilesystem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFilesystem(val *Filesystem) *NullableFilesystem { + return &NullableFilesystem{value: val, isSet: true} +} + +func (v NullableFilesystem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFilesystem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_facilities_include_parameter_inner.go b/services/metalv1/model_find_facilities_include_parameter_inner.go new file mode 100644 index 00000000..4f562c65 --- /dev/null +++ b/services/metalv1/model_find_facilities_include_parameter_inner.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindFacilitiesIncludeParameterInner the model 'FindFacilitiesIncludeParameterInner' +type FindFacilitiesIncludeParameterInner string + +// List of findFacilities_include_parameter_inner +const ( + FINDFACILITIESINCLUDEPARAMETERINNER_ADDRESS FindFacilitiesIncludeParameterInner = "address" + FINDFACILITIESINCLUDEPARAMETERINNER_LABELS FindFacilitiesIncludeParameterInner = "labels" +) + +// All allowed values of FindFacilitiesIncludeParameterInner enum +var AllowedFindFacilitiesIncludeParameterInnerEnumValues = []FindFacilitiesIncludeParameterInner{ + "address", + "labels", +} + +func (v *FindFacilitiesIncludeParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindFacilitiesIncludeParameterInner(value) + for _, existing := range AllowedFindFacilitiesIncludeParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindFacilitiesIncludeParameterInner", value) +} + +// NewFindFacilitiesIncludeParameterInnerFromValue returns a pointer to a valid FindFacilitiesIncludeParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindFacilitiesIncludeParameterInnerFromValue(v string) (*FindFacilitiesIncludeParameterInner, error) { + ev := FindFacilitiesIncludeParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindFacilitiesIncludeParameterInner: valid values are %v", v, AllowedFindFacilitiesIncludeParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindFacilitiesIncludeParameterInner) IsValid() bool { + for _, existing := range AllowedFindFacilitiesIncludeParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findFacilities_include_parameter_inner value +func (v FindFacilitiesIncludeParameterInner) Ptr() *FindFacilitiesIncludeParameterInner { + return &v +} + +type NullableFindFacilitiesIncludeParameterInner struct { + value *FindFacilitiesIncludeParameterInner + isSet bool +} + +func (v NullableFindFacilitiesIncludeParameterInner) Get() *FindFacilitiesIncludeParameterInner { + return v.value +} + +func (v *NullableFindFacilitiesIncludeParameterInner) Set(val *FindFacilitiesIncludeParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableFindFacilitiesIncludeParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableFindFacilitiesIncludeParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindFacilitiesIncludeParameterInner(val *FindFacilitiesIncludeParameterInner) *NullableFindFacilitiesIncludeParameterInner { + return &NullableFindFacilitiesIncludeParameterInner{value: val, isSet: true} +} + +func (v NullableFindFacilitiesIncludeParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindFacilitiesIncludeParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_ip_address_by_id_200_response.go b/services/metalv1/model_find_ip_address_by_id_200_response.go new file mode 100644 index 00000000..28f9552c --- /dev/null +++ b/services/metalv1/model_find_ip_address_by_id_200_response.go @@ -0,0 +1,176 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindIPAddressById200Response - struct for FindIPAddressById200Response +type FindIPAddressById200Response struct { + IPAssignment *IPAssignment + IPReservation *IPReservation + VrfIpReservation *VrfIpReservation +} + +// IPAssignmentAsFindIPAddressById200Response is a convenience function that returns IPAssignment wrapped in FindIPAddressById200Response +func IPAssignmentAsFindIPAddressById200Response(v *IPAssignment) FindIPAddressById200Response { + return FindIPAddressById200Response{ + IPAssignment: v, + } +} + +// IPReservationAsFindIPAddressById200Response is a convenience function that returns IPReservation wrapped in FindIPAddressById200Response +func IPReservationAsFindIPAddressById200Response(v *IPReservation) FindIPAddressById200Response { + return FindIPAddressById200Response{ + IPReservation: v, + } +} + +// VrfIpReservationAsFindIPAddressById200Response is a convenience function that returns VrfIpReservation wrapped in FindIPAddressById200Response +func VrfIpReservationAsFindIPAddressById200Response(v *VrfIpReservation) FindIPAddressById200Response { + return FindIPAddressById200Response{ + VrfIpReservation: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *FindIPAddressById200Response) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IPAssignment + err = newStrictDecoder(data).Decode(&dst.IPAssignment) + if err == nil { + jsonIPAssignment, _ := json.Marshal(dst.IPAssignment) + if string(jsonIPAssignment) == "{}" { // empty struct + dst.IPAssignment = nil + } else { + match++ + } + } else { + dst.IPAssignment = nil + } + + // try to unmarshal data into IPReservation + err = newStrictDecoder(data).Decode(&dst.IPReservation) + if err == nil { + jsonIPReservation, _ := json.Marshal(dst.IPReservation) + if string(jsonIPReservation) == "{}" { // empty struct + dst.IPReservation = nil + } else { + match++ + } + } else { + dst.IPReservation = nil + } + + // try to unmarshal data into VrfIpReservation + err = newStrictDecoder(data).Decode(&dst.VrfIpReservation) + if err == nil { + jsonVrfIpReservation, _ := json.Marshal(dst.VrfIpReservation) + if string(jsonVrfIpReservation) == "{}" { // empty struct + dst.VrfIpReservation = nil + } else { + match++ + } + } else { + dst.VrfIpReservation = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IPAssignment = nil + dst.IPReservation = nil + dst.VrfIpReservation = nil + + return fmt.Errorf("data matches more than one schema in oneOf(FindIPAddressById200Response)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(FindIPAddressById200Response)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FindIPAddressById200Response) MarshalJSON() ([]byte, error) { + if src.IPAssignment != nil { + return json.Marshal(&src.IPAssignment) + } + + if src.IPReservation != nil { + return json.Marshal(&src.IPReservation) + } + + if src.VrfIpReservation != nil { + return json.Marshal(&src.VrfIpReservation) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *FindIPAddressById200Response) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.IPAssignment != nil { + return obj.IPAssignment + } + + if obj.IPReservation != nil { + return obj.IPReservation + } + + if obj.VrfIpReservation != nil { + return obj.VrfIpReservation + } + + // all schemas are nil + return nil +} + +type NullableFindIPAddressById200Response struct { + value *FindIPAddressById200Response + isSet bool +} + +func (v NullableFindIPAddressById200Response) Get() *FindIPAddressById200Response { + return v.value +} + +func (v *NullableFindIPAddressById200Response) Set(val *FindIPAddressById200Response) { + v.value = val + v.isSet = true +} + +func (v NullableFindIPAddressById200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableFindIPAddressById200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindIPAddressById200Response(val *FindIPAddressById200Response) *NullableFindIPAddressById200Response { + return &NullableFindIPAddressById200Response{value: val, isSet: true} +} + +func (v NullableFindIPAddressById200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindIPAddressById200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_ip_availabilities_cidr_parameter.go b/services/metalv1/model_find_ip_availabilities_cidr_parameter.go new file mode 100644 index 00000000..c8b7eab2 --- /dev/null +++ b/services/metalv1/model_find_ip_availabilities_cidr_parameter.go @@ -0,0 +1,325 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindIPAvailabilitiesCidrParameter the model 'FindIPAvailabilitiesCidrParameter' +type FindIPAvailabilitiesCidrParameter string + +// List of findIPAvailabilities_cidr_parameter +const ( + FINDIPAVAILABILITIESCIDRPARAMETER__20 FindIPAvailabilitiesCidrParameter = "20" + FINDIPAVAILABILITIESCIDRPARAMETER__21 FindIPAvailabilitiesCidrParameter = "21" + FINDIPAVAILABILITIESCIDRPARAMETER__22 FindIPAvailabilitiesCidrParameter = "22" + FINDIPAVAILABILITIESCIDRPARAMETER__23 FindIPAvailabilitiesCidrParameter = "23" + FINDIPAVAILABILITIESCIDRPARAMETER__24 FindIPAvailabilitiesCidrParameter = "24" + FINDIPAVAILABILITIESCIDRPARAMETER__25 FindIPAvailabilitiesCidrParameter = "25" + FINDIPAVAILABILITIESCIDRPARAMETER__26 FindIPAvailabilitiesCidrParameter = "26" + FINDIPAVAILABILITIESCIDRPARAMETER__27 FindIPAvailabilitiesCidrParameter = "27" + FINDIPAVAILABILITIESCIDRPARAMETER__28 FindIPAvailabilitiesCidrParameter = "28" + FINDIPAVAILABILITIESCIDRPARAMETER__29 FindIPAvailabilitiesCidrParameter = "29" + FINDIPAVAILABILITIESCIDRPARAMETER__30 FindIPAvailabilitiesCidrParameter = "30" + FINDIPAVAILABILITIESCIDRPARAMETER__31 FindIPAvailabilitiesCidrParameter = "31" + FINDIPAVAILABILITIESCIDRPARAMETER__32 FindIPAvailabilitiesCidrParameter = "32" + FINDIPAVAILABILITIESCIDRPARAMETER__33 FindIPAvailabilitiesCidrParameter = "33" + FINDIPAVAILABILITIESCIDRPARAMETER__34 FindIPAvailabilitiesCidrParameter = "34" + FINDIPAVAILABILITIESCIDRPARAMETER__35 FindIPAvailabilitiesCidrParameter = "35" + FINDIPAVAILABILITIESCIDRPARAMETER__36 FindIPAvailabilitiesCidrParameter = "36" + FINDIPAVAILABILITIESCIDRPARAMETER__37 FindIPAvailabilitiesCidrParameter = "37" + FINDIPAVAILABILITIESCIDRPARAMETER__38 FindIPAvailabilitiesCidrParameter = "38" + FINDIPAVAILABILITIESCIDRPARAMETER__39 FindIPAvailabilitiesCidrParameter = "39" + FINDIPAVAILABILITIESCIDRPARAMETER__40 FindIPAvailabilitiesCidrParameter = "40" + FINDIPAVAILABILITIESCIDRPARAMETER__41 FindIPAvailabilitiesCidrParameter = "41" + FINDIPAVAILABILITIESCIDRPARAMETER__42 FindIPAvailabilitiesCidrParameter = "42" + FINDIPAVAILABILITIESCIDRPARAMETER__43 FindIPAvailabilitiesCidrParameter = "43" + FINDIPAVAILABILITIESCIDRPARAMETER__44 FindIPAvailabilitiesCidrParameter = "44" + FINDIPAVAILABILITIESCIDRPARAMETER__45 FindIPAvailabilitiesCidrParameter = "45" + FINDIPAVAILABILITIESCIDRPARAMETER__46 FindIPAvailabilitiesCidrParameter = "46" + FINDIPAVAILABILITIESCIDRPARAMETER__47 FindIPAvailabilitiesCidrParameter = "47" + FINDIPAVAILABILITIESCIDRPARAMETER__48 FindIPAvailabilitiesCidrParameter = "48" + FINDIPAVAILABILITIESCIDRPARAMETER__49 FindIPAvailabilitiesCidrParameter = "49" + FINDIPAVAILABILITIESCIDRPARAMETER__50 FindIPAvailabilitiesCidrParameter = "50" + FINDIPAVAILABILITIESCIDRPARAMETER__51 FindIPAvailabilitiesCidrParameter = "51" + FINDIPAVAILABILITIESCIDRPARAMETER__52 FindIPAvailabilitiesCidrParameter = "52" + FINDIPAVAILABILITIESCIDRPARAMETER__53 FindIPAvailabilitiesCidrParameter = "53" + FINDIPAVAILABILITIESCIDRPARAMETER__54 FindIPAvailabilitiesCidrParameter = "54" + FINDIPAVAILABILITIESCIDRPARAMETER__55 FindIPAvailabilitiesCidrParameter = "55" + FINDIPAVAILABILITIESCIDRPARAMETER__56 FindIPAvailabilitiesCidrParameter = "56" + FINDIPAVAILABILITIESCIDRPARAMETER__57 FindIPAvailabilitiesCidrParameter = "57" + FINDIPAVAILABILITIESCIDRPARAMETER__58 FindIPAvailabilitiesCidrParameter = "58" + FINDIPAVAILABILITIESCIDRPARAMETER__59 FindIPAvailabilitiesCidrParameter = "59" + FINDIPAVAILABILITIESCIDRPARAMETER__60 FindIPAvailabilitiesCidrParameter = "60" + FINDIPAVAILABILITIESCIDRPARAMETER__61 FindIPAvailabilitiesCidrParameter = "61" + FINDIPAVAILABILITIESCIDRPARAMETER__62 FindIPAvailabilitiesCidrParameter = "62" + FINDIPAVAILABILITIESCIDRPARAMETER__63 FindIPAvailabilitiesCidrParameter = "63" + FINDIPAVAILABILITIESCIDRPARAMETER__64 FindIPAvailabilitiesCidrParameter = "64" + FINDIPAVAILABILITIESCIDRPARAMETER__65 FindIPAvailabilitiesCidrParameter = "65" + FINDIPAVAILABILITIESCIDRPARAMETER__66 FindIPAvailabilitiesCidrParameter = "66" + FINDIPAVAILABILITIESCIDRPARAMETER__67 FindIPAvailabilitiesCidrParameter = "67" + FINDIPAVAILABILITIESCIDRPARAMETER__68 FindIPAvailabilitiesCidrParameter = "68" + FINDIPAVAILABILITIESCIDRPARAMETER__69 FindIPAvailabilitiesCidrParameter = "69" + FINDIPAVAILABILITIESCIDRPARAMETER__70 FindIPAvailabilitiesCidrParameter = "70" + FINDIPAVAILABILITIESCIDRPARAMETER__71 FindIPAvailabilitiesCidrParameter = "71" + FINDIPAVAILABILITIESCIDRPARAMETER__72 FindIPAvailabilitiesCidrParameter = "72" + FINDIPAVAILABILITIESCIDRPARAMETER__73 FindIPAvailabilitiesCidrParameter = "73" + FINDIPAVAILABILITIESCIDRPARAMETER__74 FindIPAvailabilitiesCidrParameter = "74" + FINDIPAVAILABILITIESCIDRPARAMETER__75 FindIPAvailabilitiesCidrParameter = "75" + FINDIPAVAILABILITIESCIDRPARAMETER__76 FindIPAvailabilitiesCidrParameter = "76" + FINDIPAVAILABILITIESCIDRPARAMETER__77 FindIPAvailabilitiesCidrParameter = "77" + FINDIPAVAILABILITIESCIDRPARAMETER__78 FindIPAvailabilitiesCidrParameter = "78" + FINDIPAVAILABILITIESCIDRPARAMETER__79 FindIPAvailabilitiesCidrParameter = "79" + FINDIPAVAILABILITIESCIDRPARAMETER__80 FindIPAvailabilitiesCidrParameter = "80" + FINDIPAVAILABILITIESCIDRPARAMETER__81 FindIPAvailabilitiesCidrParameter = "81" + FINDIPAVAILABILITIESCIDRPARAMETER__82 FindIPAvailabilitiesCidrParameter = "82" + FINDIPAVAILABILITIESCIDRPARAMETER__83 FindIPAvailabilitiesCidrParameter = "83" + FINDIPAVAILABILITIESCIDRPARAMETER__84 FindIPAvailabilitiesCidrParameter = "84" + FINDIPAVAILABILITIESCIDRPARAMETER__85 FindIPAvailabilitiesCidrParameter = "85" + FINDIPAVAILABILITIESCIDRPARAMETER__86 FindIPAvailabilitiesCidrParameter = "86" + FINDIPAVAILABILITIESCIDRPARAMETER__87 FindIPAvailabilitiesCidrParameter = "87" + FINDIPAVAILABILITIESCIDRPARAMETER__88 FindIPAvailabilitiesCidrParameter = "88" + FINDIPAVAILABILITIESCIDRPARAMETER__89 FindIPAvailabilitiesCidrParameter = "89" + FINDIPAVAILABILITIESCIDRPARAMETER__90 FindIPAvailabilitiesCidrParameter = "90" + FINDIPAVAILABILITIESCIDRPARAMETER__91 FindIPAvailabilitiesCidrParameter = "91" + FINDIPAVAILABILITIESCIDRPARAMETER__92 FindIPAvailabilitiesCidrParameter = "92" + FINDIPAVAILABILITIESCIDRPARAMETER__93 FindIPAvailabilitiesCidrParameter = "93" + FINDIPAVAILABILITIESCIDRPARAMETER__94 FindIPAvailabilitiesCidrParameter = "94" + FINDIPAVAILABILITIESCIDRPARAMETER__95 FindIPAvailabilitiesCidrParameter = "95" + FINDIPAVAILABILITIESCIDRPARAMETER__96 FindIPAvailabilitiesCidrParameter = "96" + FINDIPAVAILABILITIESCIDRPARAMETER__97 FindIPAvailabilitiesCidrParameter = "97" + FINDIPAVAILABILITIESCIDRPARAMETER__98 FindIPAvailabilitiesCidrParameter = "98" + FINDIPAVAILABILITIESCIDRPARAMETER__99 FindIPAvailabilitiesCidrParameter = "99" + FINDIPAVAILABILITIESCIDRPARAMETER__100 FindIPAvailabilitiesCidrParameter = "100" + FINDIPAVAILABILITIESCIDRPARAMETER__101 FindIPAvailabilitiesCidrParameter = "101" + FINDIPAVAILABILITIESCIDRPARAMETER__102 FindIPAvailabilitiesCidrParameter = "102" + FINDIPAVAILABILITIESCIDRPARAMETER__103 FindIPAvailabilitiesCidrParameter = "103" + FINDIPAVAILABILITIESCIDRPARAMETER__104 FindIPAvailabilitiesCidrParameter = "104" + FINDIPAVAILABILITIESCIDRPARAMETER__105 FindIPAvailabilitiesCidrParameter = "105" + FINDIPAVAILABILITIESCIDRPARAMETER__106 FindIPAvailabilitiesCidrParameter = "106" + FINDIPAVAILABILITIESCIDRPARAMETER__107 FindIPAvailabilitiesCidrParameter = "107" + FINDIPAVAILABILITIESCIDRPARAMETER__108 FindIPAvailabilitiesCidrParameter = "108" + FINDIPAVAILABILITIESCIDRPARAMETER__109 FindIPAvailabilitiesCidrParameter = "109" + FINDIPAVAILABILITIESCIDRPARAMETER__110 FindIPAvailabilitiesCidrParameter = "110" + FINDIPAVAILABILITIESCIDRPARAMETER__111 FindIPAvailabilitiesCidrParameter = "111" + FINDIPAVAILABILITIESCIDRPARAMETER__112 FindIPAvailabilitiesCidrParameter = "112" + FINDIPAVAILABILITIESCIDRPARAMETER__113 FindIPAvailabilitiesCidrParameter = "113" + FINDIPAVAILABILITIESCIDRPARAMETER__114 FindIPAvailabilitiesCidrParameter = "114" + FINDIPAVAILABILITIESCIDRPARAMETER__115 FindIPAvailabilitiesCidrParameter = "115" + FINDIPAVAILABILITIESCIDRPARAMETER__116 FindIPAvailabilitiesCidrParameter = "116" + FINDIPAVAILABILITIESCIDRPARAMETER__117 FindIPAvailabilitiesCidrParameter = "117" + FINDIPAVAILABILITIESCIDRPARAMETER__118 FindIPAvailabilitiesCidrParameter = "118" + FINDIPAVAILABILITIESCIDRPARAMETER__119 FindIPAvailabilitiesCidrParameter = "119" + FINDIPAVAILABILITIESCIDRPARAMETER__120 FindIPAvailabilitiesCidrParameter = "120" + FINDIPAVAILABILITIESCIDRPARAMETER__121 FindIPAvailabilitiesCidrParameter = "121" + FINDIPAVAILABILITIESCIDRPARAMETER__122 FindIPAvailabilitiesCidrParameter = "122" + FINDIPAVAILABILITIESCIDRPARAMETER__123 FindIPAvailabilitiesCidrParameter = "123" + FINDIPAVAILABILITIESCIDRPARAMETER__124 FindIPAvailabilitiesCidrParameter = "124" + FINDIPAVAILABILITIESCIDRPARAMETER__125 FindIPAvailabilitiesCidrParameter = "125" + FINDIPAVAILABILITIESCIDRPARAMETER__126 FindIPAvailabilitiesCidrParameter = "126" + FINDIPAVAILABILITIESCIDRPARAMETER__127 FindIPAvailabilitiesCidrParameter = "127" + FINDIPAVAILABILITIESCIDRPARAMETER__128 FindIPAvailabilitiesCidrParameter = "128" +) + +// All allowed values of FindIPAvailabilitiesCidrParameter enum +var AllowedFindIPAvailabilitiesCidrParameterEnumValues = []FindIPAvailabilitiesCidrParameter{ + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "52", + "53", + "54", + "55", + "56", + "57", + "58", + "59", + "60", + "61", + "62", + "63", + "64", + "65", + "66", + "67", + "68", + "69", + "70", + "71", + "72", + "73", + "74", + "75", + "76", + "77", + "78", + "79", + "80", + "81", + "82", + "83", + "84", + "85", + "86", + "87", + "88", + "89", + "90", + "91", + "92", + "93", + "94", + "95", + "96", + "97", + "98", + "99", + "100", + "101", + "102", + "103", + "104", + "105", + "106", + "107", + "108", + "109", + "110", + "111", + "112", + "113", + "114", + "115", + "116", + "117", + "118", + "119", + "120", + "121", + "122", + "123", + "124", + "125", + "126", + "127", + "128", +} + +func (v *FindIPAvailabilitiesCidrParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindIPAvailabilitiesCidrParameter(value) + for _, existing := range AllowedFindIPAvailabilitiesCidrParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindIPAvailabilitiesCidrParameter", value) +} + +// NewFindIPAvailabilitiesCidrParameterFromValue returns a pointer to a valid FindIPAvailabilitiesCidrParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindIPAvailabilitiesCidrParameterFromValue(v string) (*FindIPAvailabilitiesCidrParameter, error) { + ev := FindIPAvailabilitiesCidrParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindIPAvailabilitiesCidrParameter: valid values are %v", v, AllowedFindIPAvailabilitiesCidrParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindIPAvailabilitiesCidrParameter) IsValid() bool { + for _, existing := range AllowedFindIPAvailabilitiesCidrParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findIPAvailabilities_cidr_parameter value +func (v FindIPAvailabilitiesCidrParameter) Ptr() *FindIPAvailabilitiesCidrParameter { + return &v +} + +type NullableFindIPAvailabilitiesCidrParameter struct { + value *FindIPAvailabilitiesCidrParameter + isSet bool +} + +func (v NullableFindIPAvailabilitiesCidrParameter) Get() *FindIPAvailabilitiesCidrParameter { + return v.value +} + +func (v *NullableFindIPAvailabilitiesCidrParameter) Set(val *FindIPAvailabilitiesCidrParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindIPAvailabilitiesCidrParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindIPAvailabilitiesCidrParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindIPAvailabilitiesCidrParameter(val *FindIPAvailabilitiesCidrParameter) *NullableFindIPAvailabilitiesCidrParameter { + return &NullableFindIPAvailabilitiesCidrParameter{value: val, isSet: true} +} + +func (v NullableFindIPAvailabilitiesCidrParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindIPAvailabilitiesCidrParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_ip_reservations_types_parameter_inner.go b/services/metalv1/model_find_ip_reservations_types_parameter_inner.go new file mode 100644 index 00000000..bdc3d40b --- /dev/null +++ b/services/metalv1/model_find_ip_reservations_types_parameter_inner.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindIPReservationsTypesParameterInner the model 'FindIPReservationsTypesParameterInner' +type FindIPReservationsTypesParameterInner string + +// List of findIPReservations_types_parameter_inner +const ( + FINDIPRESERVATIONSTYPESPARAMETERINNER_GLOBAL_IPV4 FindIPReservationsTypesParameterInner = "global_ipv4" + FINDIPRESERVATIONSTYPESPARAMETERINNER_PRIVATE_IPV4 FindIPReservationsTypesParameterInner = "private_ipv4" + FINDIPRESERVATIONSTYPESPARAMETERINNER_PUBLIC_IPV4 FindIPReservationsTypesParameterInner = "public_ipv4" + FINDIPRESERVATIONSTYPESPARAMETERINNER_PUBLIC_IPV6 FindIPReservationsTypesParameterInner = "public_ipv6" + FINDIPRESERVATIONSTYPESPARAMETERINNER_VRF FindIPReservationsTypesParameterInner = "vrf" +) + +// All allowed values of FindIPReservationsTypesParameterInner enum +var AllowedFindIPReservationsTypesParameterInnerEnumValues = []FindIPReservationsTypesParameterInner{ + "global_ipv4", + "private_ipv4", + "public_ipv4", + "public_ipv6", + "vrf", +} + +func (v *FindIPReservationsTypesParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindIPReservationsTypesParameterInner(value) + for _, existing := range AllowedFindIPReservationsTypesParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindIPReservationsTypesParameterInner", value) +} + +// NewFindIPReservationsTypesParameterInnerFromValue returns a pointer to a valid FindIPReservationsTypesParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindIPReservationsTypesParameterInnerFromValue(v string) (*FindIPReservationsTypesParameterInner, error) { + ev := FindIPReservationsTypesParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindIPReservationsTypesParameterInner: valid values are %v", v, AllowedFindIPReservationsTypesParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindIPReservationsTypesParameterInner) IsValid() bool { + for _, existing := range AllowedFindIPReservationsTypesParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findIPReservations_types_parameter_inner value +func (v FindIPReservationsTypesParameterInner) Ptr() *FindIPReservationsTypesParameterInner { + return &v +} + +type NullableFindIPReservationsTypesParameterInner struct { + value *FindIPReservationsTypesParameterInner + isSet bool +} + +func (v NullableFindIPReservationsTypesParameterInner) Get() *FindIPReservationsTypesParameterInner { + return v.value +} + +func (v *NullableFindIPReservationsTypesParameterInner) Set(val *FindIPReservationsTypesParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableFindIPReservationsTypesParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableFindIPReservationsTypesParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindIPReservationsTypesParameterInner(val *FindIPReservationsTypesParameterInner) *NullableFindIPReservationsTypesParameterInner { + return &NullableFindIPReservationsTypesParameterInner{value: val, isSet: true} +} + +func (v NullableFindIPReservationsTypesParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindIPReservationsTypesParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_metal_gateway_by_id_200_response.go b/services/metalv1/model_find_metal_gateway_by_id_200_response.go new file mode 100644 index 00000000..3300b1f2 --- /dev/null +++ b/services/metalv1/model_find_metal_gateway_by_id_200_response.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindMetalGatewayById200Response - struct for FindMetalGatewayById200Response +type FindMetalGatewayById200Response struct { + MetalGateway *MetalGateway + VrfMetalGateway *VrfMetalGateway +} + +// MetalGatewayAsFindMetalGatewayById200Response is a convenience function that returns MetalGateway wrapped in FindMetalGatewayById200Response +func MetalGatewayAsFindMetalGatewayById200Response(v *MetalGateway) FindMetalGatewayById200Response { + return FindMetalGatewayById200Response{ + MetalGateway: v, + } +} + +// VrfMetalGatewayAsFindMetalGatewayById200Response is a convenience function that returns VrfMetalGateway wrapped in FindMetalGatewayById200Response +func VrfMetalGatewayAsFindMetalGatewayById200Response(v *VrfMetalGateway) FindMetalGatewayById200Response { + return FindMetalGatewayById200Response{ + VrfMetalGateway: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *FindMetalGatewayById200Response) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into MetalGateway + err = newStrictDecoder(data).Decode(&dst.MetalGateway) + if err == nil { + jsonMetalGateway, _ := json.Marshal(dst.MetalGateway) + if string(jsonMetalGateway) == "{}" { // empty struct + dst.MetalGateway = nil + } else { + match++ + } + } else { + dst.MetalGateway = nil + } + + // try to unmarshal data into VrfMetalGateway + err = newStrictDecoder(data).Decode(&dst.VrfMetalGateway) + if err == nil { + jsonVrfMetalGateway, _ := json.Marshal(dst.VrfMetalGateway) + if string(jsonVrfMetalGateway) == "{}" { // empty struct + dst.VrfMetalGateway = nil + } else { + match++ + } + } else { + dst.VrfMetalGateway = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.MetalGateway = nil + dst.VrfMetalGateway = nil + + return fmt.Errorf("data matches more than one schema in oneOf(FindMetalGatewayById200Response)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(FindMetalGatewayById200Response)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FindMetalGatewayById200Response) MarshalJSON() ([]byte, error) { + if src.MetalGateway != nil { + return json.Marshal(&src.MetalGateway) + } + + if src.VrfMetalGateway != nil { + return json.Marshal(&src.VrfMetalGateway) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *FindMetalGatewayById200Response) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.MetalGateway != nil { + return obj.MetalGateway + } + + if obj.VrfMetalGateway != nil { + return obj.VrfMetalGateway + } + + // all schemas are nil + return nil +} + +type NullableFindMetalGatewayById200Response struct { + value *FindMetalGatewayById200Response + isSet bool +} + +func (v NullableFindMetalGatewayById200Response) Get() *FindMetalGatewayById200Response { + return v.value +} + +func (v *NullableFindMetalGatewayById200Response) Set(val *FindMetalGatewayById200Response) { + v.value = val + v.isSet = true +} + +func (v NullableFindMetalGatewayById200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableFindMetalGatewayById200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindMetalGatewayById200Response(val *FindMetalGatewayById200Response) *NullableFindMetalGatewayById200Response { + return &NullableFindMetalGatewayById200Response{value: val, isSet: true} +} + +func (v NullableFindMetalGatewayById200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindMetalGatewayById200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_organization_devices_categories_parameter_inner.go b/services/metalv1/model_find_organization_devices_categories_parameter_inner.go new file mode 100644 index 00000000..fc2a1472 --- /dev/null +++ b/services/metalv1/model_find_organization_devices_categories_parameter_inner.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindOrganizationDevicesCategoriesParameterInner the model 'FindOrganizationDevicesCategoriesParameterInner' +type FindOrganizationDevicesCategoriesParameterInner string + +// List of findOrganizationDevices_categories_parameter_inner +const ( + FINDORGANIZATIONDEVICESCATEGORIESPARAMETERINNER_COMPUTE FindOrganizationDevicesCategoriesParameterInner = "compute" + FINDORGANIZATIONDEVICESCATEGORIESPARAMETERINNER_STORAGE FindOrganizationDevicesCategoriesParameterInner = "storage" + FINDORGANIZATIONDEVICESCATEGORIESPARAMETERINNER_VMCE FindOrganizationDevicesCategoriesParameterInner = "vmce" + FINDORGANIZATIONDEVICESCATEGORIESPARAMETERINNER_LEGACY_GEN FindOrganizationDevicesCategoriesParameterInner = "legacy_gen" + FINDORGANIZATIONDEVICESCATEGORIESPARAMETERINNER_CURRENT_GEN FindOrganizationDevicesCategoriesParameterInner = "current_gen" +) + +// All allowed values of FindOrganizationDevicesCategoriesParameterInner enum +var AllowedFindOrganizationDevicesCategoriesParameterInnerEnumValues = []FindOrganizationDevicesCategoriesParameterInner{ + "compute", + "storage", + "vmce", + "legacy_gen", + "current_gen", +} + +func (v *FindOrganizationDevicesCategoriesParameterInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindOrganizationDevicesCategoriesParameterInner(value) + for _, existing := range AllowedFindOrganizationDevicesCategoriesParameterInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindOrganizationDevicesCategoriesParameterInner", value) +} + +// NewFindOrganizationDevicesCategoriesParameterInnerFromValue returns a pointer to a valid FindOrganizationDevicesCategoriesParameterInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindOrganizationDevicesCategoriesParameterInnerFromValue(v string) (*FindOrganizationDevicesCategoriesParameterInner, error) { + ev := FindOrganizationDevicesCategoriesParameterInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindOrganizationDevicesCategoriesParameterInner: valid values are %v", v, AllowedFindOrganizationDevicesCategoriesParameterInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindOrganizationDevicesCategoriesParameterInner) IsValid() bool { + for _, existing := range AllowedFindOrganizationDevicesCategoriesParameterInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findOrganizationDevices_categories_parameter_inner value +func (v FindOrganizationDevicesCategoriesParameterInner) Ptr() *FindOrganizationDevicesCategoriesParameterInner { + return &v +} + +type NullableFindOrganizationDevicesCategoriesParameterInner struct { + value *FindOrganizationDevicesCategoriesParameterInner + isSet bool +} + +func (v NullableFindOrganizationDevicesCategoriesParameterInner) Get() *FindOrganizationDevicesCategoriesParameterInner { + return v.value +} + +func (v *NullableFindOrganizationDevicesCategoriesParameterInner) Set(val *FindOrganizationDevicesCategoriesParameterInner) { + v.value = val + v.isSet = true +} + +func (v NullableFindOrganizationDevicesCategoriesParameterInner) IsSet() bool { + return v.isSet +} + +func (v *NullableFindOrganizationDevicesCategoriesParameterInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindOrganizationDevicesCategoriesParameterInner(val *FindOrganizationDevicesCategoriesParameterInner) *NullableFindOrganizationDevicesCategoriesParameterInner { + return &NullableFindOrganizationDevicesCategoriesParameterInner{value: val, isSet: true} +} + +func (v NullableFindOrganizationDevicesCategoriesParameterInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindOrganizationDevicesCategoriesParameterInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_organizations_personal_parameter.go b/services/metalv1/model_find_organizations_personal_parameter.go new file mode 100644 index 00000000..39a4a3fe --- /dev/null +++ b/services/metalv1/model_find_organizations_personal_parameter.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindOrganizationsPersonalParameter the model 'FindOrganizationsPersonalParameter' +type FindOrganizationsPersonalParameter string + +// List of findOrganizations_personal_parameter +const ( + FINDORGANIZATIONSPERSONALPARAMETER_INCLUDE FindOrganizationsPersonalParameter = "include" + FINDORGANIZATIONSPERSONALPARAMETER_EXCLUDE FindOrganizationsPersonalParameter = "exclude" + FINDORGANIZATIONSPERSONALPARAMETER_ONLY FindOrganizationsPersonalParameter = "only" +) + +// All allowed values of FindOrganizationsPersonalParameter enum +var AllowedFindOrganizationsPersonalParameterEnumValues = []FindOrganizationsPersonalParameter{ + "include", + "exclude", + "only", +} + +func (v *FindOrganizationsPersonalParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindOrganizationsPersonalParameter(value) + for _, existing := range AllowedFindOrganizationsPersonalParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindOrganizationsPersonalParameter", value) +} + +// NewFindOrganizationsPersonalParameterFromValue returns a pointer to a valid FindOrganizationsPersonalParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindOrganizationsPersonalParameterFromValue(v string) (*FindOrganizationsPersonalParameter, error) { + ev := FindOrganizationsPersonalParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindOrganizationsPersonalParameter: valid values are %v", v, AllowedFindOrganizationsPersonalParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindOrganizationsPersonalParameter) IsValid() bool { + for _, existing := range AllowedFindOrganizationsPersonalParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findOrganizations_personal_parameter value +func (v FindOrganizationsPersonalParameter) Ptr() *FindOrganizationsPersonalParameter { + return &v +} + +type NullableFindOrganizationsPersonalParameter struct { + value *FindOrganizationsPersonalParameter + isSet bool +} + +func (v NullableFindOrganizationsPersonalParameter) Get() *FindOrganizationsPersonalParameter { + return v.value +} + +func (v *NullableFindOrganizationsPersonalParameter) Set(val *FindOrganizationsPersonalParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindOrganizationsPersonalParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindOrganizationsPersonalParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindOrganizationsPersonalParameter(val *FindOrganizationsPersonalParameter) *NullableFindOrganizationsPersonalParameter { + return &NullableFindOrganizationsPersonalParameter{value: val, isSet: true} +} + +func (v NullableFindOrganizationsPersonalParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindOrganizationsPersonalParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_plans_type_parameter.go b/services/metalv1/model_find_plans_type_parameter.go new file mode 100644 index 00000000..c97f6e8c --- /dev/null +++ b/services/metalv1/model_find_plans_type_parameter.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindPlansTypeParameter the model 'FindPlansTypeParameter' +type FindPlansTypeParameter string + +// List of findPlans_type_parameter +const ( + FINDPLANSTYPEPARAMETER_STANDARD FindPlansTypeParameter = "standard" + FINDPLANSTYPEPARAMETER_WORKLOAD_OPTIMIZED FindPlansTypeParameter = "workload_optimized" + FINDPLANSTYPEPARAMETER_CUSTOM FindPlansTypeParameter = "custom" +) + +// All allowed values of FindPlansTypeParameter enum +var AllowedFindPlansTypeParameterEnumValues = []FindPlansTypeParameter{ + "standard", + "workload_optimized", + "custom", +} + +func (v *FindPlansTypeParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindPlansTypeParameter(value) + for _, existing := range AllowedFindPlansTypeParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindPlansTypeParameter", value) +} + +// NewFindPlansTypeParameterFromValue returns a pointer to a valid FindPlansTypeParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindPlansTypeParameterFromValue(v string) (*FindPlansTypeParameter, error) { + ev := FindPlansTypeParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindPlansTypeParameter: valid values are %v", v, AllowedFindPlansTypeParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindPlansTypeParameter) IsValid() bool { + for _, existing := range AllowedFindPlansTypeParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findPlans_type_parameter value +func (v FindPlansTypeParameter) Ptr() *FindPlansTypeParameter { + return &v +} + +type NullableFindPlansTypeParameter struct { + value *FindPlansTypeParameter + isSet bool +} + +func (v NullableFindPlansTypeParameter) Get() *FindPlansTypeParameter { + return v.value +} + +func (v *NullableFindPlansTypeParameter) Set(val *FindPlansTypeParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindPlansTypeParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindPlansTypeParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindPlansTypeParameter(val *FindPlansTypeParameter) *NullableFindPlansTypeParameter { + return &NullableFindPlansTypeParameter{value: val, isSet: true} +} + +func (v NullableFindPlansTypeParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindPlansTypeParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_project_hardware_reservations_provisionable_parameter.go b/services/metalv1/model_find_project_hardware_reservations_provisionable_parameter.go new file mode 100644 index 00000000..f1c1fd25 --- /dev/null +++ b/services/metalv1/model_find_project_hardware_reservations_provisionable_parameter.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindProjectHardwareReservationsProvisionableParameter the model 'FindProjectHardwareReservationsProvisionableParameter' +type FindProjectHardwareReservationsProvisionableParameter string + +// List of findProjectHardwareReservations_provisionable_parameter +const ( + FINDPROJECTHARDWARERESERVATIONSPROVISIONABLEPARAMETER_ONLY FindProjectHardwareReservationsProvisionableParameter = "only" +) + +// All allowed values of FindProjectHardwareReservationsProvisionableParameter enum +var AllowedFindProjectHardwareReservationsProvisionableParameterEnumValues = []FindProjectHardwareReservationsProvisionableParameter{ + "only", +} + +func (v *FindProjectHardwareReservationsProvisionableParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindProjectHardwareReservationsProvisionableParameter(value) + for _, existing := range AllowedFindProjectHardwareReservationsProvisionableParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindProjectHardwareReservationsProvisionableParameter", value) +} + +// NewFindProjectHardwareReservationsProvisionableParameterFromValue returns a pointer to a valid FindProjectHardwareReservationsProvisionableParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindProjectHardwareReservationsProvisionableParameterFromValue(v string) (*FindProjectHardwareReservationsProvisionableParameter, error) { + ev := FindProjectHardwareReservationsProvisionableParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindProjectHardwareReservationsProvisionableParameter: valid values are %v", v, AllowedFindProjectHardwareReservationsProvisionableParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindProjectHardwareReservationsProvisionableParameter) IsValid() bool { + for _, existing := range AllowedFindProjectHardwareReservationsProvisionableParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findProjectHardwareReservations_provisionable_parameter value +func (v FindProjectHardwareReservationsProvisionableParameter) Ptr() *FindProjectHardwareReservationsProvisionableParameter { + return &v +} + +type NullableFindProjectHardwareReservationsProvisionableParameter struct { + value *FindProjectHardwareReservationsProvisionableParameter + isSet bool +} + +func (v NullableFindProjectHardwareReservationsProvisionableParameter) Get() *FindProjectHardwareReservationsProvisionableParameter { + return v.value +} + +func (v *NullableFindProjectHardwareReservationsProvisionableParameter) Set(val *FindProjectHardwareReservationsProvisionableParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindProjectHardwareReservationsProvisionableParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindProjectHardwareReservationsProvisionableParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindProjectHardwareReservationsProvisionableParameter(val *FindProjectHardwareReservationsProvisionableParameter) *NullableFindProjectHardwareReservationsProvisionableParameter { + return &NullableFindProjectHardwareReservationsProvisionableParameter{value: val, isSet: true} +} + +func (v NullableFindProjectHardwareReservationsProvisionableParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindProjectHardwareReservationsProvisionableParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_project_hardware_reservations_state_parameter.go b/services/metalv1/model_find_project_hardware_reservations_state_parameter.go new file mode 100644 index 00000000..14a368b8 --- /dev/null +++ b/services/metalv1/model_find_project_hardware_reservations_state_parameter.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindProjectHardwareReservationsStateParameter the model 'FindProjectHardwareReservationsStateParameter' +type FindProjectHardwareReservationsStateParameter string + +// List of findProjectHardwareReservations_state_parameter +const ( + FINDPROJECTHARDWARERESERVATIONSSTATEPARAMETER_ACTIVE FindProjectHardwareReservationsStateParameter = "active" + FINDPROJECTHARDWARERESERVATIONSSTATEPARAMETER_SPARE FindProjectHardwareReservationsStateParameter = "spare" + FINDPROJECTHARDWARERESERVATIONSSTATEPARAMETER_NEED_OF_SERVICE FindProjectHardwareReservationsStateParameter = "need_of_service" +) + +// All allowed values of FindProjectHardwareReservationsStateParameter enum +var AllowedFindProjectHardwareReservationsStateParameterEnumValues = []FindProjectHardwareReservationsStateParameter{ + "active", + "spare", + "need_of_service", +} + +func (v *FindProjectHardwareReservationsStateParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindProjectHardwareReservationsStateParameter(value) + for _, existing := range AllowedFindProjectHardwareReservationsStateParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindProjectHardwareReservationsStateParameter", value) +} + +// NewFindProjectHardwareReservationsStateParameterFromValue returns a pointer to a valid FindProjectHardwareReservationsStateParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindProjectHardwareReservationsStateParameterFromValue(v string) (*FindProjectHardwareReservationsStateParameter, error) { + ev := FindProjectHardwareReservationsStateParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindProjectHardwareReservationsStateParameter: valid values are %v", v, AllowedFindProjectHardwareReservationsStateParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindProjectHardwareReservationsStateParameter) IsValid() bool { + for _, existing := range AllowedFindProjectHardwareReservationsStateParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findProjectHardwareReservations_state_parameter value +func (v FindProjectHardwareReservationsStateParameter) Ptr() *FindProjectHardwareReservationsStateParameter { + return &v +} + +type NullableFindProjectHardwareReservationsStateParameter struct { + value *FindProjectHardwareReservationsStateParameter + isSet bool +} + +func (v NullableFindProjectHardwareReservationsStateParameter) Get() *FindProjectHardwareReservationsStateParameter { + return v.value +} + +func (v *NullableFindProjectHardwareReservationsStateParameter) Set(val *FindProjectHardwareReservationsStateParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindProjectHardwareReservationsStateParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindProjectHardwareReservationsStateParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindProjectHardwareReservationsStateParameter(val *FindProjectHardwareReservationsStateParameter) *NullableFindProjectHardwareReservationsStateParameter { + return &NullableFindProjectHardwareReservationsStateParameter{value: val, isSet: true} +} + +func (v NullableFindProjectHardwareReservationsStateParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindProjectHardwareReservationsStateParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_traffic_bucket_parameter.go b/services/metalv1/model_find_traffic_bucket_parameter.go new file mode 100644 index 00000000..62ee5217 --- /dev/null +++ b/services/metalv1/model_find_traffic_bucket_parameter.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindTrafficBucketParameter the model 'FindTrafficBucketParameter' +type FindTrafficBucketParameter string + +// List of findTraffic_bucket_parameter +const ( + FINDTRAFFICBUCKETPARAMETER_INTERNAL FindTrafficBucketParameter = "internal" + FINDTRAFFICBUCKETPARAMETER_EXTERNAL FindTrafficBucketParameter = "external" +) + +// All allowed values of FindTrafficBucketParameter enum +var AllowedFindTrafficBucketParameterEnumValues = []FindTrafficBucketParameter{ + "internal", + "external", +} + +func (v *FindTrafficBucketParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindTrafficBucketParameter(value) + for _, existing := range AllowedFindTrafficBucketParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindTrafficBucketParameter", value) +} + +// NewFindTrafficBucketParameterFromValue returns a pointer to a valid FindTrafficBucketParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindTrafficBucketParameterFromValue(v string) (*FindTrafficBucketParameter, error) { + ev := FindTrafficBucketParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindTrafficBucketParameter: valid values are %v", v, AllowedFindTrafficBucketParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindTrafficBucketParameter) IsValid() bool { + for _, existing := range AllowedFindTrafficBucketParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findTraffic_bucket_parameter value +func (v FindTrafficBucketParameter) Ptr() *FindTrafficBucketParameter { + return &v +} + +type NullableFindTrafficBucketParameter struct { + value *FindTrafficBucketParameter + isSet bool +} + +func (v NullableFindTrafficBucketParameter) Get() *FindTrafficBucketParameter { + return v.value +} + +func (v *NullableFindTrafficBucketParameter) Set(val *FindTrafficBucketParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindTrafficBucketParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindTrafficBucketParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindTrafficBucketParameter(val *FindTrafficBucketParameter) *NullableFindTrafficBucketParameter { + return &NullableFindTrafficBucketParameter{value: val, isSet: true} +} + +func (v NullableFindTrafficBucketParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindTrafficBucketParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_traffic_direction_parameter.go b/services/metalv1/model_find_traffic_direction_parameter.go new file mode 100644 index 00000000..dac328bc --- /dev/null +++ b/services/metalv1/model_find_traffic_direction_parameter.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindTrafficDirectionParameter the model 'FindTrafficDirectionParameter' +type FindTrafficDirectionParameter string + +// List of findTraffic_direction_parameter +const ( + FINDTRAFFICDIRECTIONPARAMETER_INBOUND FindTrafficDirectionParameter = "inbound" + FINDTRAFFICDIRECTIONPARAMETER_OUTBOUND FindTrafficDirectionParameter = "outbound" +) + +// All allowed values of FindTrafficDirectionParameter enum +var AllowedFindTrafficDirectionParameterEnumValues = []FindTrafficDirectionParameter{ + "inbound", + "outbound", +} + +func (v *FindTrafficDirectionParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindTrafficDirectionParameter(value) + for _, existing := range AllowedFindTrafficDirectionParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindTrafficDirectionParameter", value) +} + +// NewFindTrafficDirectionParameterFromValue returns a pointer to a valid FindTrafficDirectionParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindTrafficDirectionParameterFromValue(v string) (*FindTrafficDirectionParameter, error) { + ev := FindTrafficDirectionParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindTrafficDirectionParameter: valid values are %v", v, AllowedFindTrafficDirectionParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindTrafficDirectionParameter) IsValid() bool { + for _, existing := range AllowedFindTrafficDirectionParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findTraffic_direction_parameter value +func (v FindTrafficDirectionParameter) Ptr() *FindTrafficDirectionParameter { + return &v +} + +type NullableFindTrafficDirectionParameter struct { + value *FindTrafficDirectionParameter + isSet bool +} + +func (v NullableFindTrafficDirectionParameter) Get() *FindTrafficDirectionParameter { + return v.value +} + +func (v *NullableFindTrafficDirectionParameter) Set(val *FindTrafficDirectionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindTrafficDirectionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindTrafficDirectionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindTrafficDirectionParameter(val *FindTrafficDirectionParameter) *NullableFindTrafficDirectionParameter { + return &NullableFindTrafficDirectionParameter{value: val, isSet: true} +} + +func (v NullableFindTrafficDirectionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindTrafficDirectionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_traffic_interval_parameter.go b/services/metalv1/model_find_traffic_interval_parameter.go new file mode 100644 index 00000000..f88b222f --- /dev/null +++ b/services/metalv1/model_find_traffic_interval_parameter.go @@ -0,0 +1,127 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// FindTrafficIntervalParameter the model 'FindTrafficIntervalParameter' +type FindTrafficIntervalParameter string + +// List of findTraffic_interval_parameter +const ( + FINDTRAFFICINTERVALPARAMETER_MINUTE FindTrafficIntervalParameter = "minute" + FINDTRAFFICINTERVALPARAMETER_HOUR FindTrafficIntervalParameter = "hour" + FINDTRAFFICINTERVALPARAMETER_DAY FindTrafficIntervalParameter = "day" + FINDTRAFFICINTERVALPARAMETER_WEEK FindTrafficIntervalParameter = "week" + FINDTRAFFICINTERVALPARAMETER_MONTH FindTrafficIntervalParameter = "month" + FINDTRAFFICINTERVALPARAMETER_YEAR FindTrafficIntervalParameter = "year" + FINDTRAFFICINTERVALPARAMETER_HOUR_OF_DAY FindTrafficIntervalParameter = "hour_of_day" + FINDTRAFFICINTERVALPARAMETER_DAY_OF_WEEK FindTrafficIntervalParameter = "day_of_week" + FINDTRAFFICINTERVALPARAMETER_DAY_OF_MONTH FindTrafficIntervalParameter = "day_of_month" + FINDTRAFFICINTERVALPARAMETER_MONTH_OF_YEAR FindTrafficIntervalParameter = "month_of_year" +) + +// All allowed values of FindTrafficIntervalParameter enum +var AllowedFindTrafficIntervalParameterEnumValues = []FindTrafficIntervalParameter{ + "minute", + "hour", + "day", + "week", + "month", + "year", + "hour_of_day", + "day_of_week", + "day_of_month", + "month_of_year", +} + +func (v *FindTrafficIntervalParameter) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FindTrafficIntervalParameter(value) + for _, existing := range AllowedFindTrafficIntervalParameterEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FindTrafficIntervalParameter", value) +} + +// NewFindTrafficIntervalParameterFromValue returns a pointer to a valid FindTrafficIntervalParameter +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFindTrafficIntervalParameterFromValue(v string) (*FindTrafficIntervalParameter, error) { + ev := FindTrafficIntervalParameter(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FindTrafficIntervalParameter: valid values are %v", v, AllowedFindTrafficIntervalParameterEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FindTrafficIntervalParameter) IsValid() bool { + for _, existing := range AllowedFindTrafficIntervalParameterEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to findTraffic_interval_parameter value +func (v FindTrafficIntervalParameter) Ptr() *FindTrafficIntervalParameter { + return &v +} + +type NullableFindTrafficIntervalParameter struct { + value *FindTrafficIntervalParameter + isSet bool +} + +func (v NullableFindTrafficIntervalParameter) Get() *FindTrafficIntervalParameter { + return v.value +} + +func (v *NullableFindTrafficIntervalParameter) Set(val *FindTrafficIntervalParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindTrafficIntervalParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindTrafficIntervalParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindTrafficIntervalParameter(val *FindTrafficIntervalParameter) *NullableFindTrafficIntervalParameter { + return &NullableFindTrafficIntervalParameter{value: val, isSet: true} +} + +func (v NullableFindTrafficIntervalParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindTrafficIntervalParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_find_traffic_timeframe_parameter.go b/services/metalv1/model_find_traffic_timeframe_parameter.go new file mode 100644 index 00000000..3544d752 --- /dev/null +++ b/services/metalv1/model_find_traffic_timeframe_parameter.go @@ -0,0 +1,197 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FindTrafficTimeframeParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindTrafficTimeframeParameter{} + +// FindTrafficTimeframeParameter struct for FindTrafficTimeframeParameter +type FindTrafficTimeframeParameter struct { + EndedAt time.Time `json:"ended_at"` + StartedAt time.Time `json:"started_at"` + AdditionalProperties map[string]interface{} +} + +type _FindTrafficTimeframeParameter FindTrafficTimeframeParameter + +// NewFindTrafficTimeframeParameter instantiates a new FindTrafficTimeframeParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFindTrafficTimeframeParameter(endedAt time.Time, startedAt time.Time) *FindTrafficTimeframeParameter { + this := FindTrafficTimeframeParameter{} + this.EndedAt = endedAt + this.StartedAt = startedAt + return &this +} + +// NewFindTrafficTimeframeParameterWithDefaults instantiates a new FindTrafficTimeframeParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFindTrafficTimeframeParameterWithDefaults() *FindTrafficTimeframeParameter { + this := FindTrafficTimeframeParameter{} + return &this +} + +// GetEndedAt returns the EndedAt field value +func (o *FindTrafficTimeframeParameter) GetEndedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndedAt +} + +// GetEndedAtOk returns a tuple with the EndedAt field value +// and a boolean to check if the value has been set. +func (o *FindTrafficTimeframeParameter) GetEndedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndedAt, true +} + +// SetEndedAt sets field value +func (o *FindTrafficTimeframeParameter) SetEndedAt(v time.Time) { + o.EndedAt = v +} + +// GetStartedAt returns the StartedAt field value +func (o *FindTrafficTimeframeParameter) GetStartedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value +// and a boolean to check if the value has been set. +func (o *FindTrafficTimeframeParameter) GetStartedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartedAt, true +} + +// SetStartedAt sets field value +func (o *FindTrafficTimeframeParameter) SetStartedAt(v time.Time) { + o.StartedAt = v +} + +func (o FindTrafficTimeframeParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindTrafficTimeframeParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ended_at"] = o.EndedAt + toSerialize["started_at"] = o.StartedAt + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FindTrafficTimeframeParameter) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "ended_at", + "started_at", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindTrafficTimeframeParameter := _FindTrafficTimeframeParameter{} + + err = json.Unmarshal(bytes, &varFindTrafficTimeframeParameter) + + if err != nil { + return err + } + + *o = FindTrafficTimeframeParameter(varFindTrafficTimeframeParameter) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ended_at") + delete(additionalProperties, "started_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFindTrafficTimeframeParameter struct { + value *FindTrafficTimeframeParameter + isSet bool +} + +func (v NullableFindTrafficTimeframeParameter) Get() *FindTrafficTimeframeParameter { + return v.value +} + +func (v *NullableFindTrafficTimeframeParameter) Set(val *FindTrafficTimeframeParameter) { + v.value = val + v.isSet = true +} + +func (v NullableFindTrafficTimeframeParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableFindTrafficTimeframeParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindTrafficTimeframeParameter(val *FindTrafficTimeframeParameter) *NullableFindTrafficTimeframeParameter { + return &NullableFindTrafficTimeframeParameter{value: val, isSet: true} +} + +func (v NullableFindTrafficTimeframeParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindTrafficTimeframeParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_firmware_set.go b/services/metalv1/model_firmware_set.go new file mode 100644 index 00000000..a19a5fa3 --- /dev/null +++ b/services/metalv1/model_firmware_set.go @@ -0,0 +1,351 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the FirmwareSet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FirmwareSet{} + +// FirmwareSet Represents a Firmware Set +type FirmwareSet struct { + // Firmware Set UUID + Uuid string `json:"uuid"` + // Firmware Set Name + Name string `json:"name"` + // Datetime when the block was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // Datetime when the block was updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // Represents a list of attributes + Attributes []Attribute `json:"attributes,omitempty"` + // List of components versions + ComponentFirmware []Component `json:"component_firmware,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FirmwareSet FirmwareSet + +// NewFirmwareSet instantiates a new FirmwareSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirmwareSet(uuid string, name string) *FirmwareSet { + this := FirmwareSet{} + this.Uuid = uuid + this.Name = name + return &this +} + +// NewFirmwareSetWithDefaults instantiates a new FirmwareSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirmwareSetWithDefaults() *FirmwareSet { + this := FirmwareSet{} + return &this +} + +// GetUuid returns the Uuid field value +func (o *FirmwareSet) GetUuid() string { + if o == nil { + var ret string + return ret + } + + return o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uuid, true +} + +// SetUuid sets field value +func (o *FirmwareSet) SetUuid(v string) { + o.Uuid = v +} + +// GetName returns the Name field value +func (o *FirmwareSet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FirmwareSet) SetName(v string) { + o.Name = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *FirmwareSet) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *FirmwareSet) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *FirmwareSet) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *FirmwareSet) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *FirmwareSet) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *FirmwareSet) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *FirmwareSet) GetAttributes() []Attribute { + if o == nil || IsNil(o.Attributes) { + var ret []Attribute + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetAttributesOk() ([]Attribute, bool) { + if o == nil || IsNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *FirmwareSet) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given []Attribute and assigns it to the Attributes field. +func (o *FirmwareSet) SetAttributes(v []Attribute) { + o.Attributes = v +} + +// GetComponentFirmware returns the ComponentFirmware field value if set, zero value otherwise. +func (o *FirmwareSet) GetComponentFirmware() []Component { + if o == nil || IsNil(o.ComponentFirmware) { + var ret []Component + return ret + } + return o.ComponentFirmware +} + +// GetComponentFirmwareOk returns a tuple with the ComponentFirmware field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSet) GetComponentFirmwareOk() ([]Component, bool) { + if o == nil || IsNil(o.ComponentFirmware) { + return nil, false + } + return o.ComponentFirmware, true +} + +// HasComponentFirmware returns a boolean if a field has been set. +func (o *FirmwareSet) HasComponentFirmware() bool { + if o != nil && !IsNil(o.ComponentFirmware) { + return true + } + + return false +} + +// SetComponentFirmware gets a reference to the given []Component and assigns it to the ComponentFirmware field. +func (o *FirmwareSet) SetComponentFirmware(v []Component) { + o.ComponentFirmware = v +} + +func (o FirmwareSet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FirmwareSet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["uuid"] = o.Uuid + toSerialize["name"] = o.Name + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.ComponentFirmware) { + toSerialize["component_firmware"] = o.ComponentFirmware + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FirmwareSet) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "uuid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFirmwareSet := _FirmwareSet{} + + err = json.Unmarshal(bytes, &varFirmwareSet) + + if err != nil { + return err + } + + *o = FirmwareSet(varFirmwareSet) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "attributes") + delete(additionalProperties, "component_firmware") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFirmwareSet struct { + value *FirmwareSet + isSet bool +} + +func (v NullableFirmwareSet) Get() *FirmwareSet { + return v.value +} + +func (v *NullableFirmwareSet) Set(val *FirmwareSet) { + v.value = val + v.isSet = true +} + +func (v NullableFirmwareSet) IsSet() bool { + return v.isSet +} + +func (v *NullableFirmwareSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFirmwareSet(val *FirmwareSet) *NullableFirmwareSet { + return &NullableFirmwareSet{value: val, isSet: true} +} + +func (v NullableFirmwareSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFirmwareSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_firmware_set_list_response.go b/services/metalv1/model_firmware_set_list_response.go new file mode 100644 index 00000000..110739cb --- /dev/null +++ b/services/metalv1/model_firmware_set_list_response.go @@ -0,0 +1,345 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the FirmwareSetListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FirmwareSetListResponse{} + +// FirmwareSetListResponse Represents collection of Firmware Sets +type FirmwareSetListResponse struct { + // Max number of items returned in a page + PageSize *int32 `json:"page_size,omitempty"` + // Page returned + Page *int32 `json:"page,omitempty"` + // Items returned in current page + PageCount *int32 `json:"page_count,omitempty"` + // Total count of pages + TotalPages *int32 `json:"total_pages,omitempty"` + // Total count of items + TotalRecordCount *int32 `json:"total_record_count,omitempty"` + // Represents a list of FirmwareSets + Records []FirmwareSet `json:"records,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FirmwareSetListResponse FirmwareSetListResponse + +// NewFirmwareSetListResponse instantiates a new FirmwareSetListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirmwareSetListResponse() *FirmwareSetListResponse { + this := FirmwareSetListResponse{} + return &this +} + +// NewFirmwareSetListResponseWithDefaults instantiates a new FirmwareSetListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirmwareSetListResponseWithDefaults() *FirmwareSetListResponse { + this := FirmwareSetListResponse{} + return &this +} + +// GetPageSize returns the PageSize field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetPageSize() int32 { + if o == nil || IsNil(o.PageSize) { + var ret int32 + return ret + } + return *o.PageSize +} + +// GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PageSize) { + return nil, false + } + return o.PageSize, true +} + +// HasPageSize returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasPageSize() bool { + if o != nil && !IsNil(o.PageSize) { + return true + } + + return false +} + +// SetPageSize gets a reference to the given int32 and assigns it to the PageSize field. +func (o *FirmwareSetListResponse) SetPageSize(v int32) { + o.PageSize = &v +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetPage() int32 { + if o == nil || IsNil(o.Page) { + var ret int32 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetPageOk() (*int32, bool) { + if o == nil || IsNil(o.Page) { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasPage() bool { + if o != nil && !IsNil(o.Page) { + return true + } + + return false +} + +// SetPage gets a reference to the given int32 and assigns it to the Page field. +func (o *FirmwareSetListResponse) SetPage(v int32) { + o.Page = &v +} + +// GetPageCount returns the PageCount field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetPageCount() int32 { + if o == nil || IsNil(o.PageCount) { + var ret int32 + return ret + } + return *o.PageCount +} + +// GetPageCountOk returns a tuple with the PageCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetPageCountOk() (*int32, bool) { + if o == nil || IsNil(o.PageCount) { + return nil, false + } + return o.PageCount, true +} + +// HasPageCount returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasPageCount() bool { + if o != nil && !IsNil(o.PageCount) { + return true + } + + return false +} + +// SetPageCount gets a reference to the given int32 and assigns it to the PageCount field. +func (o *FirmwareSetListResponse) SetPageCount(v int32) { + o.PageCount = &v +} + +// GetTotalPages returns the TotalPages field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetTotalPages() int32 { + if o == nil || IsNil(o.TotalPages) { + var ret int32 + return ret + } + return *o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetTotalPagesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalPages) { + return nil, false + } + return o.TotalPages, true +} + +// HasTotalPages returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasTotalPages() bool { + if o != nil && !IsNil(o.TotalPages) { + return true + } + + return false +} + +// SetTotalPages gets a reference to the given int32 and assigns it to the TotalPages field. +func (o *FirmwareSetListResponse) SetTotalPages(v int32) { + o.TotalPages = &v +} + +// GetTotalRecordCount returns the TotalRecordCount field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetTotalRecordCount() int32 { + if o == nil || IsNil(o.TotalRecordCount) { + var ret int32 + return ret + } + return *o.TotalRecordCount +} + +// GetTotalRecordCountOk returns a tuple with the TotalRecordCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetTotalRecordCountOk() (*int32, bool) { + if o == nil || IsNil(o.TotalRecordCount) { + return nil, false + } + return o.TotalRecordCount, true +} + +// HasTotalRecordCount returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasTotalRecordCount() bool { + if o != nil && !IsNil(o.TotalRecordCount) { + return true + } + + return false +} + +// SetTotalRecordCount gets a reference to the given int32 and assigns it to the TotalRecordCount field. +func (o *FirmwareSetListResponse) SetTotalRecordCount(v int32) { + o.TotalRecordCount = &v +} + +// GetRecords returns the Records field value if set, zero value otherwise. +func (o *FirmwareSetListResponse) GetRecords() []FirmwareSet { + if o == nil || IsNil(o.Records) { + var ret []FirmwareSet + return ret + } + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetListResponse) GetRecordsOk() ([]FirmwareSet, bool) { + if o == nil || IsNil(o.Records) { + return nil, false + } + return o.Records, true +} + +// HasRecords returns a boolean if a field has been set. +func (o *FirmwareSetListResponse) HasRecords() bool { + if o != nil && !IsNil(o.Records) { + return true + } + + return false +} + +// SetRecords gets a reference to the given []FirmwareSet and assigns it to the Records field. +func (o *FirmwareSetListResponse) SetRecords(v []FirmwareSet) { + o.Records = v +} + +func (o FirmwareSetListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FirmwareSetListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PageSize) { + toSerialize["page_size"] = o.PageSize + } + if !IsNil(o.Page) { + toSerialize["page"] = o.Page + } + if !IsNil(o.PageCount) { + toSerialize["page_count"] = o.PageCount + } + if !IsNil(o.TotalPages) { + toSerialize["total_pages"] = o.TotalPages + } + if !IsNil(o.TotalRecordCount) { + toSerialize["total_record_count"] = o.TotalRecordCount + } + if !IsNil(o.Records) { + toSerialize["records"] = o.Records + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FirmwareSetListResponse) UnmarshalJSON(bytes []byte) (err error) { + varFirmwareSetListResponse := _FirmwareSetListResponse{} + + err = json.Unmarshal(bytes, &varFirmwareSetListResponse) + + if err != nil { + return err + } + + *o = FirmwareSetListResponse(varFirmwareSetListResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "page_size") + delete(additionalProperties, "page") + delete(additionalProperties, "page_count") + delete(additionalProperties, "total_pages") + delete(additionalProperties, "total_record_count") + delete(additionalProperties, "records") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFirmwareSetListResponse struct { + value *FirmwareSetListResponse + isSet bool +} + +func (v NullableFirmwareSetListResponse) Get() *FirmwareSetListResponse { + return v.value +} + +func (v *NullableFirmwareSetListResponse) Set(val *FirmwareSetListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFirmwareSetListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFirmwareSetListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFirmwareSetListResponse(val *FirmwareSetListResponse) *NullableFirmwareSetListResponse { + return &NullableFirmwareSetListResponse{value: val, isSet: true} +} + +func (v NullableFirmwareSetListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFirmwareSetListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_firmware_set_response.go b/services/metalv1/model_firmware_set_response.go new file mode 100644 index 00000000..106daf58 --- /dev/null +++ b/services/metalv1/model_firmware_set_response.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the FirmwareSetResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FirmwareSetResponse{} + +// FirmwareSetResponse Represents single Firmware set response +type FirmwareSetResponse struct { + Record *FirmwareSet `json:"record,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FirmwareSetResponse FirmwareSetResponse + +// NewFirmwareSetResponse instantiates a new FirmwareSetResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFirmwareSetResponse() *FirmwareSetResponse { + this := FirmwareSetResponse{} + return &this +} + +// NewFirmwareSetResponseWithDefaults instantiates a new FirmwareSetResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFirmwareSetResponseWithDefaults() *FirmwareSetResponse { + this := FirmwareSetResponse{} + return &this +} + +// GetRecord returns the Record field value if set, zero value otherwise. +func (o *FirmwareSetResponse) GetRecord() FirmwareSet { + if o == nil || IsNil(o.Record) { + var ret FirmwareSet + return ret + } + return *o.Record +} + +// GetRecordOk returns a tuple with the Record field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FirmwareSetResponse) GetRecordOk() (*FirmwareSet, bool) { + if o == nil || IsNil(o.Record) { + return nil, false + } + return o.Record, true +} + +// HasRecord returns a boolean if a field has been set. +func (o *FirmwareSetResponse) HasRecord() bool { + if o != nil && !IsNil(o.Record) { + return true + } + + return false +} + +// SetRecord gets a reference to the given FirmwareSet and assigns it to the Record field. +func (o *FirmwareSetResponse) SetRecord(v FirmwareSet) { + o.Record = &v +} + +func (o FirmwareSetResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FirmwareSetResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Record) { + toSerialize["record"] = o.Record + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FirmwareSetResponse) UnmarshalJSON(bytes []byte) (err error) { + varFirmwareSetResponse := _FirmwareSetResponse{} + + err = json.Unmarshal(bytes, &varFirmwareSetResponse) + + if err != nil { + return err + } + + *o = FirmwareSetResponse(varFirmwareSetResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "record") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFirmwareSetResponse struct { + value *FirmwareSetResponse + isSet bool +} + +func (v NullableFirmwareSetResponse) Get() *FirmwareSetResponse { + return v.value +} + +func (v *NullableFirmwareSetResponse) Set(val *FirmwareSetResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFirmwareSetResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFirmwareSetResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFirmwareSetResponse(val *FirmwareSetResponse) *NullableFirmwareSetResponse { + return &NullableFirmwareSetResponse{value: val, isSet: true} +} + +func (v NullableFirmwareSetResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFirmwareSetResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_global_bgp_range.go b/services/metalv1/model_global_bgp_range.go new file mode 100644 index 00000000..7085e5f6 --- /dev/null +++ b/services/metalv1/model_global_bgp_range.go @@ -0,0 +1,302 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the GlobalBgpRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GlobalBgpRange{} + +// GlobalBgpRange struct for GlobalBgpRange +type GlobalBgpRange struct { + AddressFamily *int32 `json:"address_family,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Project *Href `json:"project,omitempty"` + Range *string `json:"range,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GlobalBgpRange GlobalBgpRange + +// NewGlobalBgpRange instantiates a new GlobalBgpRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGlobalBgpRange() *GlobalBgpRange { + this := GlobalBgpRange{} + return &this +} + +// NewGlobalBgpRangeWithDefaults instantiates a new GlobalBgpRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGlobalBgpRangeWithDefaults() *GlobalBgpRange { + this := GlobalBgpRange{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *GlobalBgpRange) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRange) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *GlobalBgpRange) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *GlobalBgpRange) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *GlobalBgpRange) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRange) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *GlobalBgpRange) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *GlobalBgpRange) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *GlobalBgpRange) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRange) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *GlobalBgpRange) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *GlobalBgpRange) SetId(v string) { + o.Id = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *GlobalBgpRange) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRange) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *GlobalBgpRange) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *GlobalBgpRange) SetProject(v Href) { + o.Project = &v +} + +// GetRange returns the Range field value if set, zero value otherwise. +func (o *GlobalBgpRange) GetRange() string { + if o == nil || IsNil(o.Range) { + var ret string + return ret + } + return *o.Range +} + +// GetRangeOk returns a tuple with the Range field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRange) GetRangeOk() (*string, bool) { + if o == nil || IsNil(o.Range) { + return nil, false + } + return o.Range, true +} + +// HasRange returns a boolean if a field has been set. +func (o *GlobalBgpRange) HasRange() bool { + if o != nil && !IsNil(o.Range) { + return true + } + + return false +} + +// SetRange gets a reference to the given string and assigns it to the Range field. +func (o *GlobalBgpRange) SetRange(v string) { + o.Range = &v +} + +func (o GlobalBgpRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GlobalBgpRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Range) { + toSerialize["range"] = o.Range + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GlobalBgpRange) UnmarshalJSON(bytes []byte) (err error) { + varGlobalBgpRange := _GlobalBgpRange{} + + err = json.Unmarshal(bytes, &varGlobalBgpRange) + + if err != nil { + return err + } + + *o = GlobalBgpRange(varGlobalBgpRange) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "project") + delete(additionalProperties, "range") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGlobalBgpRange struct { + value *GlobalBgpRange + isSet bool +} + +func (v NullableGlobalBgpRange) Get() *GlobalBgpRange { + return v.value +} + +func (v *NullableGlobalBgpRange) Set(val *GlobalBgpRange) { + v.value = val + v.isSet = true +} + +func (v NullableGlobalBgpRange) IsSet() bool { + return v.isSet +} + +func (v *NullableGlobalBgpRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGlobalBgpRange(val *GlobalBgpRange) *NullableGlobalBgpRange { + return &NullableGlobalBgpRange{value: val, isSet: true} +} + +func (v NullableGlobalBgpRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGlobalBgpRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_global_bgp_range_list.go b/services/metalv1/model_global_bgp_range_list.go new file mode 100644 index 00000000..f2b0cba0 --- /dev/null +++ b/services/metalv1/model_global_bgp_range_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the GlobalBgpRangeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GlobalBgpRangeList{} + +// GlobalBgpRangeList struct for GlobalBgpRangeList +type GlobalBgpRangeList struct { + GlobalBgpRanges []GlobalBgpRange `json:"global_bgp_ranges,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GlobalBgpRangeList GlobalBgpRangeList + +// NewGlobalBgpRangeList instantiates a new GlobalBgpRangeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGlobalBgpRangeList() *GlobalBgpRangeList { + this := GlobalBgpRangeList{} + return &this +} + +// NewGlobalBgpRangeListWithDefaults instantiates a new GlobalBgpRangeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGlobalBgpRangeListWithDefaults() *GlobalBgpRangeList { + this := GlobalBgpRangeList{} + return &this +} + +// GetGlobalBgpRanges returns the GlobalBgpRanges field value if set, zero value otherwise. +func (o *GlobalBgpRangeList) GetGlobalBgpRanges() []GlobalBgpRange { + if o == nil || IsNil(o.GlobalBgpRanges) { + var ret []GlobalBgpRange + return ret + } + return o.GlobalBgpRanges +} + +// GetGlobalBgpRangesOk returns a tuple with the GlobalBgpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GlobalBgpRangeList) GetGlobalBgpRangesOk() ([]GlobalBgpRange, bool) { + if o == nil || IsNil(o.GlobalBgpRanges) { + return nil, false + } + return o.GlobalBgpRanges, true +} + +// HasGlobalBgpRanges returns a boolean if a field has been set. +func (o *GlobalBgpRangeList) HasGlobalBgpRanges() bool { + if o != nil && !IsNil(o.GlobalBgpRanges) { + return true + } + + return false +} + +// SetGlobalBgpRanges gets a reference to the given []GlobalBgpRange and assigns it to the GlobalBgpRanges field. +func (o *GlobalBgpRangeList) SetGlobalBgpRanges(v []GlobalBgpRange) { + o.GlobalBgpRanges = v +} + +func (o GlobalBgpRangeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GlobalBgpRangeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.GlobalBgpRanges) { + toSerialize["global_bgp_ranges"] = o.GlobalBgpRanges + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GlobalBgpRangeList) UnmarshalJSON(bytes []byte) (err error) { + varGlobalBgpRangeList := _GlobalBgpRangeList{} + + err = json.Unmarshal(bytes, &varGlobalBgpRangeList) + + if err != nil { + return err + } + + *o = GlobalBgpRangeList(varGlobalBgpRangeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "global_bgp_ranges") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGlobalBgpRangeList struct { + value *GlobalBgpRangeList + isSet bool +} + +func (v NullableGlobalBgpRangeList) Get() *GlobalBgpRangeList { + return v.value +} + +func (v *NullableGlobalBgpRangeList) Set(val *GlobalBgpRangeList) { + v.value = val + v.isSet = true +} + +func (v NullableGlobalBgpRangeList) IsSet() bool { + return v.isSet +} + +func (v *NullableGlobalBgpRangeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGlobalBgpRangeList(val *GlobalBgpRangeList) *NullableGlobalBgpRangeList { + return &NullableGlobalBgpRangeList{value: val, isSet: true} +} + +func (v NullableGlobalBgpRangeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGlobalBgpRangeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_hardware_reservation.go b/services/metalv1/model_hardware_reservation.go new file mode 100644 index 00000000..8af1d213 --- /dev/null +++ b/services/metalv1/model_hardware_reservation.go @@ -0,0 +1,643 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the HardwareReservation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HardwareReservation{} + +// HardwareReservation struct for HardwareReservation +type HardwareReservation struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + // Amount that will be charged for every billing_cycle. + CustomRate *float32 `json:"custom_rate,omitempty"` + Device *Device `json:"device,omitempty"` + Facility *Facility `json:"facility,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + // Whether this Device requires assistance from Equinix Metal. + NeedOfService *bool `json:"need_of_service,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Project *Project `json:"project,omitempty"` + // Whether the reserved server is provisionable or not. Spare devices can't be provisioned unless they are activated first. + Provisionable *bool `json:"provisionable,omitempty"` + // Short version of the ID. + ShortId *string `json:"short_id,omitempty"` + // Whether the Hardware Reservation is a spare. Spare Hardware Reservations are used when a Hardware Reservations requires service from Equinix Metal + Spare *bool `json:"spare,omitempty"` + // Switch short id. This can be used to determine if two devices are connected to the same switch, for example. + SwitchUuid *string `json:"switch_uuid,omitempty"` + // Expiration date for the reservation. + TerminationTime *time.Time `json:"termination_time,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _HardwareReservation HardwareReservation + +// NewHardwareReservation instantiates a new HardwareReservation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHardwareReservation() *HardwareReservation { + this := HardwareReservation{} + return &this +} + +// NewHardwareReservationWithDefaults instantiates a new HardwareReservation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHardwareReservationWithDefaults() *HardwareReservation { + this := HardwareReservation{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *HardwareReservation) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *HardwareReservation) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *HardwareReservation) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomRate returns the CustomRate field value if set, zero value otherwise. +func (o *HardwareReservation) GetCustomRate() float32 { + if o == nil || IsNil(o.CustomRate) { + var ret float32 + return ret + } + return *o.CustomRate +} + +// GetCustomRateOk returns a tuple with the CustomRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetCustomRateOk() (*float32, bool) { + if o == nil || IsNil(o.CustomRate) { + return nil, false + } + return o.CustomRate, true +} + +// HasCustomRate returns a boolean if a field has been set. +func (o *HardwareReservation) HasCustomRate() bool { + if o != nil && !IsNil(o.CustomRate) { + return true + } + + return false +} + +// SetCustomRate gets a reference to the given float32 and assigns it to the CustomRate field. +func (o *HardwareReservation) SetCustomRate(v float32) { + o.CustomRate = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *HardwareReservation) GetDevice() Device { + if o == nil || IsNil(o.Device) { + var ret Device + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetDeviceOk() (*Device, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *HardwareReservation) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given Device and assigns it to the Device field. +func (o *HardwareReservation) SetDevice(v Device) { + o.Device = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *HardwareReservation) GetFacility() Facility { + if o == nil || IsNil(o.Facility) { + var ret Facility + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetFacilityOk() (*Facility, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *HardwareReservation) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given Facility and assigns it to the Facility field. +func (o *HardwareReservation) SetFacility(v Facility) { + o.Facility = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *HardwareReservation) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *HardwareReservation) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *HardwareReservation) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *HardwareReservation) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *HardwareReservation) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *HardwareReservation) SetId(v string) { + o.Id = &v +} + +// GetNeedOfService returns the NeedOfService field value if set, zero value otherwise. +func (o *HardwareReservation) GetNeedOfService() bool { + if o == nil || IsNil(o.NeedOfService) { + var ret bool + return ret + } + return *o.NeedOfService +} + +// GetNeedOfServiceOk returns a tuple with the NeedOfService field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetNeedOfServiceOk() (*bool, bool) { + if o == nil || IsNil(o.NeedOfService) { + return nil, false + } + return o.NeedOfService, true +} + +// HasNeedOfService returns a boolean if a field has been set. +func (o *HardwareReservation) HasNeedOfService() bool { + if o != nil && !IsNil(o.NeedOfService) { + return true + } + + return false +} + +// SetNeedOfService gets a reference to the given bool and assigns it to the NeedOfService field. +func (o *HardwareReservation) SetNeedOfService(v bool) { + o.NeedOfService = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *HardwareReservation) GetPlan() Plan { + if o == nil || IsNil(o.Plan) { + var ret Plan + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetPlanOk() (*Plan, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *HardwareReservation) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given Plan and assigns it to the Plan field. +func (o *HardwareReservation) SetPlan(v Plan) { + o.Plan = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *HardwareReservation) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *HardwareReservation) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *HardwareReservation) SetProject(v Project) { + o.Project = &v +} + +// GetProvisionable returns the Provisionable field value if set, zero value otherwise. +func (o *HardwareReservation) GetProvisionable() bool { + if o == nil || IsNil(o.Provisionable) { + var ret bool + return ret + } + return *o.Provisionable +} + +// GetProvisionableOk returns a tuple with the Provisionable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetProvisionableOk() (*bool, bool) { + if o == nil || IsNil(o.Provisionable) { + return nil, false + } + return o.Provisionable, true +} + +// HasProvisionable returns a boolean if a field has been set. +func (o *HardwareReservation) HasProvisionable() bool { + if o != nil && !IsNil(o.Provisionable) { + return true + } + + return false +} + +// SetProvisionable gets a reference to the given bool and assigns it to the Provisionable field. +func (o *HardwareReservation) SetProvisionable(v bool) { + o.Provisionable = &v +} + +// GetShortId returns the ShortId field value if set, zero value otherwise. +func (o *HardwareReservation) GetShortId() string { + if o == nil || IsNil(o.ShortId) { + var ret string + return ret + } + return *o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetShortIdOk() (*string, bool) { + if o == nil || IsNil(o.ShortId) { + return nil, false + } + return o.ShortId, true +} + +// HasShortId returns a boolean if a field has been set. +func (o *HardwareReservation) HasShortId() bool { + if o != nil && !IsNil(o.ShortId) { + return true + } + + return false +} + +// SetShortId gets a reference to the given string and assigns it to the ShortId field. +func (o *HardwareReservation) SetShortId(v string) { + o.ShortId = &v +} + +// GetSpare returns the Spare field value if set, zero value otherwise. +func (o *HardwareReservation) GetSpare() bool { + if o == nil || IsNil(o.Spare) { + var ret bool + return ret + } + return *o.Spare +} + +// GetSpareOk returns a tuple with the Spare field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetSpareOk() (*bool, bool) { + if o == nil || IsNil(o.Spare) { + return nil, false + } + return o.Spare, true +} + +// HasSpare returns a boolean if a field has been set. +func (o *HardwareReservation) HasSpare() bool { + if o != nil && !IsNil(o.Spare) { + return true + } + + return false +} + +// SetSpare gets a reference to the given bool and assigns it to the Spare field. +func (o *HardwareReservation) SetSpare(v bool) { + o.Spare = &v +} + +// GetSwitchUuid returns the SwitchUuid field value if set, zero value otherwise. +func (o *HardwareReservation) GetSwitchUuid() string { + if o == nil || IsNil(o.SwitchUuid) { + var ret string + return ret + } + return *o.SwitchUuid +} + +// GetSwitchUuidOk returns a tuple with the SwitchUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetSwitchUuidOk() (*string, bool) { + if o == nil || IsNil(o.SwitchUuid) { + return nil, false + } + return o.SwitchUuid, true +} + +// HasSwitchUuid returns a boolean if a field has been set. +func (o *HardwareReservation) HasSwitchUuid() bool { + if o != nil && !IsNil(o.SwitchUuid) { + return true + } + + return false +} + +// SetSwitchUuid gets a reference to the given string and assigns it to the SwitchUuid field. +func (o *HardwareReservation) SetSwitchUuid(v string) { + o.SwitchUuid = &v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *HardwareReservation) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservation) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *HardwareReservation) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *HardwareReservation) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +func (o HardwareReservation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HardwareReservation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CustomRate) { + toSerialize["custom_rate"] = o.CustomRate + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.NeedOfService) { + toSerialize["need_of_service"] = o.NeedOfService + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Provisionable) { + toSerialize["provisionable"] = o.Provisionable + } + if !IsNil(o.ShortId) { + toSerialize["short_id"] = o.ShortId + } + if !IsNil(o.Spare) { + toSerialize["spare"] = o.Spare + } + if !IsNil(o.SwitchUuid) { + toSerialize["switch_uuid"] = o.SwitchUuid + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *HardwareReservation) UnmarshalJSON(bytes []byte) (err error) { + varHardwareReservation := _HardwareReservation{} + + err = json.Unmarshal(bytes, &varHardwareReservation) + + if err != nil { + return err + } + + *o = HardwareReservation(varHardwareReservation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "custom_rate") + delete(additionalProperties, "device") + delete(additionalProperties, "facility") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "need_of_service") + delete(additionalProperties, "plan") + delete(additionalProperties, "project") + delete(additionalProperties, "provisionable") + delete(additionalProperties, "short_id") + delete(additionalProperties, "spare") + delete(additionalProperties, "switch_uuid") + delete(additionalProperties, "termination_time") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHardwareReservation struct { + value *HardwareReservation + isSet bool +} + +func (v NullableHardwareReservation) Get() *HardwareReservation { + return v.value +} + +func (v *NullableHardwareReservation) Set(val *HardwareReservation) { + v.value = val + v.isSet = true +} + +func (v NullableHardwareReservation) IsSet() bool { + return v.isSet +} + +func (v *NullableHardwareReservation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHardwareReservation(val *HardwareReservation) *NullableHardwareReservation { + return &NullableHardwareReservation{value: val, isSet: true} +} + +func (v NullableHardwareReservation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHardwareReservation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_hardware_reservation_list.go b/services/metalv1/model_hardware_reservation_list.go new file mode 100644 index 00000000..f7f6a771 --- /dev/null +++ b/services/metalv1/model_hardware_reservation_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the HardwareReservationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HardwareReservationList{} + +// HardwareReservationList struct for HardwareReservationList +type HardwareReservationList struct { + HardwareReservations []HardwareReservation `json:"hardware_reservations,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _HardwareReservationList HardwareReservationList + +// NewHardwareReservationList instantiates a new HardwareReservationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHardwareReservationList() *HardwareReservationList { + this := HardwareReservationList{} + return &this +} + +// NewHardwareReservationListWithDefaults instantiates a new HardwareReservationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHardwareReservationListWithDefaults() *HardwareReservationList { + this := HardwareReservationList{} + return &this +} + +// GetHardwareReservations returns the HardwareReservations field value if set, zero value otherwise. +func (o *HardwareReservationList) GetHardwareReservations() []HardwareReservation { + if o == nil || IsNil(o.HardwareReservations) { + var ret []HardwareReservation + return ret + } + return o.HardwareReservations +} + +// GetHardwareReservationsOk returns a tuple with the HardwareReservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservationList) GetHardwareReservationsOk() ([]HardwareReservation, bool) { + if o == nil || IsNil(o.HardwareReservations) { + return nil, false + } + return o.HardwareReservations, true +} + +// HasHardwareReservations returns a boolean if a field has been set. +func (o *HardwareReservationList) HasHardwareReservations() bool { + if o != nil && !IsNil(o.HardwareReservations) { + return true + } + + return false +} + +// SetHardwareReservations gets a reference to the given []HardwareReservation and assigns it to the HardwareReservations field. +func (o *HardwareReservationList) SetHardwareReservations(v []HardwareReservation) { + o.HardwareReservations = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *HardwareReservationList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareReservationList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *HardwareReservationList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *HardwareReservationList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o HardwareReservationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HardwareReservationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HardwareReservations) { + toSerialize["hardware_reservations"] = o.HardwareReservations + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *HardwareReservationList) UnmarshalJSON(bytes []byte) (err error) { + varHardwareReservationList := _HardwareReservationList{} + + err = json.Unmarshal(bytes, &varHardwareReservationList) + + if err != nil { + return err + } + + *o = HardwareReservationList(varHardwareReservationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "hardware_reservations") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHardwareReservationList struct { + value *HardwareReservationList + isSet bool +} + +func (v NullableHardwareReservationList) Get() *HardwareReservationList { + return v.value +} + +func (v *NullableHardwareReservationList) Set(val *HardwareReservationList) { + v.value = val + v.isSet = true +} + +func (v NullableHardwareReservationList) IsSet() bool { + return v.isSet +} + +func (v *NullableHardwareReservationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHardwareReservationList(val *HardwareReservationList) *NullableHardwareReservationList { + return &NullableHardwareReservationList{value: val, isSet: true} +} + +func (v NullableHardwareReservationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHardwareReservationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_href.go b/services/metalv1/model_href.go new file mode 100644 index 00000000..76ea26ee --- /dev/null +++ b/services/metalv1/model_href.go @@ -0,0 +1,167 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the Href type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Href{} + +// Href struct for Href +type Href struct { + Href string `json:"href"` + AdditionalProperties map[string]interface{} +} + +type _Href Href + +// NewHref instantiates a new Href object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHref(href string) *Href { + this := Href{} + this.Href = href + return &this +} + +// NewHrefWithDefaults instantiates a new Href object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHrefWithDefaults() *Href { + this := Href{} + return &this +} + +// GetHref returns the Href field value +func (o *Href) GetHref() string { + if o == nil { + var ret string + return ret + } + + return o.Href +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +func (o *Href) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Href, true +} + +// SetHref sets field value +func (o *Href) SetHref(v string) { + o.Href = v +} + +func (o Href) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Href) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["href"] = o.Href + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Href) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "href", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHref := _Href{} + + err = json.Unmarshal(bytes, &varHref) + + if err != nil { + return err + } + + *o = Href(varHref) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "href") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHref struct { + value *Href + isSet bool +} + +func (v NullableHref) Get() *Href { + return v.value +} + +func (v *NullableHref) Set(val *Href) { + v.value = val + v.isSet = true +} + +func (v NullableHref) IsSet() bool { + return v.isSet +} + +func (v *NullableHref) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHref(val *Href) *NullableHref { + return &NullableHref{value: val, isSet: true} +} + +func (v NullableHref) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHref) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_instances_batch_create_input.go b/services/metalv1/model_instances_batch_create_input.go new file mode 100644 index 00000000..101d2090 --- /dev/null +++ b/services/metalv1/model_instances_batch_create_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InstancesBatchCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstancesBatchCreateInput{} + +// InstancesBatchCreateInput struct for InstancesBatchCreateInput +type InstancesBatchCreateInput struct { + Batches []InstancesBatchCreateInputBatchesInner `json:"batches,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InstancesBatchCreateInput InstancesBatchCreateInput + +// NewInstancesBatchCreateInput instantiates a new InstancesBatchCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstancesBatchCreateInput() *InstancesBatchCreateInput { + this := InstancesBatchCreateInput{} + return &this +} + +// NewInstancesBatchCreateInputWithDefaults instantiates a new InstancesBatchCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstancesBatchCreateInputWithDefaults() *InstancesBatchCreateInput { + this := InstancesBatchCreateInput{} + return &this +} + +// GetBatches returns the Batches field value if set, zero value otherwise. +func (o *InstancesBatchCreateInput) GetBatches() []InstancesBatchCreateInputBatchesInner { + if o == nil || IsNil(o.Batches) { + var ret []InstancesBatchCreateInputBatchesInner + return ret + } + return o.Batches +} + +// GetBatchesOk returns a tuple with the Batches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInput) GetBatchesOk() ([]InstancesBatchCreateInputBatchesInner, bool) { + if o == nil || IsNil(o.Batches) { + return nil, false + } + return o.Batches, true +} + +// HasBatches returns a boolean if a field has been set. +func (o *InstancesBatchCreateInput) HasBatches() bool { + if o != nil && !IsNil(o.Batches) { + return true + } + + return false +} + +// SetBatches gets a reference to the given []InstancesBatchCreateInputBatchesInner and assigns it to the Batches field. +func (o *InstancesBatchCreateInput) SetBatches(v []InstancesBatchCreateInputBatchesInner) { + o.Batches = v +} + +func (o InstancesBatchCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstancesBatchCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Batches) { + toSerialize["batches"] = o.Batches + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstancesBatchCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varInstancesBatchCreateInput := _InstancesBatchCreateInput{} + + err = json.Unmarshal(bytes, &varInstancesBatchCreateInput) + + if err != nil { + return err + } + + *o = InstancesBatchCreateInput(varInstancesBatchCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "batches") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstancesBatchCreateInput struct { + value *InstancesBatchCreateInput + isSet bool +} + +func (v NullableInstancesBatchCreateInput) Get() *InstancesBatchCreateInput { + return v.value +} + +func (v *NullableInstancesBatchCreateInput) Set(val *InstancesBatchCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableInstancesBatchCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableInstancesBatchCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstancesBatchCreateInput(val *InstancesBatchCreateInput) *NullableInstancesBatchCreateInput { + return &NullableInstancesBatchCreateInput{value: val, isSet: true} +} + +func (v NullableInstancesBatchCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstancesBatchCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_instances_batch_create_input_batches_inner.go b/services/metalv1/model_instances_batch_create_input_batches_inner.go new file mode 100644 index 00000000..de894310 --- /dev/null +++ b/services/metalv1/model_instances_batch_create_input_batches_inner.go @@ -0,0 +1,1233 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InstancesBatchCreateInputBatchesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstancesBatchCreateInputBatchesInner{} + +// InstancesBatchCreateInputBatchesInner struct for InstancesBatchCreateInputBatchesInner +type InstancesBatchCreateInputBatchesInner struct { + Hostnames []string `json:"hostnames,omitempty"` + // The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. + Quantity *int32 `json:"quantity,omitempty"` + // Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. + Metro string `json:"metro"` + // When true, devices with a `custom_ipxe` OS will always boot to iPXE. The default setting of false ensures that iPXE will be used on only the first boot. + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *DeviceCreateInputBillingCycle `json:"billing_cycle,omitempty"` + // Customdata is an arbitrary JSON value that can be accessed via the metadata service. + Customdata map[string]interface{} `json:"customdata,omitempty"` + // Any description of the device or how it will be used. This may be used to inform other API consumers with project access. + Description *string `json:"description,omitempty"` + // The features attribute allows you to optionally specify what features your server should have. In the API shorthand syntax, all features listed are `required`: ``` { \"features\": [\"tpm\"] } ``` Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: ``` { \"features\": { \"tpm\": \"required\", \"raid\": \"preferred\" } } ``` The request will only fail if there are no available servers matching the required `tpm` criteria. + Features []string `json:"features,omitempty"` + // The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + HardwareReservationId *string `json:"hardware_reservation_id,omitempty"` + // The hostname to use within the operating system. The same hostname may be used on multiple devices within a project. + Hostname *string `json:"hostname,omitempty"` + // The `ip_addresses attribute will allow you to specify the addresses you want created with your device. The default value configures public IPv4, public IPv6, and private IPv4. Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. For example, to only configure your server with a private IPv4 address, you can send `{ \"ip_addresses\": [{ \"address_family\": 4, \"public\": false }] }`. It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. For example, `{ \"ip_addresses\": [..., {\"address_family\": 4, \"public\": true, \"ip_reservations\": [\"uuid1\", \"uuid2\"]}] }` To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + IpAddresses []IPAddress `json:"ip_addresses,omitempty"` + // When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + IpxeScriptUrl *string `json:"ipxe_script_url,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + // If true, this instance can not be converted to a different network type. + NetworkFrozen *bool `json:"network_frozen,omitempty"` + // Overrides default behaviour of attaching all of the organization members ssh keys and project ssh keys to device if no specific keys specified + NoSshKeys *bool `json:"no_ssh_keys,omitempty"` + // The slug of the operating system to provision. Check the Equinix Metal operating system documentation for rules that may be imposed per operating system, including restrictions on IP address options and device plans. + OperatingSystem string `json:"operating_system"` + // The slug of the device plan to provision. + Plan string `json:"plan"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + // A list of UUIDs identifying the device parent project that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + ProjectSshKeys []string `json:"project_ssh_keys,omitempty"` + // Deprecated. Use ip_addresses. Subnet range for addresses allocated to this device. Your project must have addresses available for a non-default request. + PublicIpv4SubnetSize *int32 `json:"public_ipv4_subnet_size,omitempty"` + // Create a spot instance. Spot instances are created with a maximum bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + SpotInstance *bool `json:"spot_instance,omitempty"` + // The maximum amount to bid for a spot instance. + SpotPriceMax *float32 `json:"spot_price_max,omitempty"` + // A list of new or existing project ssh_keys that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. These keys are added in addition to any keys defined by `project_ssh_keys` and `user_ssh_keys`. + SshKeys []SSHKeyInput `json:"ssh_keys,omitempty"` + Storage *Storage `json:"storage,omitempty"` + Tags []string `json:"tags,omitempty"` + // When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. This is commonly set in advance for ephemeral spot market instances but this field may also be set with on-demand and reservation instances to automatically delete the resource at a given time. The termination time can also be used to release a hardware reservation instance at a given time, keeping the reservation open for other uses. On a spot market device, the termination time will be set automatically when outbid. + TerminationTime *time.Time `json:"termination_time,omitempty"` + // A list of UUIDs identifying the users that should be authorized to access this device (typically via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. The users must be members of the project or organization. If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), all parent project keys, parent project members keys and organization members keys will be included. This behaviour can be changed with 'no_ssh_keys' option to omit any SSH key being added. + UserSshKeys []string `json:"user_ssh_keys,omitempty"` + // The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + Userdata *string `json:"userdata,omitempty"` + // The datacenter where the device should be created. Either metro or facility must be provided. The API will accept either a single facility `{ \"facility\": \"f1\" }`, or it can be instructed to create the device in the best available datacenter `{ \"facility\": \"any\" }`. Additionally it is possible to set a prioritized location selection. For example `{ \"facility\": [\"f3\", \"f2\", \"any\"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + // Deprecated + Facility []string `json:"facility"` + AdditionalProperties map[string]interface{} +} + +type _InstancesBatchCreateInputBatchesInner InstancesBatchCreateInputBatchesInner + +// NewInstancesBatchCreateInputBatchesInner instantiates a new InstancesBatchCreateInputBatchesInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstancesBatchCreateInputBatchesInner(metro string, operatingSystem string, plan string, facility []string) *InstancesBatchCreateInputBatchesInner { + this := InstancesBatchCreateInputBatchesInner{} + this.Metro = metro + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + this.OperatingSystem = operatingSystem + this.Plan = plan + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + this.Facility = facility + return &this +} + +// NewInstancesBatchCreateInputBatchesInnerWithDefaults instantiates a new InstancesBatchCreateInputBatchesInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstancesBatchCreateInputBatchesInnerWithDefaults() *InstancesBatchCreateInputBatchesInner { + this := InstancesBatchCreateInputBatchesInner{} + var alwaysPxe bool = false + this.AlwaysPxe = &alwaysPxe + var hardwareReservationId string = "" + this.HardwareReservationId = &hardwareReservationId + var locked bool = false + this.Locked = &locked + var noSshKeys bool = false + this.NoSshKeys = &noSshKeys + var privateIpv4SubnetSize int32 = 28 + this.PrivateIpv4SubnetSize = &privateIpv4SubnetSize + var publicIpv4SubnetSize int32 = 31 + this.PublicIpv4SubnetSize = &publicIpv4SubnetSize + return &this +} + +// GetHostnames returns the Hostnames field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetHostnames() []string { + if o == nil || IsNil(o.Hostnames) { + var ret []string + return ret + } + return o.Hostnames +} + +// GetHostnamesOk returns a tuple with the Hostnames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetHostnamesOk() ([]string, bool) { + if o == nil || IsNil(o.Hostnames) { + return nil, false + } + return o.Hostnames, true +} + +// HasHostnames returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasHostnames() bool { + if o != nil && !IsNil(o.Hostnames) { + return true + } + + return false +} + +// SetHostnames gets a reference to the given []string and assigns it to the Hostnames field. +func (o *InstancesBatchCreateInputBatchesInner) SetHostnames(v []string) { + o.Hostnames = v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *InstancesBatchCreateInputBatchesInner) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetMetro returns the Metro field value +func (o *InstancesBatchCreateInputBatchesInner) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *InstancesBatchCreateInputBatchesInner) SetMetro(v string) { + o.Metro = v +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *InstancesBatchCreateInputBatchesInner) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetBillingCycle() DeviceCreateInputBillingCycle { + if o == nil || IsNil(o.BillingCycle) { + var ret DeviceCreateInputBillingCycle + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetBillingCycleOk() (*DeviceCreateInputBillingCycle, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given DeviceCreateInputBillingCycle and assigns it to the BillingCycle field. +func (o *InstancesBatchCreateInputBatchesInner) SetBillingCycle(v DeviceCreateInputBillingCycle) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *InstancesBatchCreateInputBatchesInner) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InstancesBatchCreateInputBatchesInner) SetDescription(v string) { + o.Description = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetFeatures() []string { + if o == nil || IsNil(o.Features) { + var ret []string + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetFeaturesOk() ([]string, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []string and assigns it to the Features field. +func (o *InstancesBatchCreateInputBatchesInner) SetFeatures(v []string) { + o.Features = v +} + +// GetHardwareReservationId returns the HardwareReservationId field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetHardwareReservationId() string { + if o == nil || IsNil(o.HardwareReservationId) { + var ret string + return ret + } + return *o.HardwareReservationId +} + +// GetHardwareReservationIdOk returns a tuple with the HardwareReservationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetHardwareReservationIdOk() (*string, bool) { + if o == nil || IsNil(o.HardwareReservationId) { + return nil, false + } + return o.HardwareReservationId, true +} + +// HasHardwareReservationId returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasHardwareReservationId() bool { + if o != nil && !IsNil(o.HardwareReservationId) { + return true + } + + return false +} + +// SetHardwareReservationId gets a reference to the given string and assigns it to the HardwareReservationId field. +func (o *InstancesBatchCreateInputBatchesInner) SetHardwareReservationId(v string) { + o.HardwareReservationId = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *InstancesBatchCreateInputBatchesInner) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetIpAddresses() []IPAddress { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAddress + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetIpAddressesOk() ([]IPAddress, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAddress and assigns it to the IpAddresses field. +func (o *InstancesBatchCreateInputBatchesInner) SetIpAddresses(v []IPAddress) { + o.IpAddresses = v +} + +// GetIpxeScriptUrl returns the IpxeScriptUrl field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetIpxeScriptUrl() string { + if o == nil || IsNil(o.IpxeScriptUrl) { + var ret string + return ret + } + return *o.IpxeScriptUrl +} + +// GetIpxeScriptUrlOk returns a tuple with the IpxeScriptUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetIpxeScriptUrlOk() (*string, bool) { + if o == nil || IsNil(o.IpxeScriptUrl) { + return nil, false + } + return o.IpxeScriptUrl, true +} + +// HasIpxeScriptUrl returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasIpxeScriptUrl() bool { + if o != nil && !IsNil(o.IpxeScriptUrl) { + return true + } + + return false +} + +// SetIpxeScriptUrl gets a reference to the given string and assigns it to the IpxeScriptUrl field. +func (o *InstancesBatchCreateInputBatchesInner) SetIpxeScriptUrl(v string) { + o.IpxeScriptUrl = &v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *InstancesBatchCreateInputBatchesInner) SetLocked(v bool) { + o.Locked = &v +} + +// GetNetworkFrozen returns the NetworkFrozen field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetNetworkFrozen() bool { + if o == nil || IsNil(o.NetworkFrozen) { + var ret bool + return ret + } + return *o.NetworkFrozen +} + +// GetNetworkFrozenOk returns a tuple with the NetworkFrozen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetNetworkFrozenOk() (*bool, bool) { + if o == nil || IsNil(o.NetworkFrozen) { + return nil, false + } + return o.NetworkFrozen, true +} + +// HasNetworkFrozen returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasNetworkFrozen() bool { + if o != nil && !IsNil(o.NetworkFrozen) { + return true + } + + return false +} + +// SetNetworkFrozen gets a reference to the given bool and assigns it to the NetworkFrozen field. +func (o *InstancesBatchCreateInputBatchesInner) SetNetworkFrozen(v bool) { + o.NetworkFrozen = &v +} + +// GetNoSshKeys returns the NoSshKeys field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetNoSshKeys() bool { + if o == nil || IsNil(o.NoSshKeys) { + var ret bool + return ret + } + return *o.NoSshKeys +} + +// GetNoSshKeysOk returns a tuple with the NoSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetNoSshKeysOk() (*bool, bool) { + if o == nil || IsNil(o.NoSshKeys) { + return nil, false + } + return o.NoSshKeys, true +} + +// HasNoSshKeys returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasNoSshKeys() bool { + if o != nil && !IsNil(o.NoSshKeys) { + return true + } + + return false +} + +// SetNoSshKeys gets a reference to the given bool and assigns it to the NoSshKeys field. +func (o *InstancesBatchCreateInputBatchesInner) SetNoSshKeys(v bool) { + o.NoSshKeys = &v +} + +// GetOperatingSystem returns the OperatingSystem field value +func (o *InstancesBatchCreateInputBatchesInner) GetOperatingSystem() string { + if o == nil { + var ret string + return ret + } + + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetOperatingSystemOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OperatingSystem, true +} + +// SetOperatingSystem sets field value +func (o *InstancesBatchCreateInputBatchesInner) SetOperatingSystem(v string) { + o.OperatingSystem = v +} + +// GetPlan returns the Plan field value +func (o *InstancesBatchCreateInputBatchesInner) GetPlan() string { + if o == nil { + var ret string + return ret + } + + return o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetPlanOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Plan, true +} + +// SetPlan sets field value +func (o *InstancesBatchCreateInputBatchesInner) SetPlan(v string) { + o.Plan = v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *InstancesBatchCreateInputBatchesInner) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetProjectSshKeys returns the ProjectSshKeys field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetProjectSshKeys() []string { + if o == nil || IsNil(o.ProjectSshKeys) { + var ret []string + return ret + } + return o.ProjectSshKeys +} + +// GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetProjectSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectSshKeys) { + return nil, false + } + return o.ProjectSshKeys, true +} + +// HasProjectSshKeys returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasProjectSshKeys() bool { + if o != nil && !IsNil(o.ProjectSshKeys) { + return true + } + + return false +} + +// SetProjectSshKeys gets a reference to the given []string and assigns it to the ProjectSshKeys field. +func (o *InstancesBatchCreateInputBatchesInner) SetProjectSshKeys(v []string) { + o.ProjectSshKeys = v +} + +// GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetPublicIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PublicIpv4SubnetSize +} + +// GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetPublicIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + return nil, false + } + return o.PublicIpv4SubnetSize, true +} + +// HasPublicIpv4SubnetSize returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasPublicIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PublicIpv4SubnetSize) { + return true + } + + return false +} + +// SetPublicIpv4SubnetSize gets a reference to the given int32 and assigns it to the PublicIpv4SubnetSize field. +func (o *InstancesBatchCreateInputBatchesInner) SetPublicIpv4SubnetSize(v int32) { + o.PublicIpv4SubnetSize = &v +} + +// GetSpotInstance returns the SpotInstance field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetSpotInstance() bool { + if o == nil || IsNil(o.SpotInstance) { + var ret bool + return ret + } + return *o.SpotInstance +} + +// GetSpotInstanceOk returns a tuple with the SpotInstance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetSpotInstanceOk() (*bool, bool) { + if o == nil || IsNil(o.SpotInstance) { + return nil, false + } + return o.SpotInstance, true +} + +// HasSpotInstance returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasSpotInstance() bool { + if o != nil && !IsNil(o.SpotInstance) { + return true + } + + return false +} + +// SetSpotInstance gets a reference to the given bool and assigns it to the SpotInstance field. +func (o *InstancesBatchCreateInputBatchesInner) SetSpotInstance(v bool) { + o.SpotInstance = &v +} + +// GetSpotPriceMax returns the SpotPriceMax field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetSpotPriceMax() float32 { + if o == nil || IsNil(o.SpotPriceMax) { + var ret float32 + return ret + } + return *o.SpotPriceMax +} + +// GetSpotPriceMaxOk returns a tuple with the SpotPriceMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetSpotPriceMaxOk() (*float32, bool) { + if o == nil || IsNil(o.SpotPriceMax) { + return nil, false + } + return o.SpotPriceMax, true +} + +// HasSpotPriceMax returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasSpotPriceMax() bool { + if o != nil && !IsNil(o.SpotPriceMax) { + return true + } + + return false +} + +// SetSpotPriceMax gets a reference to the given float32 and assigns it to the SpotPriceMax field. +func (o *InstancesBatchCreateInputBatchesInner) SetSpotPriceMax(v float32) { + o.SpotPriceMax = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetSshKeys() []SSHKeyInput { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKeyInput + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetSshKeysOk() ([]SSHKeyInput, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKeyInput and assigns it to the SshKeys field. +func (o *InstancesBatchCreateInputBatchesInner) SetSshKeys(v []SSHKeyInput) { + o.SshKeys = v +} + +// GetStorage returns the Storage field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetStorage() Storage { + if o == nil || IsNil(o.Storage) { + var ret Storage + return ret + } + return *o.Storage +} + +// GetStorageOk returns a tuple with the Storage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetStorageOk() (*Storage, bool) { + if o == nil || IsNil(o.Storage) { + return nil, false + } + return o.Storage, true +} + +// HasStorage returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasStorage() bool { + if o != nil && !IsNil(o.Storage) { + return true + } + + return false +} + +// SetStorage gets a reference to the given Storage and assigns it to the Storage field. +func (o *InstancesBatchCreateInputBatchesInner) SetStorage(v Storage) { + o.Storage = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *InstancesBatchCreateInputBatchesInner) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *InstancesBatchCreateInputBatchesInner) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUserSshKeys returns the UserSshKeys field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetUserSshKeys() []string { + if o == nil || IsNil(o.UserSshKeys) { + var ret []string + return ret + } + return o.UserSshKeys +} + +// GetUserSshKeysOk returns a tuple with the UserSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetUserSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.UserSshKeys) { + return nil, false + } + return o.UserSshKeys, true +} + +// HasUserSshKeys returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasUserSshKeys() bool { + if o != nil && !IsNil(o.UserSshKeys) { + return true + } + + return false +} + +// SetUserSshKeys gets a reference to the given []string and assigns it to the UserSshKeys field. +func (o *InstancesBatchCreateInputBatchesInner) SetUserSshKeys(v []string) { + o.UserSshKeys = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *InstancesBatchCreateInputBatchesInner) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InstancesBatchCreateInputBatchesInner) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *InstancesBatchCreateInputBatchesInner) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *InstancesBatchCreateInputBatchesInner) SetUserdata(v string) { + o.Userdata = &v +} + +// GetFacility returns the Facility field value +// Deprecated +func (o *InstancesBatchCreateInputBatchesInner) GetFacility() []string { + if o == nil { + var ret []string + return ret + } + + return o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *InstancesBatchCreateInputBatchesInner) GetFacilityOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Facility, true +} + +// SetFacility sets field value +// Deprecated +func (o *InstancesBatchCreateInputBatchesInner) SetFacility(v []string) { + o.Facility = v +} + +func (o InstancesBatchCreateInputBatchesInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstancesBatchCreateInputBatchesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hostnames) { + toSerialize["hostnames"] = o.Hostnames + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + toSerialize["metro"] = o.Metro + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.HardwareReservationId) { + toSerialize["hardware_reservation_id"] = o.HardwareReservationId + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.IpxeScriptUrl) { + toSerialize["ipxe_script_url"] = o.IpxeScriptUrl + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NetworkFrozen) { + toSerialize["network_frozen"] = o.NetworkFrozen + } + if !IsNil(o.NoSshKeys) { + toSerialize["no_ssh_keys"] = o.NoSshKeys + } + toSerialize["operating_system"] = o.OperatingSystem + toSerialize["plan"] = o.Plan + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + if !IsNil(o.ProjectSshKeys) { + toSerialize["project_ssh_keys"] = o.ProjectSshKeys + } + if !IsNil(o.PublicIpv4SubnetSize) { + toSerialize["public_ipv4_subnet_size"] = o.PublicIpv4SubnetSize + } + if !IsNil(o.SpotInstance) { + toSerialize["spot_instance"] = o.SpotInstance + } + if !IsNil(o.SpotPriceMax) { + toSerialize["spot_price_max"] = o.SpotPriceMax + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.Storage) { + toSerialize["storage"] = o.Storage + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UserSshKeys) { + toSerialize["user_ssh_keys"] = o.UserSshKeys + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + toSerialize["facility"] = o.Facility + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstancesBatchCreateInputBatchesInner) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "operating_system", + "plan", + "facility", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstancesBatchCreateInputBatchesInner := _InstancesBatchCreateInputBatchesInner{} + + err = json.Unmarshal(bytes, &varInstancesBatchCreateInputBatchesInner) + + if err != nil { + return err + } + + *o = InstancesBatchCreateInputBatchesInner(varInstancesBatchCreateInputBatchesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "hostnames") + delete(additionalProperties, "quantity") + delete(additionalProperties, "metro") + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "features") + delete(additionalProperties, "hardware_reservation_id") + delete(additionalProperties, "hostname") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "ipxe_script_url") + delete(additionalProperties, "locked") + delete(additionalProperties, "network_frozen") + delete(additionalProperties, "no_ssh_keys") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "project_ssh_keys") + delete(additionalProperties, "public_ipv4_subnet_size") + delete(additionalProperties, "spot_instance") + delete(additionalProperties, "spot_price_max") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "storage") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "user_ssh_keys") + delete(additionalProperties, "userdata") + delete(additionalProperties, "facility") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstancesBatchCreateInputBatchesInner struct { + value *InstancesBatchCreateInputBatchesInner + isSet bool +} + +func (v NullableInstancesBatchCreateInputBatchesInner) Get() *InstancesBatchCreateInputBatchesInner { + return v.value +} + +func (v *NullableInstancesBatchCreateInputBatchesInner) Set(val *InstancesBatchCreateInputBatchesInner) { + v.value = val + v.isSet = true +} + +func (v NullableInstancesBatchCreateInputBatchesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInstancesBatchCreateInputBatchesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstancesBatchCreateInputBatchesInner(val *InstancesBatchCreateInputBatchesInner) *NullableInstancesBatchCreateInputBatchesInner { + return &NullableInstancesBatchCreateInputBatchesInner{value: val, isSet: true} +} + +func (v NullableInstancesBatchCreateInputBatchesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstancesBatchCreateInputBatchesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection.go b/services/metalv1/model_interconnection.go new file mode 100644 index 00000000..1a80b37e --- /dev/null +++ b/services/metalv1/model_interconnection.go @@ -0,0 +1,825 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Interconnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Interconnection{} + +// Interconnection struct for Interconnection +type Interconnection struct { + ContactEmail *string `json:"contact_email,omitempty"` + Description *string `json:"description,omitempty"` + Facility *Href `json:"facility,omitempty"` + Id *string `json:"id,omitempty"` + Metro *Metro `json:"metro,omitempty"` + Mode *InterconnectionMode `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + Organization *Href `json:"organization,omitempty"` + // For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). + Ports []InterconnectionPort `json:"ports,omitempty"` + Redundancy *InterconnectionRedundancy `json:"redundancy,omitempty"` + // For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. + ServiceTokens []FabricServiceToken `json:"service_tokens,omitempty"` + // For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). + Speed *int32 `json:"speed,omitempty"` + Status *string `json:"status,omitempty"` + Tags []string `json:"tags,omitempty"` + // This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. + Token *string `json:"token,omitempty"` + Type *InterconnectionType `json:"type,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + RequestedBy *Href `json:"requested_by,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Interconnection Interconnection + +// NewInterconnection instantiates a new Interconnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterconnection() *Interconnection { + this := Interconnection{} + return &this +} + +// NewInterconnectionWithDefaults instantiates a new Interconnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterconnectionWithDefaults() *Interconnection { + this := Interconnection{} + return &this +} + +// GetContactEmail returns the ContactEmail field value if set, zero value otherwise. +func (o *Interconnection) GetContactEmail() string { + if o == nil || IsNil(o.ContactEmail) { + var ret string + return ret + } + return *o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetContactEmailOk() (*string, bool) { + if o == nil || IsNil(o.ContactEmail) { + return nil, false + } + return o.ContactEmail, true +} + +// HasContactEmail returns a boolean if a field has been set. +func (o *Interconnection) HasContactEmail() bool { + if o != nil && !IsNil(o.ContactEmail) { + return true + } + + return false +} + +// SetContactEmail gets a reference to the given string and assigns it to the ContactEmail field. +func (o *Interconnection) SetContactEmail(v string) { + o.ContactEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Interconnection) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Interconnection) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Interconnection) SetDescription(v string) { + o.Description = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *Interconnection) GetFacility() Href { + if o == nil || IsNil(o.Facility) { + var ret Href + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetFacilityOk() (*Href, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *Interconnection) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given Href and assigns it to the Facility field. +func (o *Interconnection) SetFacility(v Href) { + o.Facility = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Interconnection) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Interconnection) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Interconnection) SetId(v string) { + o.Id = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *Interconnection) GetMetro() Metro { + if o == nil || IsNil(o.Metro) { + var ret Metro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetMetroOk() (*Metro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *Interconnection) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given Metro and assigns it to the Metro field. +func (o *Interconnection) SetMetro(v Metro) { + o.Metro = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *Interconnection) GetMode() InterconnectionMode { + if o == nil || IsNil(o.Mode) { + var ret InterconnectionMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetModeOk() (*InterconnectionMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *Interconnection) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterconnectionMode and assigns it to the Mode field. +func (o *Interconnection) SetMode(v InterconnectionMode) { + o.Mode = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Interconnection) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Interconnection) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Interconnection) SetName(v string) { + o.Name = &v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *Interconnection) GetOrganization() Href { + if o == nil || IsNil(o.Organization) { + var ret Href + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetOrganizationOk() (*Href, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *Interconnection) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Href and assigns it to the Organization field. +func (o *Interconnection) SetOrganization(v Href) { + o.Organization = &v +} + +// GetPorts returns the Ports field value if set, zero value otherwise. +func (o *Interconnection) GetPorts() []InterconnectionPort { + if o == nil || IsNil(o.Ports) { + var ret []InterconnectionPort + return ret + } + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetPortsOk() ([]InterconnectionPort, bool) { + if o == nil || IsNil(o.Ports) { + return nil, false + } + return o.Ports, true +} + +// HasPorts returns a boolean if a field has been set. +func (o *Interconnection) HasPorts() bool { + if o != nil && !IsNil(o.Ports) { + return true + } + + return false +} + +// SetPorts gets a reference to the given []InterconnectionPort and assigns it to the Ports field. +func (o *Interconnection) SetPorts(v []InterconnectionPort) { + o.Ports = v +} + +// GetRedundancy returns the Redundancy field value if set, zero value otherwise. +func (o *Interconnection) GetRedundancy() InterconnectionRedundancy { + if o == nil || IsNil(o.Redundancy) { + var ret InterconnectionRedundancy + return ret + } + return *o.Redundancy +} + +// GetRedundancyOk returns a tuple with the Redundancy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetRedundancyOk() (*InterconnectionRedundancy, bool) { + if o == nil || IsNil(o.Redundancy) { + return nil, false + } + return o.Redundancy, true +} + +// HasRedundancy returns a boolean if a field has been set. +func (o *Interconnection) HasRedundancy() bool { + if o != nil && !IsNil(o.Redundancy) { + return true + } + + return false +} + +// SetRedundancy gets a reference to the given InterconnectionRedundancy and assigns it to the Redundancy field. +func (o *Interconnection) SetRedundancy(v InterconnectionRedundancy) { + o.Redundancy = &v +} + +// GetServiceTokens returns the ServiceTokens field value if set, zero value otherwise. +func (o *Interconnection) GetServiceTokens() []FabricServiceToken { + if o == nil || IsNil(o.ServiceTokens) { + var ret []FabricServiceToken + return ret + } + return o.ServiceTokens +} + +// GetServiceTokensOk returns a tuple with the ServiceTokens field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetServiceTokensOk() ([]FabricServiceToken, bool) { + if o == nil || IsNil(o.ServiceTokens) { + return nil, false + } + return o.ServiceTokens, true +} + +// HasServiceTokens returns a boolean if a field has been set. +func (o *Interconnection) HasServiceTokens() bool { + if o != nil && !IsNil(o.ServiceTokens) { + return true + } + + return false +} + +// SetServiceTokens gets a reference to the given []FabricServiceToken and assigns it to the ServiceTokens field. +func (o *Interconnection) SetServiceTokens(v []FabricServiceToken) { + o.ServiceTokens = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *Interconnection) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *Interconnection) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *Interconnection) SetSpeed(v int32) { + o.Speed = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Interconnection) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Interconnection) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Interconnection) SetStatus(v string) { + o.Status = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Interconnection) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Interconnection) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Interconnection) SetTags(v []string) { + o.Tags = v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *Interconnection) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *Interconnection) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *Interconnection) SetToken(v string) { + o.Token = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Interconnection) GetType() InterconnectionType { + if o == nil || IsNil(o.Type) { + var ret InterconnectionType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetTypeOk() (*InterconnectionType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Interconnection) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given InterconnectionType and assigns it to the Type field. +func (o *Interconnection) SetType(v InterconnectionType) { + o.Type = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Interconnection) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Interconnection) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Interconnection) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Interconnection) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Interconnection) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Interconnection) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetRequestedBy returns the RequestedBy field value if set, zero value otherwise. +func (o *Interconnection) GetRequestedBy() Href { + if o == nil || IsNil(o.RequestedBy) { + var ret Href + return ret + } + return *o.RequestedBy +} + +// GetRequestedByOk returns a tuple with the RequestedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Interconnection) GetRequestedByOk() (*Href, bool) { + if o == nil || IsNil(o.RequestedBy) { + return nil, false + } + return o.RequestedBy, true +} + +// HasRequestedBy returns a boolean if a field has been set. +func (o *Interconnection) HasRequestedBy() bool { + if o != nil && !IsNil(o.RequestedBy) { + return true + } + + return false +} + +// SetRequestedBy gets a reference to the given Href and assigns it to the RequestedBy field. +func (o *Interconnection) SetRequestedBy(v Href) { + o.RequestedBy = &v +} + +func (o Interconnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Interconnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContactEmail) { + toSerialize["contact_email"] = o.ContactEmail + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.Ports) { + toSerialize["ports"] = o.Ports + } + if !IsNil(o.Redundancy) { + toSerialize["redundancy"] = o.Redundancy + } + if !IsNil(o.ServiceTokens) { + toSerialize["service_tokens"] = o.ServiceTokens + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.RequestedBy) { + toSerialize["requested_by"] = o.RequestedBy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Interconnection) UnmarshalJSON(bytes []byte) (err error) { + varInterconnection := _Interconnection{} + + err = json.Unmarshal(bytes, &varInterconnection) + + if err != nil { + return err + } + + *o = Interconnection(varInterconnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contact_email") + delete(additionalProperties, "description") + delete(additionalProperties, "facility") + delete(additionalProperties, "id") + delete(additionalProperties, "metro") + delete(additionalProperties, "mode") + delete(additionalProperties, "name") + delete(additionalProperties, "organization") + delete(additionalProperties, "ports") + delete(additionalProperties, "redundancy") + delete(additionalProperties, "service_tokens") + delete(additionalProperties, "speed") + delete(additionalProperties, "status") + delete(additionalProperties, "tags") + delete(additionalProperties, "token") + delete(additionalProperties, "type") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "requested_by") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterconnection struct { + value *Interconnection + isSet bool +} + +func (v NullableInterconnection) Get() *Interconnection { + return v.value +} + +func (v *NullableInterconnection) Set(val *Interconnection) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnection) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnection(val *Interconnection) *NullableInterconnection { + return &NullableInterconnection{value: val, isSet: true} +} + +func (v NullableInterconnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_list.go b/services/metalv1/model_interconnection_list.go new file mode 100644 index 00000000..4c7c6d20 --- /dev/null +++ b/services/metalv1/model_interconnection_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InterconnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterconnectionList{} + +// InterconnectionList struct for InterconnectionList +type InterconnectionList struct { + Interconnections []Interconnection `json:"interconnections,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterconnectionList InterconnectionList + +// NewInterconnectionList instantiates a new InterconnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterconnectionList() *InterconnectionList { + this := InterconnectionList{} + return &this +} + +// NewInterconnectionListWithDefaults instantiates a new InterconnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterconnectionListWithDefaults() *InterconnectionList { + this := InterconnectionList{} + return &this +} + +// GetInterconnections returns the Interconnections field value if set, zero value otherwise. +func (o *InterconnectionList) GetInterconnections() []Interconnection { + if o == nil || IsNil(o.Interconnections) { + var ret []Interconnection + return ret + } + return o.Interconnections +} + +// GetInterconnectionsOk returns a tuple with the Interconnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionList) GetInterconnectionsOk() ([]Interconnection, bool) { + if o == nil || IsNil(o.Interconnections) { + return nil, false + } + return o.Interconnections, true +} + +// HasInterconnections returns a boolean if a field has been set. +func (o *InterconnectionList) HasInterconnections() bool { + if o != nil && !IsNil(o.Interconnections) { + return true + } + + return false +} + +// SetInterconnections gets a reference to the given []Interconnection and assigns it to the Interconnections field. +func (o *InterconnectionList) SetInterconnections(v []Interconnection) { + o.Interconnections = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *InterconnectionList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *InterconnectionList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *InterconnectionList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o InterconnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterconnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Interconnections) { + toSerialize["interconnections"] = o.Interconnections + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterconnectionList) UnmarshalJSON(bytes []byte) (err error) { + varInterconnectionList := _InterconnectionList{} + + err = json.Unmarshal(bytes, &varInterconnectionList) + + if err != nil { + return err + } + + *o = InterconnectionList(varInterconnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "interconnections") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterconnectionList struct { + value *InterconnectionList + isSet bool +} + +func (v NullableInterconnectionList) Get() *InterconnectionList { + return v.value +} + +func (v *NullableInterconnectionList) Set(val *InterconnectionList) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionList(val *InterconnectionList) *NullableInterconnectionList { + return &NullableInterconnectionList{value: val, isSet: true} +} + +func (v NullableInterconnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_mode.go b/services/metalv1/model_interconnection_mode.go new file mode 100644 index 00000000..e1d52d5e --- /dev/null +++ b/services/metalv1/model_interconnection_mode.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InterconnectionMode The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. +type InterconnectionMode string + +// List of Interconnection_mode +const ( + INTERCONNECTIONMODE_STANDARD InterconnectionMode = "standard" + INTERCONNECTIONMODE_TUNNEL InterconnectionMode = "tunnel" +) + +// All allowed values of InterconnectionMode enum +var AllowedInterconnectionModeEnumValues = []InterconnectionMode{ + "standard", + "tunnel", +} + +func (v *InterconnectionMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterconnectionMode(value) + for _, existing := range AllowedInterconnectionModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterconnectionMode", value) +} + +// NewInterconnectionModeFromValue returns a pointer to a valid InterconnectionMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterconnectionModeFromValue(v string) (*InterconnectionMode, error) { + ev := InterconnectionMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterconnectionMode: valid values are %v", v, AllowedInterconnectionModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterconnectionMode) IsValid() bool { + for _, existing := range AllowedInterconnectionModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interconnection_mode value +func (v InterconnectionMode) Ptr() *InterconnectionMode { + return &v +} + +type NullableInterconnectionMode struct { + value *InterconnectionMode + isSet bool +} + +func (v NullableInterconnectionMode) Get() *InterconnectionMode { + return v.value +} + +func (v *NullableInterconnectionMode) Set(val *InterconnectionMode) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionMode) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionMode(val *InterconnectionMode) *NullableInterconnectionMode { + return &NullableInterconnectionMode{value: val, isSet: true} +} + +func (v NullableInterconnectionMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_port.go b/services/metalv1/model_interconnection_port.go new file mode 100644 index 00000000..0623943c --- /dev/null +++ b/services/metalv1/model_interconnection_port.go @@ -0,0 +1,488 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InterconnectionPort type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterconnectionPort{} + +// InterconnectionPort struct for InterconnectionPort +type InterconnectionPort struct { + Id *string `json:"id,omitempty"` + Organization *Href `json:"organization,omitempty"` + Role *InterconnectionPortRole `json:"role,omitempty"` + Status *InterconnectionPortStatus `json:"status,omitempty"` + // A switch 'short ID' + SwitchId *string `json:"switch_id,omitempty"` + VirtualCircuits []VirtualCircuit `json:"virtual_circuits,omitempty"` + Name *string `json:"name,omitempty"` + Speed *int32 `json:"speed,omitempty"` + LinkStatus *string `json:"link_status,omitempty"` + Href *string `json:"href,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterconnectionPort InterconnectionPort + +// NewInterconnectionPort instantiates a new InterconnectionPort object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterconnectionPort() *InterconnectionPort { + this := InterconnectionPort{} + return &this +} + +// NewInterconnectionPortWithDefaults instantiates a new InterconnectionPort object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterconnectionPortWithDefaults() *InterconnectionPort { + this := InterconnectionPort{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InterconnectionPort) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *InterconnectionPort) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *InterconnectionPort) SetId(v string) { + o.Id = &v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *InterconnectionPort) GetOrganization() Href { + if o == nil || IsNil(o.Organization) { + var ret Href + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetOrganizationOk() (*Href, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *InterconnectionPort) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Href and assigns it to the Organization field. +func (o *InterconnectionPort) SetOrganization(v Href) { + o.Organization = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *InterconnectionPort) GetRole() InterconnectionPortRole { + if o == nil || IsNil(o.Role) { + var ret InterconnectionPortRole + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetRoleOk() (*InterconnectionPortRole, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *InterconnectionPort) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given InterconnectionPortRole and assigns it to the Role field. +func (o *InterconnectionPort) SetRole(v InterconnectionPortRole) { + o.Role = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *InterconnectionPort) GetStatus() InterconnectionPortStatus { + if o == nil || IsNil(o.Status) { + var ret InterconnectionPortStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetStatusOk() (*InterconnectionPortStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InterconnectionPort) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given InterconnectionPortStatus and assigns it to the Status field. +func (o *InterconnectionPort) SetStatus(v InterconnectionPortStatus) { + o.Status = &v +} + +// GetSwitchId returns the SwitchId field value if set, zero value otherwise. +func (o *InterconnectionPort) GetSwitchId() string { + if o == nil || IsNil(o.SwitchId) { + var ret string + return ret + } + return *o.SwitchId +} + +// GetSwitchIdOk returns a tuple with the SwitchId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetSwitchIdOk() (*string, bool) { + if o == nil || IsNil(o.SwitchId) { + return nil, false + } + return o.SwitchId, true +} + +// HasSwitchId returns a boolean if a field has been set. +func (o *InterconnectionPort) HasSwitchId() bool { + if o != nil && !IsNil(o.SwitchId) { + return true + } + + return false +} + +// SetSwitchId gets a reference to the given string and assigns it to the SwitchId field. +func (o *InterconnectionPort) SetSwitchId(v string) { + o.SwitchId = &v +} + +// GetVirtualCircuits returns the VirtualCircuits field value if set, zero value otherwise. +func (o *InterconnectionPort) GetVirtualCircuits() []VirtualCircuit { + if o == nil || IsNil(o.VirtualCircuits) { + var ret []VirtualCircuit + return ret + } + return o.VirtualCircuits +} + +// GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetVirtualCircuitsOk() ([]VirtualCircuit, bool) { + if o == nil || IsNil(o.VirtualCircuits) { + return nil, false + } + return o.VirtualCircuits, true +} + +// HasVirtualCircuits returns a boolean if a field has been set. +func (o *InterconnectionPort) HasVirtualCircuits() bool { + if o != nil && !IsNil(o.VirtualCircuits) { + return true + } + + return false +} + +// SetVirtualCircuits gets a reference to the given []VirtualCircuit and assigns it to the VirtualCircuits field. +func (o *InterconnectionPort) SetVirtualCircuits(v []VirtualCircuit) { + o.VirtualCircuits = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InterconnectionPort) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InterconnectionPort) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InterconnectionPort) SetName(v string) { + o.Name = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *InterconnectionPort) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *InterconnectionPort) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *InterconnectionPort) SetSpeed(v int32) { + o.Speed = &v +} + +// GetLinkStatus returns the LinkStatus field value if set, zero value otherwise. +func (o *InterconnectionPort) GetLinkStatus() string { + if o == nil || IsNil(o.LinkStatus) { + var ret string + return ret + } + return *o.LinkStatus +} + +// GetLinkStatusOk returns a tuple with the LinkStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetLinkStatusOk() (*string, bool) { + if o == nil || IsNil(o.LinkStatus) { + return nil, false + } + return o.LinkStatus, true +} + +// HasLinkStatus returns a boolean if a field has been set. +func (o *InterconnectionPort) HasLinkStatus() bool { + if o != nil && !IsNil(o.LinkStatus) { + return true + } + + return false +} + +// SetLinkStatus gets a reference to the given string and assigns it to the LinkStatus field. +func (o *InterconnectionPort) SetLinkStatus(v string) { + o.LinkStatus = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *InterconnectionPort) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPort) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *InterconnectionPort) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *InterconnectionPort) SetHref(v string) { + o.Href = &v +} + +func (o InterconnectionPort) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterconnectionPort) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.SwitchId) { + toSerialize["switch_id"] = o.SwitchId + } + if !IsNil(o.VirtualCircuits) { + toSerialize["virtual_circuits"] = o.VirtualCircuits + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.LinkStatus) { + toSerialize["link_status"] = o.LinkStatus + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterconnectionPort) UnmarshalJSON(bytes []byte) (err error) { + varInterconnectionPort := _InterconnectionPort{} + + err = json.Unmarshal(bytes, &varInterconnectionPort) + + if err != nil { + return err + } + + *o = InterconnectionPort(varInterconnectionPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "organization") + delete(additionalProperties, "role") + delete(additionalProperties, "status") + delete(additionalProperties, "switch_id") + delete(additionalProperties, "virtual_circuits") + delete(additionalProperties, "name") + delete(additionalProperties, "speed") + delete(additionalProperties, "link_status") + delete(additionalProperties, "href") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterconnectionPort struct { + value *InterconnectionPort + isSet bool +} + +func (v NullableInterconnectionPort) Get() *InterconnectionPort { + return v.value +} + +func (v *NullableInterconnectionPort) Set(val *InterconnectionPort) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionPort) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionPort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionPort(val *InterconnectionPort) *NullableInterconnectionPort { + return &NullableInterconnectionPort{value: val, isSet: true} +} + +func (v NullableInterconnectionPort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionPort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_port_list.go b/services/metalv1/model_interconnection_port_list.go new file mode 100644 index 00000000..951a0940 --- /dev/null +++ b/services/metalv1/model_interconnection_port_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InterconnectionPortList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterconnectionPortList{} + +// InterconnectionPortList struct for InterconnectionPortList +type InterconnectionPortList struct { + Ports []InterconnectionPort `json:"ports,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterconnectionPortList InterconnectionPortList + +// NewInterconnectionPortList instantiates a new InterconnectionPortList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterconnectionPortList() *InterconnectionPortList { + this := InterconnectionPortList{} + return &this +} + +// NewInterconnectionPortListWithDefaults instantiates a new InterconnectionPortList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterconnectionPortListWithDefaults() *InterconnectionPortList { + this := InterconnectionPortList{} + return &this +} + +// GetPorts returns the Ports field value if set, zero value otherwise. +func (o *InterconnectionPortList) GetPorts() []InterconnectionPort { + if o == nil || IsNil(o.Ports) { + var ret []InterconnectionPort + return ret + } + return o.Ports +} + +// GetPortsOk returns a tuple with the Ports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionPortList) GetPortsOk() ([]InterconnectionPort, bool) { + if o == nil || IsNil(o.Ports) { + return nil, false + } + return o.Ports, true +} + +// HasPorts returns a boolean if a field has been set. +func (o *InterconnectionPortList) HasPorts() bool { + if o != nil && !IsNil(o.Ports) { + return true + } + + return false +} + +// SetPorts gets a reference to the given []InterconnectionPort and assigns it to the Ports field. +func (o *InterconnectionPortList) SetPorts(v []InterconnectionPort) { + o.Ports = v +} + +func (o InterconnectionPortList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterconnectionPortList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ports) { + toSerialize["ports"] = o.Ports + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterconnectionPortList) UnmarshalJSON(bytes []byte) (err error) { + varInterconnectionPortList := _InterconnectionPortList{} + + err = json.Unmarshal(bytes, &varInterconnectionPortList) + + if err != nil { + return err + } + + *o = InterconnectionPortList(varInterconnectionPortList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ports") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterconnectionPortList struct { + value *InterconnectionPortList + isSet bool +} + +func (v NullableInterconnectionPortList) Get() *InterconnectionPortList { + return v.value +} + +func (v *NullableInterconnectionPortList) Set(val *InterconnectionPortList) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionPortList) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionPortList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionPortList(val *InterconnectionPortList) *NullableInterconnectionPortList { + return &NullableInterconnectionPortList{value: val, isSet: true} +} + +func (v NullableInterconnectionPortList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionPortList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_port_role.go b/services/metalv1/model_interconnection_port_role.go new file mode 100644 index 00000000..290c189e --- /dev/null +++ b/services/metalv1/model_interconnection_port_role.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InterconnectionPortRole Either 'primary' or 'secondary'. +type InterconnectionPortRole string + +// List of InterconnectionPort_role +const ( + INTERCONNECTIONPORTROLE_PRIMARY InterconnectionPortRole = "primary" + INTERCONNECTIONPORTROLE_SECONDARY InterconnectionPortRole = "secondary" +) + +// All allowed values of InterconnectionPortRole enum +var AllowedInterconnectionPortRoleEnumValues = []InterconnectionPortRole{ + "primary", + "secondary", +} + +func (v *InterconnectionPortRole) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterconnectionPortRole(value) + for _, existing := range AllowedInterconnectionPortRoleEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterconnectionPortRole", value) +} + +// NewInterconnectionPortRoleFromValue returns a pointer to a valid InterconnectionPortRole +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterconnectionPortRoleFromValue(v string) (*InterconnectionPortRole, error) { + ev := InterconnectionPortRole(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterconnectionPortRole: valid values are %v", v, AllowedInterconnectionPortRoleEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterconnectionPortRole) IsValid() bool { + for _, existing := range AllowedInterconnectionPortRoleEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterconnectionPort_role value +func (v InterconnectionPortRole) Ptr() *InterconnectionPortRole { + return &v +} + +type NullableInterconnectionPortRole struct { + value *InterconnectionPortRole + isSet bool +} + +func (v NullableInterconnectionPortRole) Get() *InterconnectionPortRole { + return v.value +} + +func (v *NullableInterconnectionPortRole) Set(val *InterconnectionPortRole) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionPortRole) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionPortRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionPortRole(val *InterconnectionPortRole) *NullableInterconnectionPortRole { + return &NullableInterconnectionPortRole{value: val, isSet: true} +} + +func (v NullableInterconnectionPortRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionPortRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_port_status.go b/services/metalv1/model_interconnection_port_status.go new file mode 100644 index 00000000..ddc6bb1e --- /dev/null +++ b/services/metalv1/model_interconnection_port_status.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InterconnectionPortStatus For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the service token associated is expired. +type InterconnectionPortStatus string + +// List of InterconnectionPort_status +const ( + INTERCONNECTIONPORTSTATUS_REQUESTED InterconnectionPortStatus = "requested" + INTERCONNECTIONPORTSTATUS_ACTIVE InterconnectionPortStatus = "active" + INTERCONNECTIONPORTSTATUS_DELETING InterconnectionPortStatus = "deleting" + INTERCONNECTIONPORTSTATUS_EXPIRED InterconnectionPortStatus = "expired" + INTERCONNECTIONPORTSTATUS_DELETE_FAILED InterconnectionPortStatus = "delete_failed" +) + +// All allowed values of InterconnectionPortStatus enum +var AllowedInterconnectionPortStatusEnumValues = []InterconnectionPortStatus{ + "requested", + "active", + "deleting", + "expired", + "delete_failed", +} + +func (v *InterconnectionPortStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterconnectionPortStatus(value) + for _, existing := range AllowedInterconnectionPortStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterconnectionPortStatus", value) +} + +// NewInterconnectionPortStatusFromValue returns a pointer to a valid InterconnectionPortStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterconnectionPortStatusFromValue(v string) (*InterconnectionPortStatus, error) { + ev := InterconnectionPortStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterconnectionPortStatus: valid values are %v", v, AllowedInterconnectionPortStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterconnectionPortStatus) IsValid() bool { + for _, existing := range AllowedInterconnectionPortStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InterconnectionPort_status value +func (v InterconnectionPortStatus) Ptr() *InterconnectionPortStatus { + return &v +} + +type NullableInterconnectionPortStatus struct { + value *InterconnectionPortStatus + isSet bool +} + +func (v NullableInterconnectionPortStatus) Get() *InterconnectionPortStatus { + return v.value +} + +func (v *NullableInterconnectionPortStatus) Set(val *InterconnectionPortStatus) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionPortStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionPortStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionPortStatus(val *InterconnectionPortStatus) *NullableInterconnectionPortStatus { + return &NullableInterconnectionPortStatus{value: val, isSet: true} +} + +func (v NullableInterconnectionPortStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionPortStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_redundancy.go b/services/metalv1/model_interconnection_redundancy.go new file mode 100644 index 00000000..7e6b5d3a --- /dev/null +++ b/services/metalv1/model_interconnection_redundancy.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InterconnectionRedundancy Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. +type InterconnectionRedundancy string + +// List of Interconnection_redundancy +const ( + INTERCONNECTIONREDUNDANCY_PRIMARY InterconnectionRedundancy = "primary" + INTERCONNECTIONREDUNDANCY_REDUNDANT InterconnectionRedundancy = "redundant" +) + +// All allowed values of InterconnectionRedundancy enum +var AllowedInterconnectionRedundancyEnumValues = []InterconnectionRedundancy{ + "primary", + "redundant", +} + +func (v *InterconnectionRedundancy) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterconnectionRedundancy(value) + for _, existing := range AllowedInterconnectionRedundancyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterconnectionRedundancy", value) +} + +// NewInterconnectionRedundancyFromValue returns a pointer to a valid InterconnectionRedundancy +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterconnectionRedundancyFromValue(v string) (*InterconnectionRedundancy, error) { + ev := InterconnectionRedundancy(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterconnectionRedundancy: valid values are %v", v, AllowedInterconnectionRedundancyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterconnectionRedundancy) IsValid() bool { + for _, existing := range AllowedInterconnectionRedundancyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interconnection_redundancy value +func (v InterconnectionRedundancy) Ptr() *InterconnectionRedundancy { + return &v +} + +type NullableInterconnectionRedundancy struct { + value *InterconnectionRedundancy + isSet bool +} + +func (v NullableInterconnectionRedundancy) Get() *InterconnectionRedundancy { + return v.value +} + +func (v *NullableInterconnectionRedundancy) Set(val *InterconnectionRedundancy) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionRedundancy) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionRedundancy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionRedundancy(val *InterconnectionRedundancy) *NullableInterconnectionRedundancy { + return &NullableInterconnectionRedundancy{value: val, isSet: true} +} + +func (v NullableInterconnectionRedundancy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionRedundancy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_type.go b/services/metalv1/model_interconnection_type.go new file mode 100644 index 00000000..e117fb69 --- /dev/null +++ b/services/metalv1/model_interconnection_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InterconnectionType The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. +type InterconnectionType string + +// List of Interconnection_type +const ( + INTERCONNECTIONTYPE_SHARED InterconnectionType = "shared" + INTERCONNECTIONTYPE_DEDICATED InterconnectionType = "dedicated" +) + +// All allowed values of InterconnectionType enum +var AllowedInterconnectionTypeEnumValues = []InterconnectionType{ + "shared", + "dedicated", +} + +func (v *InterconnectionType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InterconnectionType(value) + for _, existing := range AllowedInterconnectionTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InterconnectionType", value) +} + +// NewInterconnectionTypeFromValue returns a pointer to a valid InterconnectionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInterconnectionTypeFromValue(v string) (*InterconnectionType, error) { + ev := InterconnectionType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InterconnectionType: valid values are %v", v, AllowedInterconnectionTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InterconnectionType) IsValid() bool { + for _, existing := range AllowedInterconnectionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Interconnection_type value +func (v InterconnectionType) Ptr() *InterconnectionType { + return &v +} + +type NullableInterconnectionType struct { + value *InterconnectionType + isSet bool +} + +func (v NullableInterconnectionType) Get() *InterconnectionType { + return v.value +} + +func (v *NullableInterconnectionType) Set(val *InterconnectionType) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionType) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionType(val *InterconnectionType) *NullableInterconnectionType { + return &NullableInterconnectionType{value: val, isSet: true} +} + +func (v NullableInterconnectionType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_interconnection_update_input.go b/services/metalv1/model_interconnection_update_input.go new file mode 100644 index 00000000..29a00992 --- /dev/null +++ b/services/metalv1/model_interconnection_update_input.go @@ -0,0 +1,340 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InterconnectionUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InterconnectionUpdateInput{} + +// InterconnectionUpdateInput struct for InterconnectionUpdateInput +type InterconnectionUpdateInput struct { + ContactEmail *string `json:"contact_email,omitempty"` + Description *string `json:"description,omitempty"` + Mode *InterconnectionMode `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + // Updating from 'redundant' to 'primary' will remove a secondary port, while updating from 'primary' to 'redundant' will add one. + Redundancy *string `json:"redundancy,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InterconnectionUpdateInput InterconnectionUpdateInput + +// NewInterconnectionUpdateInput instantiates a new InterconnectionUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInterconnectionUpdateInput() *InterconnectionUpdateInput { + this := InterconnectionUpdateInput{} + return &this +} + +// NewInterconnectionUpdateInputWithDefaults instantiates a new InterconnectionUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInterconnectionUpdateInputWithDefaults() *InterconnectionUpdateInput { + this := InterconnectionUpdateInput{} + return &this +} + +// GetContactEmail returns the ContactEmail field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetContactEmail() string { + if o == nil || IsNil(o.ContactEmail) { + var ret string + return ret + } + return *o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetContactEmailOk() (*string, bool) { + if o == nil || IsNil(o.ContactEmail) { + return nil, false + } + return o.ContactEmail, true +} + +// HasContactEmail returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasContactEmail() bool { + if o != nil && !IsNil(o.ContactEmail) { + return true + } + + return false +} + +// SetContactEmail gets a reference to the given string and assigns it to the ContactEmail field. +func (o *InterconnectionUpdateInput) SetContactEmail(v string) { + o.ContactEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InterconnectionUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetMode() InterconnectionMode { + if o == nil || IsNil(o.Mode) { + var ret InterconnectionMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetModeOk() (*InterconnectionMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given InterconnectionMode and assigns it to the Mode field. +func (o *InterconnectionUpdateInput) SetMode(v InterconnectionMode) { + o.Mode = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InterconnectionUpdateInput) SetName(v string) { + o.Name = &v +} + +// GetRedundancy returns the Redundancy field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetRedundancy() string { + if o == nil || IsNil(o.Redundancy) { + var ret string + return ret + } + return *o.Redundancy +} + +// GetRedundancyOk returns a tuple with the Redundancy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetRedundancyOk() (*string, bool) { + if o == nil || IsNil(o.Redundancy) { + return nil, false + } + return o.Redundancy, true +} + +// HasRedundancy returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasRedundancy() bool { + if o != nil && !IsNil(o.Redundancy) { + return true + } + + return false +} + +// SetRedundancy gets a reference to the given string and assigns it to the Redundancy field. +func (o *InterconnectionUpdateInput) SetRedundancy(v string) { + o.Redundancy = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *InterconnectionUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InterconnectionUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *InterconnectionUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *InterconnectionUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o InterconnectionUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InterconnectionUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContactEmail) { + toSerialize["contact_email"] = o.ContactEmail + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Redundancy) { + toSerialize["redundancy"] = o.Redundancy + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InterconnectionUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varInterconnectionUpdateInput := _InterconnectionUpdateInput{} + + err = json.Unmarshal(bytes, &varInterconnectionUpdateInput) + + if err != nil { + return err + } + + *o = InterconnectionUpdateInput(varInterconnectionUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contact_email") + delete(additionalProperties, "description") + delete(additionalProperties, "mode") + delete(additionalProperties, "name") + delete(additionalProperties, "redundancy") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInterconnectionUpdateInput struct { + value *InterconnectionUpdateInput + isSet bool +} + +func (v NullableInterconnectionUpdateInput) Get() *InterconnectionUpdateInput { + return v.value +} + +func (v *NullableInterconnectionUpdateInput) Set(val *InterconnectionUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableInterconnectionUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableInterconnectionUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInterconnectionUpdateInput(val *InterconnectionUpdateInput) *NullableInterconnectionUpdateInput { + return &NullableInterconnectionUpdateInput{value: val, isSet: true} +} + +func (v NullableInterconnectionUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInterconnectionUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invitation.go b/services/metalv1/model_invitation.go new file mode 100644 index 00000000..2ee96c1f --- /dev/null +++ b/services/metalv1/model_invitation.go @@ -0,0 +1,525 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Invitation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Invitation{} + +// Invitation struct for Invitation +type Invitation struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Invitation *Href `json:"invitation,omitempty"` + InvitedBy *Href `json:"invited_by,omitempty"` + Invitee *string `json:"invitee,omitempty"` + Nonce *string `json:"nonce,omitempty"` + Organization *Href `json:"organization,omitempty"` + Projects []Href `json:"projects,omitempty"` + Roles []InvitationRolesInner `json:"roles,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Invitation Invitation + +// NewInvitation instantiates a new Invitation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitation() *Invitation { + this := Invitation{} + return &this +} + +// NewInvitationWithDefaults instantiates a new Invitation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationWithDefaults() *Invitation { + this := Invitation{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Invitation) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Invitation) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Invitation) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Invitation) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Invitation) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Invitation) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Invitation) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Invitation) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Invitation) SetId(v string) { + o.Id = &v +} + +// GetInvitation returns the Invitation field value if set, zero value otherwise. +func (o *Invitation) GetInvitation() Href { + if o == nil || IsNil(o.Invitation) { + var ret Href + return ret + } + return *o.Invitation +} + +// GetInvitationOk returns a tuple with the Invitation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetInvitationOk() (*Href, bool) { + if o == nil || IsNil(o.Invitation) { + return nil, false + } + return o.Invitation, true +} + +// HasInvitation returns a boolean if a field has been set. +func (o *Invitation) HasInvitation() bool { + if o != nil && !IsNil(o.Invitation) { + return true + } + + return false +} + +// SetInvitation gets a reference to the given Href and assigns it to the Invitation field. +func (o *Invitation) SetInvitation(v Href) { + o.Invitation = &v +} + +// GetInvitedBy returns the InvitedBy field value if set, zero value otherwise. +func (o *Invitation) GetInvitedBy() Href { + if o == nil || IsNil(o.InvitedBy) { + var ret Href + return ret + } + return *o.InvitedBy +} + +// GetInvitedByOk returns a tuple with the InvitedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetInvitedByOk() (*Href, bool) { + if o == nil || IsNil(o.InvitedBy) { + return nil, false + } + return o.InvitedBy, true +} + +// HasInvitedBy returns a boolean if a field has been set. +func (o *Invitation) HasInvitedBy() bool { + if o != nil && !IsNil(o.InvitedBy) { + return true + } + + return false +} + +// SetInvitedBy gets a reference to the given Href and assigns it to the InvitedBy field. +func (o *Invitation) SetInvitedBy(v Href) { + o.InvitedBy = &v +} + +// GetInvitee returns the Invitee field value if set, zero value otherwise. +func (o *Invitation) GetInvitee() string { + if o == nil || IsNil(o.Invitee) { + var ret string + return ret + } + return *o.Invitee +} + +// GetInviteeOk returns a tuple with the Invitee field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetInviteeOk() (*string, bool) { + if o == nil || IsNil(o.Invitee) { + return nil, false + } + return o.Invitee, true +} + +// HasInvitee returns a boolean if a field has been set. +func (o *Invitation) HasInvitee() bool { + if o != nil && !IsNil(o.Invitee) { + return true + } + + return false +} + +// SetInvitee gets a reference to the given string and assigns it to the Invitee field. +func (o *Invitation) SetInvitee(v string) { + o.Invitee = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *Invitation) GetNonce() string { + if o == nil || IsNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetNonceOk() (*string, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *Invitation) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *Invitation) SetNonce(v string) { + o.Nonce = &v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *Invitation) GetOrganization() Href { + if o == nil || IsNil(o.Organization) { + var ret Href + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetOrganizationOk() (*Href, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *Invitation) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Href and assigns it to the Organization field. +func (o *Invitation) SetOrganization(v Href) { + o.Organization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *Invitation) GetProjects() []Href { + if o == nil || IsNil(o.Projects) { + var ret []Href + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetProjectsOk() ([]Href, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *Invitation) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []Href and assigns it to the Projects field. +func (o *Invitation) SetProjects(v []Href) { + o.Projects = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *Invitation) GetRoles() []InvitationRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []InvitationRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetRolesOk() ([]InvitationRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *Invitation) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []InvitationRolesInner and assigns it to the Roles field. +func (o *Invitation) SetRoles(v []InvitationRolesInner) { + o.Roles = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Invitation) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Invitation) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Invitation) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Invitation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Invitation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Invitation) { + toSerialize["invitation"] = o.Invitation + } + if !IsNil(o.InvitedBy) { + toSerialize["invited_by"] = o.InvitedBy + } + if !IsNil(o.Invitee) { + toSerialize["invitee"] = o.Invitee + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Invitation) UnmarshalJSON(bytes []byte) (err error) { + varInvitation := _Invitation{} + + err = json.Unmarshal(bytes, &varInvitation) + + if err != nil { + return err + } + + *o = Invitation(varInvitation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "invitation") + delete(additionalProperties, "invited_by") + delete(additionalProperties, "invitee") + delete(additionalProperties, "nonce") + delete(additionalProperties, "organization") + delete(additionalProperties, "projects") + delete(additionalProperties, "roles") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitation struct { + value *Invitation + isSet bool +} + +func (v NullableInvitation) Get() *Invitation { + return v.value +} + +func (v *NullableInvitation) Set(val *Invitation) { + v.value = val + v.isSet = true +} + +func (v NullableInvitation) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitation(val *Invitation) *NullableInvitation { + return &NullableInvitation{value: val, isSet: true} +} + +func (v NullableInvitation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invitation_input.go b/services/metalv1/model_invitation_input.go new file mode 100644 index 00000000..b32b16f3 --- /dev/null +++ b/services/metalv1/model_invitation_input.go @@ -0,0 +1,315 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the InvitationInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationInput{} + +// InvitationInput struct for InvitationInput +type InvitationInput struct { + Invitee string `json:"invitee"` + Message *string `json:"message,omitempty"` + OrganizationId *string `json:"organization_id,omitempty"` + ProjectsIds []string `json:"projects_ids,omitempty"` + Roles []InvitationRolesInner `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationInput InvitationInput + +// NewInvitationInput instantiates a new InvitationInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationInput(invitee string) *InvitationInput { + this := InvitationInput{} + this.Invitee = invitee + return &this +} + +// NewInvitationInputWithDefaults instantiates a new InvitationInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationInputWithDefaults() *InvitationInput { + this := InvitationInput{} + return &this +} + +// GetInvitee returns the Invitee field value +func (o *InvitationInput) GetInvitee() string { + if o == nil { + var ret string + return ret + } + + return o.Invitee +} + +// GetInviteeOk returns a tuple with the Invitee field value +// and a boolean to check if the value has been set. +func (o *InvitationInput) GetInviteeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Invitee, true +} + +// SetInvitee sets field value +func (o *InvitationInput) SetInvitee(v string) { + o.Invitee = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *InvitationInput) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationInput) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *InvitationInput) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *InvitationInput) SetMessage(v string) { + o.Message = &v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *InvitationInput) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationInput) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *InvitationInput) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *InvitationInput) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetProjectsIds returns the ProjectsIds field value if set, zero value otherwise. +func (o *InvitationInput) GetProjectsIds() []string { + if o == nil || IsNil(o.ProjectsIds) { + var ret []string + return ret + } + return o.ProjectsIds +} + +// GetProjectsIdsOk returns a tuple with the ProjectsIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationInput) GetProjectsIdsOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectsIds) { + return nil, false + } + return o.ProjectsIds, true +} + +// HasProjectsIds returns a boolean if a field has been set. +func (o *InvitationInput) HasProjectsIds() bool { + if o != nil && !IsNil(o.ProjectsIds) { + return true + } + + return false +} + +// SetProjectsIds gets a reference to the given []string and assigns it to the ProjectsIds field. +func (o *InvitationInput) SetProjectsIds(v []string) { + o.ProjectsIds = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *InvitationInput) GetRoles() []InvitationRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []InvitationRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationInput) GetRolesOk() ([]InvitationRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *InvitationInput) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []InvitationRolesInner and assigns it to the Roles field. +func (o *InvitationInput) SetRoles(v []InvitationRolesInner) { + o.Roles = v +} + +func (o InvitationInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["invitee"] = o.Invitee + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.ProjectsIds) { + toSerialize["projects_ids"] = o.ProjectsIds + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "invitee", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitationInput := _InvitationInput{} + + err = json.Unmarshal(bytes, &varInvitationInput) + + if err != nil { + return err + } + + *o = InvitationInput(varInvitationInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "invitee") + delete(additionalProperties, "message") + delete(additionalProperties, "organization_id") + delete(additionalProperties, "projects_ids") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationInput struct { + value *InvitationInput + isSet bool +} + +func (v NullableInvitationInput) Get() *InvitationInput { + return v.value +} + +func (v *NullableInvitationInput) Set(val *InvitationInput) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationInput) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationInput(val *InvitationInput) *NullableInvitationInput { + return &NullableInvitationInput{value: val, isSet: true} +} + +func (v NullableInvitationInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invitation_list.go b/services/metalv1/model_invitation_list.go new file mode 100644 index 00000000..cd4d7d0d --- /dev/null +++ b/services/metalv1/model_invitation_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InvitationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationList{} + +// InvitationList struct for InvitationList +type InvitationList struct { + Invitations []Membership `json:"invitations,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationList InvitationList + +// NewInvitationList instantiates a new InvitationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationList() *InvitationList { + this := InvitationList{} + return &this +} + +// NewInvitationListWithDefaults instantiates a new InvitationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationListWithDefaults() *InvitationList { + this := InvitationList{} + return &this +} + +// GetInvitations returns the Invitations field value if set, zero value otherwise. +func (o *InvitationList) GetInvitations() []Membership { + if o == nil || IsNil(o.Invitations) { + var ret []Membership + return ret + } + return o.Invitations +} + +// GetInvitationsOk returns a tuple with the Invitations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationList) GetInvitationsOk() ([]Membership, bool) { + if o == nil || IsNil(o.Invitations) { + return nil, false + } + return o.Invitations, true +} + +// HasInvitations returns a boolean if a field has been set. +func (o *InvitationList) HasInvitations() bool { + if o != nil && !IsNil(o.Invitations) { + return true + } + + return false +} + +// SetInvitations gets a reference to the given []Membership and assigns it to the Invitations field. +func (o *InvitationList) SetInvitations(v []Membership) { + o.Invitations = v +} + +func (o InvitationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Invitations) { + toSerialize["invitations"] = o.Invitations + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationList) UnmarshalJSON(bytes []byte) (err error) { + varInvitationList := _InvitationList{} + + err = json.Unmarshal(bytes, &varInvitationList) + + if err != nil { + return err + } + + *o = InvitationList(varInvitationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "invitations") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationList struct { + value *InvitationList + isSet bool +} + +func (v NullableInvitationList) Get() *InvitationList { + return v.value +} + +func (v *NullableInvitationList) Set(val *InvitationList) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationList) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationList(val *InvitationList) *NullableInvitationList { + return &NullableInvitationList{value: val, isSet: true} +} + +func (v NullableInvitationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invitation_roles_inner.go b/services/metalv1/model_invitation_roles_inner.go new file mode 100644 index 00000000..086633d0 --- /dev/null +++ b/services/metalv1/model_invitation_roles_inner.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// InvitationRolesInner the model 'InvitationRolesInner' +type InvitationRolesInner string + +// List of Invitation_roles_inner +const ( + INVITATIONROLESINNER_ADMIN InvitationRolesInner = "admin" + INVITATIONROLESINNER_BILLING InvitationRolesInner = "billing" + INVITATIONROLESINNER_COLLABORATOR InvitationRolesInner = "collaborator" + INVITATIONROLESINNER_LIMITED_COLLABORATOR InvitationRolesInner = "limited_collaborator" +) + +// All allowed values of InvitationRolesInner enum +var AllowedInvitationRolesInnerEnumValues = []InvitationRolesInner{ + "admin", + "billing", + "collaborator", + "limited_collaborator", +} + +func (v *InvitationRolesInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvitationRolesInner(value) + for _, existing := range AllowedInvitationRolesInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvitationRolesInner", value) +} + +// NewInvitationRolesInnerFromValue returns a pointer to a valid InvitationRolesInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvitationRolesInnerFromValue(v string) (*InvitationRolesInner, error) { + ev := InvitationRolesInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvitationRolesInner: valid values are %v", v, AllowedInvitationRolesInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvitationRolesInner) IsValid() bool { + for _, existing := range AllowedInvitationRolesInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Invitation_roles_inner value +func (v InvitationRolesInner) Ptr() *InvitationRolesInner { + return &v +} + +type NullableInvitationRolesInner struct { + value *InvitationRolesInner + isSet bool +} + +func (v NullableInvitationRolesInner) Get() *InvitationRolesInner { + return v.value +} + +func (v *NullableInvitationRolesInner) Set(val *InvitationRolesInner) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationRolesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationRolesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationRolesInner(val *InvitationRolesInner) *NullableInvitationRolesInner { + return &NullableInvitationRolesInner{value: val, isSet: true} +} + +func (v NullableInvitationRolesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationRolesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invoice.go b/services/metalv1/model_invoice.go new file mode 100644 index 00000000..6ecceca3 --- /dev/null +++ b/services/metalv1/model_invoice.go @@ -0,0 +1,635 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Invoice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Invoice{} + +// Invoice struct for Invoice +type Invoice struct { + Amount *float32 `json:"amount,omitempty"` + Balance *float32 `json:"balance,omitempty"` + CreatedOn *string `json:"created_on,omitempty"` + CreditAmount *float32 `json:"credit_amount,omitempty"` + CreditsApplied *float32 `json:"credits_applied,omitempty"` + Currency *string `json:"currency,omitempty"` + DueOn *string `json:"due_on,omitempty"` + Id *string `json:"id,omitempty"` + Items []LineItem `json:"items,omitempty"` + Number *string `json:"number,omitempty"` + Project *ProjectIdName `json:"project,omitempty"` + ReferenceNumber *string `json:"reference_number,omitempty"` + Status *string `json:"status,omitempty"` + TargetDate *string `json:"target_date,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Invoice Invoice + +// NewInvoice instantiates a new Invoice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoice() *Invoice { + this := Invoice{} + return &this +} + +// NewInvoiceWithDefaults instantiates a new Invoice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceWithDefaults() *Invoice { + this := Invoice{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *Invoice) GetAmount() float32 { + if o == nil || IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetAmountOk() (*float32, bool) { + if o == nil || IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *Invoice) HasAmount() bool { + if o != nil && !IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *Invoice) SetAmount(v float32) { + o.Amount = &v +} + +// GetBalance returns the Balance field value if set, zero value otherwise. +func (o *Invoice) GetBalance() float32 { + if o == nil || IsNil(o.Balance) { + var ret float32 + return ret + } + return *o.Balance +} + +// GetBalanceOk returns a tuple with the Balance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetBalanceOk() (*float32, bool) { + if o == nil || IsNil(o.Balance) { + return nil, false + } + return o.Balance, true +} + +// HasBalance returns a boolean if a field has been set. +func (o *Invoice) HasBalance() bool { + if o != nil && !IsNil(o.Balance) { + return true + } + + return false +} + +// SetBalance gets a reference to the given float32 and assigns it to the Balance field. +func (o *Invoice) SetBalance(v float32) { + o.Balance = &v +} + +// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise. +func (o *Invoice) GetCreatedOn() string { + if o == nil || IsNil(o.CreatedOn) { + var ret string + return ret + } + return *o.CreatedOn +} + +// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCreatedOnOk() (*string, bool) { + if o == nil || IsNil(o.CreatedOn) { + return nil, false + } + return o.CreatedOn, true +} + +// HasCreatedOn returns a boolean if a field has been set. +func (o *Invoice) HasCreatedOn() bool { + if o != nil && !IsNil(o.CreatedOn) { + return true + } + + return false +} + +// SetCreatedOn gets a reference to the given string and assigns it to the CreatedOn field. +func (o *Invoice) SetCreatedOn(v string) { + o.CreatedOn = &v +} + +// GetCreditAmount returns the CreditAmount field value if set, zero value otherwise. +func (o *Invoice) GetCreditAmount() float32 { + if o == nil || IsNil(o.CreditAmount) { + var ret float32 + return ret + } + return *o.CreditAmount +} + +// GetCreditAmountOk returns a tuple with the CreditAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCreditAmountOk() (*float32, bool) { + if o == nil || IsNil(o.CreditAmount) { + return nil, false + } + return o.CreditAmount, true +} + +// HasCreditAmount returns a boolean if a field has been set. +func (o *Invoice) HasCreditAmount() bool { + if o != nil && !IsNil(o.CreditAmount) { + return true + } + + return false +} + +// SetCreditAmount gets a reference to the given float32 and assigns it to the CreditAmount field. +func (o *Invoice) SetCreditAmount(v float32) { + o.CreditAmount = &v +} + +// GetCreditsApplied returns the CreditsApplied field value if set, zero value otherwise. +func (o *Invoice) GetCreditsApplied() float32 { + if o == nil || IsNil(o.CreditsApplied) { + var ret float32 + return ret + } + return *o.CreditsApplied +} + +// GetCreditsAppliedOk returns a tuple with the CreditsApplied field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCreditsAppliedOk() (*float32, bool) { + if o == nil || IsNil(o.CreditsApplied) { + return nil, false + } + return o.CreditsApplied, true +} + +// HasCreditsApplied returns a boolean if a field has been set. +func (o *Invoice) HasCreditsApplied() bool { + if o != nil && !IsNil(o.CreditsApplied) { + return true + } + + return false +} + +// SetCreditsApplied gets a reference to the given float32 and assigns it to the CreditsApplied field. +func (o *Invoice) SetCreditsApplied(v float32) { + o.CreditsApplied = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *Invoice) GetCurrency() string { + if o == nil || IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetCurrencyOk() (*string, bool) { + if o == nil || IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *Invoice) HasCurrency() bool { + if o != nil && !IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *Invoice) SetCurrency(v string) { + o.Currency = &v +} + +// GetDueOn returns the DueOn field value if set, zero value otherwise. +func (o *Invoice) GetDueOn() string { + if o == nil || IsNil(o.DueOn) { + var ret string + return ret + } + return *o.DueOn +} + +// GetDueOnOk returns a tuple with the DueOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetDueOnOk() (*string, bool) { + if o == nil || IsNil(o.DueOn) { + return nil, false + } + return o.DueOn, true +} + +// HasDueOn returns a boolean if a field has been set. +func (o *Invoice) HasDueOn() bool { + if o != nil && !IsNil(o.DueOn) { + return true + } + + return false +} + +// SetDueOn gets a reference to the given string and assigns it to the DueOn field. +func (o *Invoice) SetDueOn(v string) { + o.DueOn = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Invoice) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Invoice) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Invoice) SetId(v string) { + o.Id = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *Invoice) GetItems() []LineItem { + if o == nil || IsNil(o.Items) { + var ret []LineItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetItemsOk() ([]LineItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *Invoice) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []LineItem and assigns it to the Items field. +func (o *Invoice) SetItems(v []LineItem) { + o.Items = v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Invoice) GetNumber() string { + if o == nil || IsNil(o.Number) { + var ret string + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetNumberOk() (*string, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Invoice) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given string and assigns it to the Number field. +func (o *Invoice) SetNumber(v string) { + o.Number = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *Invoice) GetProject() ProjectIdName { + if o == nil || IsNil(o.Project) { + var ret ProjectIdName + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetProjectOk() (*ProjectIdName, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *Invoice) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given ProjectIdName and assigns it to the Project field. +func (o *Invoice) SetProject(v ProjectIdName) { + o.Project = &v +} + +// GetReferenceNumber returns the ReferenceNumber field value if set, zero value otherwise. +func (o *Invoice) GetReferenceNumber() string { + if o == nil || IsNil(o.ReferenceNumber) { + var ret string + return ret + } + return *o.ReferenceNumber +} + +// GetReferenceNumberOk returns a tuple with the ReferenceNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetReferenceNumberOk() (*string, bool) { + if o == nil || IsNil(o.ReferenceNumber) { + return nil, false + } + return o.ReferenceNumber, true +} + +// HasReferenceNumber returns a boolean if a field has been set. +func (o *Invoice) HasReferenceNumber() bool { + if o != nil && !IsNil(o.ReferenceNumber) { + return true + } + + return false +} + +// SetReferenceNumber gets a reference to the given string and assigns it to the ReferenceNumber field. +func (o *Invoice) SetReferenceNumber(v string) { + o.ReferenceNumber = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Invoice) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Invoice) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Invoice) SetStatus(v string) { + o.Status = &v +} + +// GetTargetDate returns the TargetDate field value if set, zero value otherwise. +func (o *Invoice) GetTargetDate() string { + if o == nil || IsNil(o.TargetDate) { + var ret string + return ret + } + return *o.TargetDate +} + +// GetTargetDateOk returns a tuple with the TargetDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invoice) GetTargetDateOk() (*string, bool) { + if o == nil || IsNil(o.TargetDate) { + return nil, false + } + return o.TargetDate, true +} + +// HasTargetDate returns a boolean if a field has been set. +func (o *Invoice) HasTargetDate() bool { + if o != nil && !IsNil(o.TargetDate) { + return true + } + + return false +} + +// SetTargetDate gets a reference to the given string and assigns it to the TargetDate field. +func (o *Invoice) SetTargetDate(v string) { + o.TargetDate = &v +} + +func (o Invoice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Invoice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !IsNil(o.Balance) { + toSerialize["balance"] = o.Balance + } + if !IsNil(o.CreatedOn) { + toSerialize["created_on"] = o.CreatedOn + } + if !IsNil(o.CreditAmount) { + toSerialize["credit_amount"] = o.CreditAmount + } + if !IsNil(o.CreditsApplied) { + toSerialize["credits_applied"] = o.CreditsApplied + } + if !IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !IsNil(o.DueOn) { + toSerialize["due_on"] = o.DueOn + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.ReferenceNumber) { + toSerialize["reference_number"] = o.ReferenceNumber + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TargetDate) { + toSerialize["target_date"] = o.TargetDate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Invoice) UnmarshalJSON(bytes []byte) (err error) { + varInvoice := _Invoice{} + + err = json.Unmarshal(bytes, &varInvoice) + + if err != nil { + return err + } + + *o = Invoice(varInvoice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "balance") + delete(additionalProperties, "created_on") + delete(additionalProperties, "credit_amount") + delete(additionalProperties, "credits_applied") + delete(additionalProperties, "currency") + delete(additionalProperties, "due_on") + delete(additionalProperties, "id") + delete(additionalProperties, "items") + delete(additionalProperties, "number") + delete(additionalProperties, "project") + delete(additionalProperties, "reference_number") + delete(additionalProperties, "status") + delete(additionalProperties, "target_date") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvoice struct { + value *Invoice + isSet bool +} + +func (v NullableInvoice) Get() *Invoice { + return v.value +} + +func (v *NullableInvoice) Set(val *Invoice) { + v.value = val + v.isSet = true +} + +func (v NullableInvoice) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoice(val *Invoice) *NullableInvoice { + return &NullableInvoice{value: val, isSet: true} +} + +func (v NullableInvoice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_invoice_list.go b/services/metalv1/model_invoice_list.go new file mode 100644 index 00000000..38b3ecb1 --- /dev/null +++ b/services/metalv1/model_invoice_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the InvoiceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvoiceList{} + +// InvoiceList struct for InvoiceList +type InvoiceList struct { + Invoices []Invoice `json:"invoices,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvoiceList InvoiceList + +// NewInvoiceList instantiates a new InvoiceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceList() *InvoiceList { + this := InvoiceList{} + return &this +} + +// NewInvoiceListWithDefaults instantiates a new InvoiceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceListWithDefaults() *InvoiceList { + this := InvoiceList{} + return &this +} + +// GetInvoices returns the Invoices field value if set, zero value otherwise. +func (o *InvoiceList) GetInvoices() []Invoice { + if o == nil || IsNil(o.Invoices) { + var ret []Invoice + return ret + } + return o.Invoices +} + +// GetInvoicesOk returns a tuple with the Invoices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceList) GetInvoicesOk() ([]Invoice, bool) { + if o == nil || IsNil(o.Invoices) { + return nil, false + } + return o.Invoices, true +} + +// HasInvoices returns a boolean if a field has been set. +func (o *InvoiceList) HasInvoices() bool { + if o != nil && !IsNil(o.Invoices) { + return true + } + + return false +} + +// SetInvoices gets a reference to the given []Invoice and assigns it to the Invoices field. +func (o *InvoiceList) SetInvoices(v []Invoice) { + o.Invoices = v +} + +func (o InvoiceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Invoices) { + toSerialize["invoices"] = o.Invoices + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvoiceList) UnmarshalJSON(bytes []byte) (err error) { + varInvoiceList := _InvoiceList{} + + err = json.Unmarshal(bytes, &varInvoiceList) + + if err != nil { + return err + } + + *o = InvoiceList(varInvoiceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "invoices") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvoiceList struct { + value *InvoiceList + isSet bool +} + +func (v NullableInvoiceList) Get() *InvoiceList { + return v.value +} + +func (v *NullableInvoiceList) Set(val *InvoiceList) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceList) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceList(val *InvoiceList) *NullableInvoiceList { + return &NullableInvoiceList{value: val, isSet: true} +} + +func (v NullableInvoiceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_address.go b/services/metalv1/model_ip_address.go new file mode 100644 index 00000000..bc3b3514 --- /dev/null +++ b/services/metalv1/model_ip_address.go @@ -0,0 +1,272 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPAddress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAddress{} + +// IPAddress struct for IPAddress +type IPAddress struct { + AddressFamily *IPAddressAddressFamily `json:"address_family,omitempty"` + // Cidr Size for the IP Block created. Valid values depends on the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 for IPv6 addresses) + Cidr *int32 `json:"cidr,omitempty"` + // UUIDs of any IP reservations to use when assigning IPs + IpReservations []string `json:"ip_reservations,omitempty"` + // Address Type for IP Address + Public *bool `json:"public,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAddress IPAddress + +// NewIPAddress instantiates a new IPAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAddress() *IPAddress { + this := IPAddress{} + var public bool = true + this.Public = &public + return &this +} + +// NewIPAddressWithDefaults instantiates a new IPAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAddressWithDefaults() *IPAddress { + this := IPAddress{} + var public bool = true + this.Public = &public + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *IPAddress) GetAddressFamily() IPAddressAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret IPAddressAddressFamily + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetAddressFamilyOk() (*IPAddressAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *IPAddress) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given IPAddressAddressFamily and assigns it to the AddressFamily field. +func (o *IPAddress) SetAddressFamily(v IPAddressAddressFamily) { + o.AddressFamily = &v +} + +// GetCidr returns the Cidr field value if set, zero value otherwise. +func (o *IPAddress) GetCidr() int32 { + if o == nil || IsNil(o.Cidr) { + var ret int32 + return ret + } + return *o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetCidrOk() (*int32, bool) { + if o == nil || IsNil(o.Cidr) { + return nil, false + } + return o.Cidr, true +} + +// HasCidr returns a boolean if a field has been set. +func (o *IPAddress) HasCidr() bool { + if o != nil && !IsNil(o.Cidr) { + return true + } + + return false +} + +// SetCidr gets a reference to the given int32 and assigns it to the Cidr field. +func (o *IPAddress) SetCidr(v int32) { + o.Cidr = &v +} + +// GetIpReservations returns the IpReservations field value if set, zero value otherwise. +func (o *IPAddress) GetIpReservations() []string { + if o == nil || IsNil(o.IpReservations) { + var ret []string + return ret + } + return o.IpReservations +} + +// GetIpReservationsOk returns a tuple with the IpReservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetIpReservationsOk() ([]string, bool) { + if o == nil || IsNil(o.IpReservations) { + return nil, false + } + return o.IpReservations, true +} + +// HasIpReservations returns a boolean if a field has been set. +func (o *IPAddress) HasIpReservations() bool { + if o != nil && !IsNil(o.IpReservations) { + return true + } + + return false +} + +// SetIpReservations gets a reference to the given []string and assigns it to the IpReservations field. +func (o *IPAddress) SetIpReservations(v []string) { + o.IpReservations = v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *IPAddress) GetPublic() bool { + if o == nil || IsNil(o.Public) { + var ret bool + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAddress) GetPublicOk() (*bool, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *IPAddress) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given bool and assigns it to the Public field. +func (o *IPAddress) SetPublic(v bool) { + o.Public = &v +} + +func (o IPAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.Cidr) { + toSerialize["cidr"] = o.Cidr + } + if !IsNil(o.IpReservations) { + toSerialize["ip_reservations"] = o.IpReservations + } + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAddress) UnmarshalJSON(bytes []byte) (err error) { + varIPAddress := _IPAddress{} + + err = json.Unmarshal(bytes, &varIPAddress) + + if err != nil { + return err + } + + *o = IPAddress(varIPAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "cidr") + delete(additionalProperties, "ip_reservations") + delete(additionalProperties, "public") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAddress struct { + value *IPAddress + isSet bool +} + +func (v NullableIPAddress) Get() *IPAddress { + return v.value +} + +func (v *NullableIPAddress) Set(val *IPAddress) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddress(val *IPAddress) *NullableIPAddress { + return &NullableIPAddress{value: val, isSet: true} +} + +func (v NullableIPAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_address_address_family.go b/services/metalv1/model_ip_address_address_family.go new file mode 100644 index 00000000..bca64316 --- /dev/null +++ b/services/metalv1/model_ip_address_address_family.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// IPAddressAddressFamily Address Family for IP Address +type IPAddressAddressFamily int32 + +// List of IPAddress_address_family +const ( + IPADDRESSADDRESSFAMILY__4 IPAddressAddressFamily = 4 + IPADDRESSADDRESSFAMILY__6 IPAddressAddressFamily = 6 +) + +// All allowed values of IPAddressAddressFamily enum +var AllowedIPAddressAddressFamilyEnumValues = []IPAddressAddressFamily{ + 4, + 6, +} + +func (v *IPAddressAddressFamily) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAddressAddressFamily(value) + for _, existing := range AllowedIPAddressAddressFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAddressAddressFamily", value) +} + +// NewIPAddressAddressFamilyFromValue returns a pointer to a valid IPAddressAddressFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAddressAddressFamilyFromValue(v int32) (*IPAddressAddressFamily, error) { + ev := IPAddressAddressFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAddressAddressFamily: valid values are %v", v, AllowedIPAddressAddressFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAddressAddressFamily) IsValid() bool { + for _, existing := range AllowedIPAddressAddressFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAddress_address_family value +func (v IPAddressAddressFamily) Ptr() *IPAddressAddressFamily { + return &v +} + +type NullableIPAddressAddressFamily struct { + value *IPAddressAddressFamily + isSet bool +} + +func (v NullableIPAddressAddressFamily) Get() *IPAddressAddressFamily { + return v.value +} + +func (v *NullableIPAddressAddressFamily) Set(val *IPAddressAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableIPAddressAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAddressAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAddressAddressFamily(val *IPAddressAddressFamily) *NullableIPAddressAddressFamily { + return &NullableIPAddressAddressFamily{value: val, isSet: true} +} + +func (v NullableIPAddressAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAddressAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment.go b/services/metalv1/model_ip_assignment.go new file mode 100644 index 00000000..f9e94486 --- /dev/null +++ b/services/metalv1/model_ip_assignment.go @@ -0,0 +1,859 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the IPAssignment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAssignment{} + +// IPAssignment struct for IPAssignment +type IPAssignment struct { + Address *string `json:"address,omitempty"` + AddressFamily *int32 `json:"address_family,omitempty"` + AssignedTo *Href `json:"assigned_to,omitempty"` + Cidr *int32 `json:"cidr,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Gateway *string `json:"gateway,omitempty"` + GlobalIp *bool `json:"global_ip,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Manageable *bool `json:"manageable,omitempty"` + Management *bool `json:"management,omitempty"` + Metro *IPAssignmentMetro `json:"metro,omitempty"` + Netmask *string `json:"netmask,omitempty"` + Network *string `json:"network,omitempty"` + ParentBlock *ParentBlock `json:"parent_block,omitempty"` + Public *bool `json:"public,omitempty"` + State *IPAssignmentState `json:"state,omitempty"` + // Only set when this is a Metal Gateway Elastic IP Assignment. The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. + NextHop *string `json:"next_hop,omitempty"` + Type *IPAssignmentType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAssignment IPAssignment + +// NewIPAssignment instantiates a new IPAssignment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAssignment() *IPAssignment { + this := IPAssignment{} + return &this +} + +// NewIPAssignmentWithDefaults instantiates a new IPAssignment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAssignmentWithDefaults() *IPAssignment { + this := IPAssignment{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *IPAssignment) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *IPAssignment) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *IPAssignment) SetAddress(v string) { + o.Address = &v +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *IPAssignment) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *IPAssignment) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *IPAssignment) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetAssignedTo returns the AssignedTo field value if set, zero value otherwise. +func (o *IPAssignment) GetAssignedTo() Href { + if o == nil || IsNil(o.AssignedTo) { + var ret Href + return ret + } + return *o.AssignedTo +} + +// GetAssignedToOk returns a tuple with the AssignedTo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetAssignedToOk() (*Href, bool) { + if o == nil || IsNil(o.AssignedTo) { + return nil, false + } + return o.AssignedTo, true +} + +// HasAssignedTo returns a boolean if a field has been set. +func (o *IPAssignment) HasAssignedTo() bool { + if o != nil && !IsNil(o.AssignedTo) { + return true + } + + return false +} + +// SetAssignedTo gets a reference to the given Href and assigns it to the AssignedTo field. +func (o *IPAssignment) SetAssignedTo(v Href) { + o.AssignedTo = &v +} + +// GetCidr returns the Cidr field value if set, zero value otherwise. +func (o *IPAssignment) GetCidr() int32 { + if o == nil || IsNil(o.Cidr) { + var ret int32 + return ret + } + return *o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetCidrOk() (*int32, bool) { + if o == nil || IsNil(o.Cidr) { + return nil, false + } + return o.Cidr, true +} + +// HasCidr returns a boolean if a field has been set. +func (o *IPAssignment) HasCidr() bool { + if o != nil && !IsNil(o.Cidr) { + return true + } + + return false +} + +// SetCidr gets a reference to the given int32 and assigns it to the Cidr field. +func (o *IPAssignment) SetCidr(v int32) { + o.Cidr = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *IPAssignment) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *IPAssignment) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *IPAssignment) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *IPAssignment) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *IPAssignment) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *IPAssignment) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise. +func (o *IPAssignment) GetGateway() string { + if o == nil || IsNil(o.Gateway) { + var ret string + return ret + } + return *o.Gateway +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway, true +} + +// HasGateway returns a boolean if a field has been set. +func (o *IPAssignment) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *IPAssignment) SetGateway(v string) { + o.Gateway = &v +} + +// GetGlobalIp returns the GlobalIp field value if set, zero value otherwise. +func (o *IPAssignment) GetGlobalIp() bool { + if o == nil || IsNil(o.GlobalIp) { + var ret bool + return ret + } + return *o.GlobalIp +} + +// GetGlobalIpOk returns a tuple with the GlobalIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetGlobalIpOk() (*bool, bool) { + if o == nil || IsNil(o.GlobalIp) { + return nil, false + } + return o.GlobalIp, true +} + +// HasGlobalIp returns a boolean if a field has been set. +func (o *IPAssignment) HasGlobalIp() bool { + if o != nil && !IsNil(o.GlobalIp) { + return true + } + + return false +} + +// SetGlobalIp gets a reference to the given bool and assigns it to the GlobalIp field. +func (o *IPAssignment) SetGlobalIp(v bool) { + o.GlobalIp = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *IPAssignment) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *IPAssignment) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *IPAssignment) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IPAssignment) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IPAssignment) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *IPAssignment) SetId(v string) { + o.Id = &v +} + +// GetManageable returns the Manageable field value if set, zero value otherwise. +func (o *IPAssignment) GetManageable() bool { + if o == nil || IsNil(o.Manageable) { + var ret bool + return ret + } + return *o.Manageable +} + +// GetManageableOk returns a tuple with the Manageable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetManageableOk() (*bool, bool) { + if o == nil || IsNil(o.Manageable) { + return nil, false + } + return o.Manageable, true +} + +// HasManageable returns a boolean if a field has been set. +func (o *IPAssignment) HasManageable() bool { + if o != nil && !IsNil(o.Manageable) { + return true + } + + return false +} + +// SetManageable gets a reference to the given bool and assigns it to the Manageable field. +func (o *IPAssignment) SetManageable(v bool) { + o.Manageable = &v +} + +// GetManagement returns the Management field value if set, zero value otherwise. +func (o *IPAssignment) GetManagement() bool { + if o == nil || IsNil(o.Management) { + var ret bool + return ret + } + return *o.Management +} + +// GetManagementOk returns a tuple with the Management field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetManagementOk() (*bool, bool) { + if o == nil || IsNil(o.Management) { + return nil, false + } + return o.Management, true +} + +// HasManagement returns a boolean if a field has been set. +func (o *IPAssignment) HasManagement() bool { + if o != nil && !IsNil(o.Management) { + return true + } + + return false +} + +// SetManagement gets a reference to the given bool and assigns it to the Management field. +func (o *IPAssignment) SetManagement(v bool) { + o.Management = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *IPAssignment) GetMetro() IPAssignmentMetro { + if o == nil || IsNil(o.Metro) { + var ret IPAssignmentMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetMetroOk() (*IPAssignmentMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *IPAssignment) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given IPAssignmentMetro and assigns it to the Metro field. +func (o *IPAssignment) SetMetro(v IPAssignmentMetro) { + o.Metro = &v +} + +// GetNetmask returns the Netmask field value if set, zero value otherwise. +func (o *IPAssignment) GetNetmask() string { + if o == nil || IsNil(o.Netmask) { + var ret string + return ret + } + return *o.Netmask +} + +// GetNetmaskOk returns a tuple with the Netmask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetNetmaskOk() (*string, bool) { + if o == nil || IsNil(o.Netmask) { + return nil, false + } + return o.Netmask, true +} + +// HasNetmask returns a boolean if a field has been set. +func (o *IPAssignment) HasNetmask() bool { + if o != nil && !IsNil(o.Netmask) { + return true + } + + return false +} + +// SetNetmask gets a reference to the given string and assigns it to the Netmask field. +func (o *IPAssignment) SetNetmask(v string) { + o.Netmask = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *IPAssignment) GetNetwork() string { + if o == nil || IsNil(o.Network) { + var ret string + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetNetworkOk() (*string, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *IPAssignment) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given string and assigns it to the Network field. +func (o *IPAssignment) SetNetwork(v string) { + o.Network = &v +} + +// GetParentBlock returns the ParentBlock field value if set, zero value otherwise. +func (o *IPAssignment) GetParentBlock() ParentBlock { + if o == nil || IsNil(o.ParentBlock) { + var ret ParentBlock + return ret + } + return *o.ParentBlock +} + +// GetParentBlockOk returns a tuple with the ParentBlock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetParentBlockOk() (*ParentBlock, bool) { + if o == nil || IsNil(o.ParentBlock) { + return nil, false + } + return o.ParentBlock, true +} + +// HasParentBlock returns a boolean if a field has been set. +func (o *IPAssignment) HasParentBlock() bool { + if o != nil && !IsNil(o.ParentBlock) { + return true + } + + return false +} + +// SetParentBlock gets a reference to the given ParentBlock and assigns it to the ParentBlock field. +func (o *IPAssignment) SetParentBlock(v ParentBlock) { + o.ParentBlock = &v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *IPAssignment) GetPublic() bool { + if o == nil || IsNil(o.Public) { + var ret bool + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetPublicOk() (*bool, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *IPAssignment) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given bool and assigns it to the Public field. +func (o *IPAssignment) SetPublic(v bool) { + o.Public = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *IPAssignment) GetState() IPAssignmentState { + if o == nil || IsNil(o.State) { + var ret IPAssignmentState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetStateOk() (*IPAssignmentState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *IPAssignment) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given IPAssignmentState and assigns it to the State field. +func (o *IPAssignment) SetState(v IPAssignmentState) { + o.State = &v +} + +// GetNextHop returns the NextHop field value if set, zero value otherwise. +func (o *IPAssignment) GetNextHop() string { + if o == nil || IsNil(o.NextHop) { + var ret string + return ret + } + return *o.NextHop +} + +// GetNextHopOk returns a tuple with the NextHop field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetNextHopOk() (*string, bool) { + if o == nil || IsNil(o.NextHop) { + return nil, false + } + return o.NextHop, true +} + +// HasNextHop returns a boolean if a field has been set. +func (o *IPAssignment) HasNextHop() bool { + if o != nil && !IsNil(o.NextHop) { + return true + } + + return false +} + +// SetNextHop gets a reference to the given string and assigns it to the NextHop field. +func (o *IPAssignment) SetNextHop(v string) { + o.NextHop = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *IPAssignment) GetType() IPAssignmentType { + if o == nil || IsNil(o.Type) { + var ret IPAssignmentType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignment) GetTypeOk() (*IPAssignmentType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *IPAssignment) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given IPAssignmentType and assigns it to the Type field. +func (o *IPAssignment) SetType(v IPAssignmentType) { + o.Type = &v +} + +func (o IPAssignment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAssignment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.AssignedTo) { + toSerialize["assigned_to"] = o.AssignedTo + } + if !IsNil(o.Cidr) { + toSerialize["cidr"] = o.Cidr + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Gateway) { + toSerialize["gateway"] = o.Gateway + } + if !IsNil(o.GlobalIp) { + toSerialize["global_ip"] = o.GlobalIp + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Manageable) { + toSerialize["manageable"] = o.Manageable + } + if !IsNil(o.Management) { + toSerialize["management"] = o.Management + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Netmask) { + toSerialize["netmask"] = o.Netmask + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.ParentBlock) { + toSerialize["parent_block"] = o.ParentBlock + } + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.NextHop) { + toSerialize["next_hop"] = o.NextHop + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAssignment) UnmarshalJSON(bytes []byte) (err error) { + varIPAssignment := _IPAssignment{} + + err = json.Unmarshal(bytes, &varIPAssignment) + + if err != nil { + return err + } + + *o = IPAssignment(varIPAssignment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "address_family") + delete(additionalProperties, "assigned_to") + delete(additionalProperties, "cidr") + delete(additionalProperties, "created_at") + delete(additionalProperties, "enabled") + delete(additionalProperties, "gateway") + delete(additionalProperties, "global_ip") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "manageable") + delete(additionalProperties, "management") + delete(additionalProperties, "metro") + delete(additionalProperties, "netmask") + delete(additionalProperties, "network") + delete(additionalProperties, "parent_block") + delete(additionalProperties, "public") + delete(additionalProperties, "state") + delete(additionalProperties, "next_hop") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAssignment struct { + value *IPAssignment + isSet bool +} + +func (v NullableIPAssignment) Get() *IPAssignment { + return v.value +} + +func (v *NullableIPAssignment) Set(val *IPAssignment) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignment) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignment(val *IPAssignment) *NullableIPAssignment { + return &NullableIPAssignment{value: val, isSet: true} +} + +func (v NullableIPAssignment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_input.go b/services/metalv1/model_ip_assignment_input.go new file mode 100644 index 00000000..553745be --- /dev/null +++ b/services/metalv1/model_ip_assignment_input.go @@ -0,0 +1,204 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPAssignmentInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAssignmentInput{} + +// IPAssignmentInput struct for IPAssignmentInput +type IPAssignmentInput struct { + Address string `json:"address"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAssignmentInput IPAssignmentInput + +// NewIPAssignmentInput instantiates a new IPAssignmentInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAssignmentInput(address string) *IPAssignmentInput { + this := IPAssignmentInput{} + this.Address = address + return &this +} + +// NewIPAssignmentInputWithDefaults instantiates a new IPAssignmentInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAssignmentInputWithDefaults() *IPAssignmentInput { + this := IPAssignmentInput{} + return &this +} + +// GetAddress returns the Address field value +func (o *IPAssignmentInput) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *IPAssignmentInput) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *IPAssignmentInput) SetAddress(v string) { + o.Address = v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *IPAssignmentInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *IPAssignmentInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *IPAssignmentInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +func (o IPAssignmentInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAssignmentInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAssignmentInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPAssignmentInput := _IPAssignmentInput{} + + err = json.Unmarshal(bytes, &varIPAssignmentInput) + + if err != nil { + return err + } + + *o = IPAssignmentInput(varIPAssignmentInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "customdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAssignmentInput struct { + value *IPAssignmentInput + isSet bool +} + +func (v NullableIPAssignmentInput) Get() *IPAssignmentInput { + return v.value +} + +func (v *NullableIPAssignmentInput) Set(val *IPAssignmentInput) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentInput) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentInput(val *IPAssignmentInput) *NullableIPAssignmentInput { + return &NullableIPAssignmentInput{value: val, isSet: true} +} + +func (v NullableIPAssignmentInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_list.go b/services/metalv1/model_ip_assignment_list.go new file mode 100644 index 00000000..1af6b957 --- /dev/null +++ b/services/metalv1/model_ip_assignment_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPAssignmentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAssignmentList{} + +// IPAssignmentList struct for IPAssignmentList +type IPAssignmentList struct { + IpAddresses []IPAssignment `json:"ip_addresses,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAssignmentList IPAssignmentList + +// NewIPAssignmentList instantiates a new IPAssignmentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAssignmentList() *IPAssignmentList { + this := IPAssignmentList{} + return &this +} + +// NewIPAssignmentListWithDefaults instantiates a new IPAssignmentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAssignmentListWithDefaults() *IPAssignmentList { + this := IPAssignmentList{} + return &this +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *IPAssignmentList) GetIpAddresses() []IPAssignment { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPAssignment + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentList) GetIpAddressesOk() ([]IPAssignment, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *IPAssignmentList) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPAssignment and assigns it to the IpAddresses field. +func (o *IPAssignmentList) SetIpAddresses(v []IPAssignment) { + o.IpAddresses = v +} + +func (o IPAssignmentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAssignmentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAssignmentList) UnmarshalJSON(bytes []byte) (err error) { + varIPAssignmentList := _IPAssignmentList{} + + err = json.Unmarshal(bytes, &varIPAssignmentList) + + if err != nil { + return err + } + + *o = IPAssignmentList(varIPAssignmentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ip_addresses") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAssignmentList struct { + value *IPAssignmentList + isSet bool +} + +func (v NullableIPAssignmentList) Get() *IPAssignmentList { + return v.value +} + +func (v *NullableIPAssignmentList) Set(val *IPAssignmentList) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentList) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentList(val *IPAssignmentList) *NullableIPAssignmentList { + return &NullableIPAssignmentList{value: val, isSet: true} +} + +func (v NullableIPAssignmentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_metro.go b/services/metalv1/model_ip_assignment_metro.go new file mode 100644 index 00000000..07eca31e --- /dev/null +++ b/services/metalv1/model_ip_assignment_metro.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPAssignmentMetro type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAssignmentMetro{} + +// IPAssignmentMetro struct for IPAssignmentMetro +type IPAssignmentMetro struct { + Code *string `json:"code,omitempty"` + Country *string `json:"country,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAssignmentMetro IPAssignmentMetro + +// NewIPAssignmentMetro instantiates a new IPAssignmentMetro object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAssignmentMetro() *IPAssignmentMetro { + this := IPAssignmentMetro{} + return &this +} + +// NewIPAssignmentMetroWithDefaults instantiates a new IPAssignmentMetro object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAssignmentMetroWithDefaults() *IPAssignmentMetro { + this := IPAssignmentMetro{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *IPAssignmentMetro) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentMetro) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *IPAssignmentMetro) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *IPAssignmentMetro) SetCode(v string) { + o.Code = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *IPAssignmentMetro) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentMetro) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *IPAssignmentMetro) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *IPAssignmentMetro) SetCountry(v string) { + o.Country = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IPAssignmentMetro) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentMetro) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IPAssignmentMetro) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *IPAssignmentMetro) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *IPAssignmentMetro) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentMetro) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *IPAssignmentMetro) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *IPAssignmentMetro) SetName(v string) { + o.Name = &v +} + +func (o IPAssignmentMetro) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAssignmentMetro) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAssignmentMetro) UnmarshalJSON(bytes []byte) (err error) { + varIPAssignmentMetro := _IPAssignmentMetro{} + + err = json.Unmarshal(bytes, &varIPAssignmentMetro) + + if err != nil { + return err + } + + *o = IPAssignmentMetro(varIPAssignmentMetro) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "country") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAssignmentMetro struct { + value *IPAssignmentMetro + isSet bool +} + +func (v NullableIPAssignmentMetro) Get() *IPAssignmentMetro { + return v.value +} + +func (v *NullableIPAssignmentMetro) Set(val *IPAssignmentMetro) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentMetro) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentMetro) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentMetro(val *IPAssignmentMetro) *NullableIPAssignmentMetro { + return &NullableIPAssignmentMetro{value: val, isSet: true} +} + +func (v NullableIPAssignmentMetro) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentMetro) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_state.go b/services/metalv1/model_ip_assignment_state.go new file mode 100644 index 00000000..608c140b --- /dev/null +++ b/services/metalv1/model_ip_assignment_state.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// IPAssignmentState Only set when this is a Metal Gateway Elastic IP Assignment. Describes the current configuration state of this IP on the network. +type IPAssignmentState string + +// List of IPAssignment_state +const ( + IPASSIGNMENTSTATE_PENDING IPAssignmentState = "pending" + IPASSIGNMENTSTATE_ACTIVE IPAssignmentState = "active" + IPASSIGNMENTSTATE_DELETING IPAssignmentState = "deleting" +) + +// All allowed values of IPAssignmentState enum +var AllowedIPAssignmentStateEnumValues = []IPAssignmentState{ + "pending", + "active", + "deleting", +} + +func (v *IPAssignmentState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAssignmentState(value) + for _, existing := range AllowedIPAssignmentStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAssignmentState", value) +} + +// NewIPAssignmentStateFromValue returns a pointer to a valid IPAssignmentState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAssignmentStateFromValue(v string) (*IPAssignmentState, error) { + ev := IPAssignmentState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAssignmentState: valid values are %v", v, AllowedIPAssignmentStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAssignmentState) IsValid() bool { + for _, existing := range AllowedIPAssignmentStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAssignment_state value +func (v IPAssignmentState) Ptr() *IPAssignmentState { + return &v +} + +type NullableIPAssignmentState struct { + value *IPAssignmentState + isSet bool +} + +func (v NullableIPAssignmentState) Get() *IPAssignmentState { + return v.value +} + +func (v *NullableIPAssignmentState) Set(val *IPAssignmentState) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentState) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentState(val *IPAssignmentState) *NullableIPAssignmentState { + return &NullableIPAssignmentState{value: val, isSet: true} +} + +func (v NullableIPAssignmentState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_type.go b/services/metalv1/model_ip_assignment_type.go new file mode 100644 index 00000000..d2c34cd3 --- /dev/null +++ b/services/metalv1/model_ip_assignment_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// IPAssignmentType the model 'IPAssignmentType' +type IPAssignmentType string + +// List of IPAssignment_type +const ( + IPASSIGNMENTTYPE_IP_ASSIGNMENT IPAssignmentType = "IPAssignment" +) + +// All allowed values of IPAssignmentType enum +var AllowedIPAssignmentTypeEnumValues = []IPAssignmentType{ + "IPAssignment", +} + +func (v *IPAssignmentType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPAssignmentType(value) + for _, existing := range AllowedIPAssignmentTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPAssignmentType", value) +} + +// NewIPAssignmentTypeFromValue returns a pointer to a valid IPAssignmentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPAssignmentTypeFromValue(v string) (*IPAssignmentType, error) { + ev := IPAssignmentType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPAssignmentType: valid values are %v", v, AllowedIPAssignmentTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPAssignmentType) IsValid() bool { + for _, existing := range AllowedIPAssignmentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPAssignment_type value +func (v IPAssignmentType) Ptr() *IPAssignmentType { + return &v +} + +type NullableIPAssignmentType struct { + value *IPAssignmentType + isSet bool +} + +func (v NullableIPAssignmentType) Get() *IPAssignmentType { + return v.value +} + +func (v *NullableIPAssignmentType) Set(val *IPAssignmentType) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentType) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentType(val *IPAssignmentType) *NullableIPAssignmentType { + return &NullableIPAssignmentType{value: val, isSet: true} +} + +func (v NullableIPAssignmentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_assignment_update_input.go b/services/metalv1/model_ip_assignment_update_input.go new file mode 100644 index 00000000..d4ca0a0c --- /dev/null +++ b/services/metalv1/model_ip_assignment_update_input.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPAssignmentUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAssignmentUpdateInput{} + +// IPAssignmentUpdateInput struct for IPAssignmentUpdateInput +type IPAssignmentUpdateInput struct { + Details *string `json:"details,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAssignmentUpdateInput IPAssignmentUpdateInput + +// NewIPAssignmentUpdateInput instantiates a new IPAssignmentUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAssignmentUpdateInput() *IPAssignmentUpdateInput { + this := IPAssignmentUpdateInput{} + return &this +} + +// NewIPAssignmentUpdateInputWithDefaults instantiates a new IPAssignmentUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAssignmentUpdateInputWithDefaults() *IPAssignmentUpdateInput { + this := IPAssignmentUpdateInput{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *IPAssignmentUpdateInput) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentUpdateInput) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *IPAssignmentUpdateInput) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *IPAssignmentUpdateInput) SetDetails(v string) { + o.Details = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *IPAssignmentUpdateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentUpdateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *IPAssignmentUpdateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *IPAssignmentUpdateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPAssignmentUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAssignmentUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPAssignmentUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *IPAssignmentUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o IPAssignmentUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAssignmentUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAssignmentUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varIPAssignmentUpdateInput := _IPAssignmentUpdateInput{} + + err = json.Unmarshal(bytes, &varIPAssignmentUpdateInput) + + if err != nil { + return err + } + + *o = IPAssignmentUpdateInput(varIPAssignmentUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "details") + delete(additionalProperties, "customdata") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAssignmentUpdateInput struct { + value *IPAssignmentUpdateInput + isSet bool +} + +func (v NullableIPAssignmentUpdateInput) Get() *IPAssignmentUpdateInput { + return v.value +} + +func (v *NullableIPAssignmentUpdateInput) Set(val *IPAssignmentUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableIPAssignmentUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAssignmentUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAssignmentUpdateInput(val *IPAssignmentUpdateInput) *NullableIPAssignmentUpdateInput { + return &NullableIPAssignmentUpdateInput{value: val, isSet: true} +} + +func (v NullableIPAssignmentUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAssignmentUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_availabilities_list.go b/services/metalv1/model_ip_availabilities_list.go new file mode 100644 index 00000000..734d73d9 --- /dev/null +++ b/services/metalv1/model_ip_availabilities_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPAvailabilitiesList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPAvailabilitiesList{} + +// IPAvailabilitiesList struct for IPAvailabilitiesList +type IPAvailabilitiesList struct { + Available []string `json:"available,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPAvailabilitiesList IPAvailabilitiesList + +// NewIPAvailabilitiesList instantiates a new IPAvailabilitiesList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPAvailabilitiesList() *IPAvailabilitiesList { + this := IPAvailabilitiesList{} + return &this +} + +// NewIPAvailabilitiesListWithDefaults instantiates a new IPAvailabilitiesList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPAvailabilitiesListWithDefaults() *IPAvailabilitiesList { + this := IPAvailabilitiesList{} + return &this +} + +// GetAvailable returns the Available field value if set, zero value otherwise. +func (o *IPAvailabilitiesList) GetAvailable() []string { + if o == nil || IsNil(o.Available) { + var ret []string + return ret + } + return o.Available +} + +// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPAvailabilitiesList) GetAvailableOk() ([]string, bool) { + if o == nil || IsNil(o.Available) { + return nil, false + } + return o.Available, true +} + +// HasAvailable returns a boolean if a field has been set. +func (o *IPAvailabilitiesList) HasAvailable() bool { + if o != nil && !IsNil(o.Available) { + return true + } + + return false +} + +// SetAvailable gets a reference to the given []string and assigns it to the Available field. +func (o *IPAvailabilitiesList) SetAvailable(v []string) { + o.Available = v +} + +func (o IPAvailabilitiesList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPAvailabilitiesList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Available) { + toSerialize["available"] = o.Available + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPAvailabilitiesList) UnmarshalJSON(bytes []byte) (err error) { + varIPAvailabilitiesList := _IPAvailabilitiesList{} + + err = json.Unmarshal(bytes, &varIPAvailabilitiesList) + + if err != nil { + return err + } + + *o = IPAvailabilitiesList(varIPAvailabilitiesList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "available") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPAvailabilitiesList struct { + value *IPAvailabilitiesList + isSet bool +} + +func (v NullableIPAvailabilitiesList) Get() *IPAvailabilitiesList { + return v.value +} + +func (v *NullableIPAvailabilitiesList) Set(val *IPAvailabilitiesList) { + v.value = val + v.isSet = true +} + +func (v NullableIPAvailabilitiesList) IsSet() bool { + return v.isSet +} + +func (v *NullableIPAvailabilitiesList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPAvailabilitiesList(val *IPAvailabilitiesList) *NullableIPAvailabilitiesList { + return &NullableIPAvailabilitiesList{value: val, isSet: true} +} + +func (v NullableIPAvailabilitiesList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPAvailabilitiesList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation.go b/services/metalv1/model_ip_reservation.go new file mode 100644 index 00000000..1adc1872 --- /dev/null +++ b/services/metalv1/model_ip_reservation.go @@ -0,0 +1,1163 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the IPReservation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPReservation{} + +// IPReservation struct for IPReservation +type IPReservation struct { + Addon *bool `json:"addon,omitempty"` + Address *string `json:"address,omitempty"` + AddressFamily *int32 `json:"address_family,omitempty"` + Assignments []IPAssignment `json:"assignments,omitempty"` + Available *string `json:"available,omitempty"` + Bill *bool `json:"bill,omitempty"` + Cidr *int32 `json:"cidr,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Details *string `json:"details,omitempty"` + Facility *IPReservationFacility `json:"facility,omitempty"` + Gateway *string `json:"gateway,omitempty"` + GlobalIp *bool `json:"global_ip,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Manageable *bool `json:"manageable,omitempty"` + Management *bool `json:"management,omitempty"` + MetalGateway *MetalGatewayLite `json:"metal_gateway,omitempty"` + Metro *IPReservationMetro `json:"metro,omitempty"` + Netmask *string `json:"netmask,omitempty"` + Network *string `json:"network,omitempty"` + Project *Project `json:"project,omitempty"` + ProjectLite *Href `json:"project_lite,omitempty"` + RequestedBy *Href `json:"requested_by,omitempty"` + Public *bool `json:"public,omitempty"` + State *string `json:"state,omitempty"` + Tags []string `json:"tags,omitempty"` + Type IPReservationType `json:"type"` +} + +type _IPReservation IPReservation + +// NewIPReservation instantiates a new IPReservation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPReservation(type_ IPReservationType) *IPReservation { + this := IPReservation{} + this.Type = type_ + return &this +} + +// NewIPReservationWithDefaults instantiates a new IPReservation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPReservationWithDefaults() *IPReservation { + this := IPReservation{} + return &this +} + +// GetAddon returns the Addon field value if set, zero value otherwise. +func (o *IPReservation) GetAddon() bool { + if o == nil || IsNil(o.Addon) { + var ret bool + return ret + } + return *o.Addon +} + +// GetAddonOk returns a tuple with the Addon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetAddonOk() (*bool, bool) { + if o == nil || IsNil(o.Addon) { + return nil, false + } + return o.Addon, true +} + +// HasAddon returns a boolean if a field has been set. +func (o *IPReservation) HasAddon() bool { + if o != nil && !IsNil(o.Addon) { + return true + } + + return false +} + +// SetAddon gets a reference to the given bool and assigns it to the Addon field. +func (o *IPReservation) SetAddon(v bool) { + o.Addon = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *IPReservation) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *IPReservation) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *IPReservation) SetAddress(v string) { + o.Address = &v +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *IPReservation) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *IPReservation) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *IPReservation) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetAssignments returns the Assignments field value if set, zero value otherwise. +func (o *IPReservation) GetAssignments() []IPAssignment { + if o == nil || IsNil(o.Assignments) { + var ret []IPAssignment + return ret + } + return o.Assignments +} + +// GetAssignmentsOk returns a tuple with the Assignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetAssignmentsOk() ([]IPAssignment, bool) { + if o == nil || IsNil(o.Assignments) { + return nil, false + } + return o.Assignments, true +} + +// HasAssignments returns a boolean if a field has been set. +func (o *IPReservation) HasAssignments() bool { + if o != nil && !IsNil(o.Assignments) { + return true + } + + return false +} + +// SetAssignments gets a reference to the given []IPAssignment and assigns it to the Assignments field. +func (o *IPReservation) SetAssignments(v []IPAssignment) { + o.Assignments = v +} + +// GetAvailable returns the Available field value if set, zero value otherwise. +func (o *IPReservation) GetAvailable() string { + if o == nil || IsNil(o.Available) { + var ret string + return ret + } + return *o.Available +} + +// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetAvailableOk() (*string, bool) { + if o == nil || IsNil(o.Available) { + return nil, false + } + return o.Available, true +} + +// HasAvailable returns a boolean if a field has been set. +func (o *IPReservation) HasAvailable() bool { + if o != nil && !IsNil(o.Available) { + return true + } + + return false +} + +// SetAvailable gets a reference to the given string and assigns it to the Available field. +func (o *IPReservation) SetAvailable(v string) { + o.Available = &v +} + +// GetBill returns the Bill field value if set, zero value otherwise. +func (o *IPReservation) GetBill() bool { + if o == nil || IsNil(o.Bill) { + var ret bool + return ret + } + return *o.Bill +} + +// GetBillOk returns a tuple with the Bill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetBillOk() (*bool, bool) { + if o == nil || IsNil(o.Bill) { + return nil, false + } + return o.Bill, true +} + +// HasBill returns a boolean if a field has been set. +func (o *IPReservation) HasBill() bool { + if o != nil && !IsNil(o.Bill) { + return true + } + + return false +} + +// SetBill gets a reference to the given bool and assigns it to the Bill field. +func (o *IPReservation) SetBill(v bool) { + o.Bill = &v +} + +// GetCidr returns the Cidr field value if set, zero value otherwise. +func (o *IPReservation) GetCidr() int32 { + if o == nil || IsNil(o.Cidr) { + var ret int32 + return ret + } + return *o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetCidrOk() (*int32, bool) { + if o == nil || IsNil(o.Cidr) { + return nil, false + } + return o.Cidr, true +} + +// HasCidr returns a boolean if a field has been set. +func (o *IPReservation) HasCidr() bool { + if o != nil && !IsNil(o.Cidr) { + return true + } + + return false +} + +// SetCidr gets a reference to the given int32 and assigns it to the Cidr field. +func (o *IPReservation) SetCidr(v int32) { + o.Cidr = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *IPReservation) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *IPReservation) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *IPReservation) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *IPReservation) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *IPReservation) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *IPReservation) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *IPReservation) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *IPReservation) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *IPReservation) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *IPReservation) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *IPReservation) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *IPReservation) SetDetails(v string) { + o.Details = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *IPReservation) GetFacility() IPReservationFacility { + if o == nil || IsNil(o.Facility) { + var ret IPReservationFacility + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetFacilityOk() (*IPReservationFacility, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *IPReservation) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given IPReservationFacility and assigns it to the Facility field. +func (o *IPReservation) SetFacility(v IPReservationFacility) { + o.Facility = &v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise. +func (o *IPReservation) GetGateway() string { + if o == nil || IsNil(o.Gateway) { + var ret string + return ret + } + return *o.Gateway +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway, true +} + +// HasGateway returns a boolean if a field has been set. +func (o *IPReservation) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *IPReservation) SetGateway(v string) { + o.Gateway = &v +} + +// GetGlobalIp returns the GlobalIp field value if set, zero value otherwise. +func (o *IPReservation) GetGlobalIp() bool { + if o == nil || IsNil(o.GlobalIp) { + var ret bool + return ret + } + return *o.GlobalIp +} + +// GetGlobalIpOk returns a tuple with the GlobalIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetGlobalIpOk() (*bool, bool) { + if o == nil || IsNil(o.GlobalIp) { + return nil, false + } + return o.GlobalIp, true +} + +// HasGlobalIp returns a boolean if a field has been set. +func (o *IPReservation) HasGlobalIp() bool { + if o != nil && !IsNil(o.GlobalIp) { + return true + } + + return false +} + +// SetGlobalIp gets a reference to the given bool and assigns it to the GlobalIp field. +func (o *IPReservation) SetGlobalIp(v bool) { + o.GlobalIp = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *IPReservation) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *IPReservation) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *IPReservation) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IPReservation) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IPReservation) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *IPReservation) SetId(v string) { + o.Id = &v +} + +// GetManageable returns the Manageable field value if set, zero value otherwise. +func (o *IPReservation) GetManageable() bool { + if o == nil || IsNil(o.Manageable) { + var ret bool + return ret + } + return *o.Manageable +} + +// GetManageableOk returns a tuple with the Manageable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetManageableOk() (*bool, bool) { + if o == nil || IsNil(o.Manageable) { + return nil, false + } + return o.Manageable, true +} + +// HasManageable returns a boolean if a field has been set. +func (o *IPReservation) HasManageable() bool { + if o != nil && !IsNil(o.Manageable) { + return true + } + + return false +} + +// SetManageable gets a reference to the given bool and assigns it to the Manageable field. +func (o *IPReservation) SetManageable(v bool) { + o.Manageable = &v +} + +// GetManagement returns the Management field value if set, zero value otherwise. +func (o *IPReservation) GetManagement() bool { + if o == nil || IsNil(o.Management) { + var ret bool + return ret + } + return *o.Management +} + +// GetManagementOk returns a tuple with the Management field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetManagementOk() (*bool, bool) { + if o == nil || IsNil(o.Management) { + return nil, false + } + return o.Management, true +} + +// HasManagement returns a boolean if a field has been set. +func (o *IPReservation) HasManagement() bool { + if o != nil && !IsNil(o.Management) { + return true + } + + return false +} + +// SetManagement gets a reference to the given bool and assigns it to the Management field. +func (o *IPReservation) SetManagement(v bool) { + o.Management = &v +} + +// GetMetalGateway returns the MetalGateway field value if set, zero value otherwise. +func (o *IPReservation) GetMetalGateway() MetalGatewayLite { + if o == nil || IsNil(o.MetalGateway) { + var ret MetalGatewayLite + return ret + } + return *o.MetalGateway +} + +// GetMetalGatewayOk returns a tuple with the MetalGateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetMetalGatewayOk() (*MetalGatewayLite, bool) { + if o == nil || IsNil(o.MetalGateway) { + return nil, false + } + return o.MetalGateway, true +} + +// HasMetalGateway returns a boolean if a field has been set. +func (o *IPReservation) HasMetalGateway() bool { + if o != nil && !IsNil(o.MetalGateway) { + return true + } + + return false +} + +// SetMetalGateway gets a reference to the given MetalGatewayLite and assigns it to the MetalGateway field. +func (o *IPReservation) SetMetalGateway(v MetalGatewayLite) { + o.MetalGateway = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *IPReservation) GetMetro() IPReservationMetro { + if o == nil || IsNil(o.Metro) { + var ret IPReservationMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetMetroOk() (*IPReservationMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *IPReservation) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given IPReservationMetro and assigns it to the Metro field. +func (o *IPReservation) SetMetro(v IPReservationMetro) { + o.Metro = &v +} + +// GetNetmask returns the Netmask field value if set, zero value otherwise. +func (o *IPReservation) GetNetmask() string { + if o == nil || IsNil(o.Netmask) { + var ret string + return ret + } + return *o.Netmask +} + +// GetNetmaskOk returns a tuple with the Netmask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetNetmaskOk() (*string, bool) { + if o == nil || IsNil(o.Netmask) { + return nil, false + } + return o.Netmask, true +} + +// HasNetmask returns a boolean if a field has been set. +func (o *IPReservation) HasNetmask() bool { + if o != nil && !IsNil(o.Netmask) { + return true + } + + return false +} + +// SetNetmask gets a reference to the given string and assigns it to the Netmask field. +func (o *IPReservation) SetNetmask(v string) { + o.Netmask = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *IPReservation) GetNetwork() string { + if o == nil || IsNil(o.Network) { + var ret string + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetNetworkOk() (*string, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *IPReservation) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given string and assigns it to the Network field. +func (o *IPReservation) SetNetwork(v string) { + o.Network = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *IPReservation) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *IPReservation) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *IPReservation) SetProject(v Project) { + o.Project = &v +} + +// GetProjectLite returns the ProjectLite field value if set, zero value otherwise. +func (o *IPReservation) GetProjectLite() Href { + if o == nil || IsNil(o.ProjectLite) { + var ret Href + return ret + } + return *o.ProjectLite +} + +// GetProjectLiteOk returns a tuple with the ProjectLite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetProjectLiteOk() (*Href, bool) { + if o == nil || IsNil(o.ProjectLite) { + return nil, false + } + return o.ProjectLite, true +} + +// HasProjectLite returns a boolean if a field has been set. +func (o *IPReservation) HasProjectLite() bool { + if o != nil && !IsNil(o.ProjectLite) { + return true + } + + return false +} + +// SetProjectLite gets a reference to the given Href and assigns it to the ProjectLite field. +func (o *IPReservation) SetProjectLite(v Href) { + o.ProjectLite = &v +} + +// GetRequestedBy returns the RequestedBy field value if set, zero value otherwise. +func (o *IPReservation) GetRequestedBy() Href { + if o == nil || IsNil(o.RequestedBy) { + var ret Href + return ret + } + return *o.RequestedBy +} + +// GetRequestedByOk returns a tuple with the RequestedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetRequestedByOk() (*Href, bool) { + if o == nil || IsNil(o.RequestedBy) { + return nil, false + } + return o.RequestedBy, true +} + +// HasRequestedBy returns a boolean if a field has been set. +func (o *IPReservation) HasRequestedBy() bool { + if o != nil && !IsNil(o.RequestedBy) { + return true + } + + return false +} + +// SetRequestedBy gets a reference to the given Href and assigns it to the RequestedBy field. +func (o *IPReservation) SetRequestedBy(v Href) { + o.RequestedBy = &v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *IPReservation) GetPublic() bool { + if o == nil || IsNil(o.Public) { + var ret bool + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetPublicOk() (*bool, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *IPReservation) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given bool and assigns it to the Public field. +func (o *IPReservation) SetPublic(v bool) { + o.Public = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *IPReservation) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *IPReservation) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *IPReservation) SetState(v string) { + o.State = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPReservation) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservation) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPReservation) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *IPReservation) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *IPReservation) GetType() IPReservationType { + if o == nil { + var ret IPReservationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *IPReservation) GetTypeOk() (*IPReservationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *IPReservation) SetType(v IPReservationType) { + o.Type = v +} + +func (o IPReservation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPReservation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Addon) { + toSerialize["addon"] = o.Addon + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.Assignments) { + toSerialize["assignments"] = o.Assignments + } + if !IsNil(o.Available) { + toSerialize["available"] = o.Available + } + if !IsNil(o.Bill) { + toSerialize["bill"] = o.Bill + } + if !IsNil(o.Cidr) { + toSerialize["cidr"] = o.Cidr + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Gateway) { + toSerialize["gateway"] = o.Gateway + } + if !IsNil(o.GlobalIp) { + toSerialize["global_ip"] = o.GlobalIp + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Manageable) { + toSerialize["manageable"] = o.Manageable + } + if !IsNil(o.Management) { + toSerialize["management"] = o.Management + } + if !IsNil(o.MetalGateway) { + toSerialize["metal_gateway"] = o.MetalGateway + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Netmask) { + toSerialize["netmask"] = o.Netmask + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.ProjectLite) { + toSerialize["project_lite"] = o.ProjectLite + } + if !IsNil(o.RequestedBy) { + toSerialize["requested_by"] = o.RequestedBy + } + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *IPReservation) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPReservation := _IPReservation{} + + err = json.Unmarshal(bytes, &varIPReservation) + + if err != nil { + return err + } + + *o = IPReservation(varIPReservation) + + return err +} + +type NullableIPReservation struct { + value *IPReservation + isSet bool +} + +func (v NullableIPReservation) Get() *IPReservation { + return v.value +} + +func (v *NullableIPReservation) Set(val *IPReservation) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservation) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservation(val *IPReservation) *NullableIPReservation { + return &NullableIPReservation{value: val, isSet: true} +} + +func (v NullableIPReservation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_facility.go b/services/metalv1/model_ip_reservation_facility.go new file mode 100644 index 00000000..b40c6e3e --- /dev/null +++ b/services/metalv1/model_ip_reservation_facility.go @@ -0,0 +1,377 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPReservationFacility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPReservationFacility{} + +// IPReservationFacility struct for IPReservationFacility +type IPReservationFacility struct { + Address *Address `json:"address,omitempty"` + Code *string `json:"code,omitempty"` + Features []FacilityFeaturesInner `json:"features,omitempty"` + Id *string `json:"id,omitempty"` + // IP ranges registered in facility. Can be used for GeoIP location + IpRanges []string `json:"ip_ranges,omitempty"` + Metro *DeviceMetro `json:"metro,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPReservationFacility IPReservationFacility + +// NewIPReservationFacility instantiates a new IPReservationFacility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPReservationFacility() *IPReservationFacility { + this := IPReservationFacility{} + return &this +} + +// NewIPReservationFacilityWithDefaults instantiates a new IPReservationFacility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPReservationFacilityWithDefaults() *IPReservationFacility { + this := IPReservationFacility{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *IPReservationFacility) GetAddress() Address { + if o == nil || IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetAddressOk() (*Address, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *IPReservationFacility) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *IPReservationFacility) SetAddress(v Address) { + o.Address = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *IPReservationFacility) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *IPReservationFacility) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *IPReservationFacility) SetCode(v string) { + o.Code = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *IPReservationFacility) GetFeatures() []FacilityFeaturesInner { + if o == nil || IsNil(o.Features) { + var ret []FacilityFeaturesInner + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetFeaturesOk() ([]FacilityFeaturesInner, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *IPReservationFacility) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []FacilityFeaturesInner and assigns it to the Features field. +func (o *IPReservationFacility) SetFeatures(v []FacilityFeaturesInner) { + o.Features = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IPReservationFacility) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IPReservationFacility) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *IPReservationFacility) SetId(v string) { + o.Id = &v +} + +// GetIpRanges returns the IpRanges field value if set, zero value otherwise. +func (o *IPReservationFacility) GetIpRanges() []string { + if o == nil || IsNil(o.IpRanges) { + var ret []string + return ret + } + return o.IpRanges +} + +// GetIpRangesOk returns a tuple with the IpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetIpRangesOk() ([]string, bool) { + if o == nil || IsNil(o.IpRanges) { + return nil, false + } + return o.IpRanges, true +} + +// HasIpRanges returns a boolean if a field has been set. +func (o *IPReservationFacility) HasIpRanges() bool { + if o != nil && !IsNil(o.IpRanges) { + return true + } + + return false +} + +// SetIpRanges gets a reference to the given []string and assigns it to the IpRanges field. +func (o *IPReservationFacility) SetIpRanges(v []string) { + o.IpRanges = v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *IPReservationFacility) GetMetro() DeviceMetro { + if o == nil || IsNil(o.Metro) { + var ret DeviceMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetMetroOk() (*DeviceMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *IPReservationFacility) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given DeviceMetro and assigns it to the Metro field. +func (o *IPReservationFacility) SetMetro(v DeviceMetro) { + o.Metro = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *IPReservationFacility) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationFacility) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *IPReservationFacility) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *IPReservationFacility) SetName(v string) { + o.Name = &v +} + +func (o IPReservationFacility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPReservationFacility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRanges) { + toSerialize["ip_ranges"] = o.IpRanges + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPReservationFacility) UnmarshalJSON(bytes []byte) (err error) { + varIPReservationFacility := _IPReservationFacility{} + + err = json.Unmarshal(bytes, &varIPReservationFacility) + + if err != nil { + return err + } + + *o = IPReservationFacility(varIPReservationFacility) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "code") + delete(additionalProperties, "features") + delete(additionalProperties, "id") + delete(additionalProperties, "ip_ranges") + delete(additionalProperties, "metro") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPReservationFacility struct { + value *IPReservationFacility + isSet bool +} + +func (v NullableIPReservationFacility) Get() *IPReservationFacility { + return v.value +} + +func (v *NullableIPReservationFacility) Set(val *IPReservationFacility) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationFacility) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationFacility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationFacility(val *IPReservationFacility) *NullableIPReservationFacility { + return &NullableIPReservationFacility{value: val, isSet: true} +} + +func (v NullableIPReservationFacility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationFacility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_list.go b/services/metalv1/model_ip_reservation_list.go new file mode 100644 index 00000000..862c98c2 --- /dev/null +++ b/services/metalv1/model_ip_reservation_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPReservationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPReservationList{} + +// IPReservationList struct for IPReservationList +type IPReservationList struct { + IpAddresses []IPReservationListIpAddressesInner `json:"ip_addresses,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPReservationList IPReservationList + +// NewIPReservationList instantiates a new IPReservationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPReservationList() *IPReservationList { + this := IPReservationList{} + return &this +} + +// NewIPReservationListWithDefaults instantiates a new IPReservationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPReservationListWithDefaults() *IPReservationList { + this := IPReservationList{} + return &this +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *IPReservationList) GetIpAddresses() []IPReservationListIpAddressesInner { + if o == nil || IsNil(o.IpAddresses) { + var ret []IPReservationListIpAddressesInner + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationList) GetIpAddressesOk() ([]IPReservationListIpAddressesInner, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *IPReservationList) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []IPReservationListIpAddressesInner and assigns it to the IpAddresses field. +func (o *IPReservationList) SetIpAddresses(v []IPReservationListIpAddressesInner) { + o.IpAddresses = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *IPReservationList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *IPReservationList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *IPReservationList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o IPReservationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPReservationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPReservationList) UnmarshalJSON(bytes []byte) (err error) { + varIPReservationList := _IPReservationList{} + + err = json.Unmarshal(bytes, &varIPReservationList) + + if err != nil { + return err + } + + *o = IPReservationList(varIPReservationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPReservationList struct { + value *IPReservationList + isSet bool +} + +func (v NullableIPReservationList) Get() *IPReservationList { + return v.value +} + +func (v *NullableIPReservationList) Set(val *IPReservationList) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationList) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationList(val *IPReservationList) *NullableIPReservationList { + return &NullableIPReservationList{value: val, isSet: true} +} + +func (v NullableIPReservationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_list_ip_addresses_inner.go b/services/metalv1/model_ip_reservation_list_ip_addresses_inner.go new file mode 100644 index 00000000..bb6966c3 --- /dev/null +++ b/services/metalv1/model_ip_reservation_list_ip_addresses_inner.go @@ -0,0 +1,104 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// IPReservationListIpAddressesInner struct for IPReservationListIpAddressesInner +type IPReservationListIpAddressesInner struct { + IPReservation *IPReservation + VrfIpReservation *VrfIpReservation +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *IPReservationListIpAddressesInner) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into IPReservation + err = json.Unmarshal(data, &dst.IPReservation) + if err == nil { + jsonIPReservation, _ := json.Marshal(dst.IPReservation) + if string(jsonIPReservation) == "{}" { // empty struct + dst.IPReservation = nil + } else { + return nil // data stored in dst.IPReservation, return on the first match + } + } else { + dst.IPReservation = nil + } + + // try to unmarshal JSON data into VrfIpReservation + err = json.Unmarshal(data, &dst.VrfIpReservation) + if err == nil { + jsonVrfIpReservation, _ := json.Marshal(dst.VrfIpReservation) + if string(jsonVrfIpReservation) == "{}" { // empty struct + dst.VrfIpReservation = nil + } else { + return nil // data stored in dst.VrfIpReservation, return on the first match + } + } else { + dst.VrfIpReservation = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(IPReservationListIpAddressesInner)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *IPReservationListIpAddressesInner) MarshalJSON() ([]byte, error) { + if src.IPReservation != nil { + return json.Marshal(&src.IPReservation) + } + + if src.VrfIpReservation != nil { + return json.Marshal(&src.VrfIpReservation) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableIPReservationListIpAddressesInner struct { + value *IPReservationListIpAddressesInner + isSet bool +} + +func (v NullableIPReservationListIpAddressesInner) Get() *IPReservationListIpAddressesInner { + return v.value +} + +func (v *NullableIPReservationListIpAddressesInner) Set(val *IPReservationListIpAddressesInner) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationListIpAddressesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationListIpAddressesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationListIpAddressesInner(val *IPReservationListIpAddressesInner) *NullableIPReservationListIpAddressesInner { + return &NullableIPReservationListIpAddressesInner{value: val, isSet: true} +} + +func (v NullableIPReservationListIpAddressesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationListIpAddressesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_metro.go b/services/metalv1/model_ip_reservation_metro.go new file mode 100644 index 00000000..0438415f --- /dev/null +++ b/services/metalv1/model_ip_reservation_metro.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the IPReservationMetro type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPReservationMetro{} + +// IPReservationMetro struct for IPReservationMetro +type IPReservationMetro struct { + Code *string `json:"code,omitempty"` + Country *string `json:"country,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IPReservationMetro IPReservationMetro + +// NewIPReservationMetro instantiates a new IPReservationMetro object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPReservationMetro() *IPReservationMetro { + this := IPReservationMetro{} + return &this +} + +// NewIPReservationMetroWithDefaults instantiates a new IPReservationMetro object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPReservationMetroWithDefaults() *IPReservationMetro { + this := IPReservationMetro{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *IPReservationMetro) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationMetro) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *IPReservationMetro) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *IPReservationMetro) SetCode(v string) { + o.Code = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *IPReservationMetro) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationMetro) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *IPReservationMetro) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *IPReservationMetro) SetCountry(v string) { + o.Country = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *IPReservationMetro) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationMetro) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *IPReservationMetro) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *IPReservationMetro) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *IPReservationMetro) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationMetro) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *IPReservationMetro) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *IPReservationMetro) SetName(v string) { + o.Name = &v +} + +func (o IPReservationMetro) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPReservationMetro) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPReservationMetro) UnmarshalJSON(bytes []byte) (err error) { + varIPReservationMetro := _IPReservationMetro{} + + err = json.Unmarshal(bytes, &varIPReservationMetro) + + if err != nil { + return err + } + + *o = IPReservationMetro(varIPReservationMetro) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "country") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPReservationMetro struct { + value *IPReservationMetro + isSet bool +} + +func (v NullableIPReservationMetro) Get() *IPReservationMetro { + return v.value +} + +func (v *NullableIPReservationMetro) Set(val *IPReservationMetro) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationMetro) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationMetro) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationMetro(val *IPReservationMetro) *NullableIPReservationMetro { + return &NullableIPReservationMetro{value: val, isSet: true} +} + +func (v NullableIPReservationMetro) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationMetro) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_request_input.go b/services/metalv1/model_ip_reservation_request_input.go new file mode 100644 index 00000000..2359ab8a --- /dev/null +++ b/services/metalv1/model_ip_reservation_request_input.go @@ -0,0 +1,456 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the IPReservationRequestInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IPReservationRequestInput{} + +// IPReservationRequestInput struct for IPReservationRequestInput +type IPReservationRequestInput struct { + Comments *string `json:"comments,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Details *string `json:"details,omitempty"` + Facility *string `json:"facility,omitempty"` + FailOnApprovalRequired *bool `json:"fail_on_approval_required,omitempty"` + // The code of the metro you are requesting the IP reservation in. + Metro *string `json:"metro,omitempty"` + Quantity int32 `json:"quantity"` + Tags []string `json:"tags,omitempty"` + Type string `json:"type"` + AdditionalProperties map[string]interface{} +} + +type _IPReservationRequestInput IPReservationRequestInput + +// NewIPReservationRequestInput instantiates a new IPReservationRequestInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIPReservationRequestInput(quantity int32, type_ string) *IPReservationRequestInput { + this := IPReservationRequestInput{} + this.Quantity = quantity + this.Type = type_ + return &this +} + +// NewIPReservationRequestInputWithDefaults instantiates a new IPReservationRequestInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIPReservationRequestInputWithDefaults() *IPReservationRequestInput { + this := IPReservationRequestInput{} + return &this +} + +// GetComments returns the Comments field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetComments() string { + if o == nil || IsNil(o.Comments) { + var ret string + return ret + } + return *o.Comments +} + +// GetCommentsOk returns a tuple with the Comments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetCommentsOk() (*string, bool) { + if o == nil || IsNil(o.Comments) { + return nil, false + } + return o.Comments, true +} + +// HasComments returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasComments() bool { + if o != nil && !IsNil(o.Comments) { + return true + } + + return false +} + +// SetComments gets a reference to the given string and assigns it to the Comments field. +func (o *IPReservationRequestInput) SetComments(v string) { + o.Comments = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *IPReservationRequestInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *IPReservationRequestInput) SetDetails(v string) { + o.Details = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *IPReservationRequestInput) SetFacility(v string) { + o.Facility = &v +} + +// GetFailOnApprovalRequired returns the FailOnApprovalRequired field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetFailOnApprovalRequired() bool { + if o == nil || IsNil(o.FailOnApprovalRequired) { + var ret bool + return ret + } + return *o.FailOnApprovalRequired +} + +// GetFailOnApprovalRequiredOk returns a tuple with the FailOnApprovalRequired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetFailOnApprovalRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.FailOnApprovalRequired) { + return nil, false + } + return o.FailOnApprovalRequired, true +} + +// HasFailOnApprovalRequired returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasFailOnApprovalRequired() bool { + if o != nil && !IsNil(o.FailOnApprovalRequired) { + return true + } + + return false +} + +// SetFailOnApprovalRequired gets a reference to the given bool and assigns it to the FailOnApprovalRequired field. +func (o *IPReservationRequestInput) SetFailOnApprovalRequired(v bool) { + o.FailOnApprovalRequired = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *IPReservationRequestInput) SetMetro(v string) { + o.Metro = &v +} + +// GetQuantity returns the Quantity field value +func (o *IPReservationRequestInput) GetQuantity() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetQuantityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *IPReservationRequestInput) SetQuantity(v int32) { + o.Quantity = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *IPReservationRequestInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *IPReservationRequestInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *IPReservationRequestInput) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *IPReservationRequestInput) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *IPReservationRequestInput) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *IPReservationRequestInput) SetType(v string) { + o.Type = v +} + +func (o IPReservationRequestInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IPReservationRequestInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Comments) { + toSerialize["comments"] = o.Comments + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.FailOnApprovalRequired) { + toSerialize["fail_on_approval_required"] = o.FailOnApprovalRequired + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + toSerialize["quantity"] = o.Quantity + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IPReservationRequestInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quantity", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIPReservationRequestInput := _IPReservationRequestInput{} + + err = json.Unmarshal(bytes, &varIPReservationRequestInput) + + if err != nil { + return err + } + + *o = IPReservationRequestInput(varIPReservationRequestInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "comments") + delete(additionalProperties, "customdata") + delete(additionalProperties, "details") + delete(additionalProperties, "facility") + delete(additionalProperties, "fail_on_approval_required") + delete(additionalProperties, "metro") + delete(additionalProperties, "quantity") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIPReservationRequestInput struct { + value *IPReservationRequestInput + isSet bool +} + +func (v NullableIPReservationRequestInput) Get() *IPReservationRequestInput { + return v.value +} + +func (v *NullableIPReservationRequestInput) Set(val *IPReservationRequestInput) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationRequestInput) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationRequestInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationRequestInput(val *IPReservationRequestInput) *NullableIPReservationRequestInput { + return &NullableIPReservationRequestInput{value: val, isSet: true} +} + +func (v NullableIPReservationRequestInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationRequestInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ip_reservation_type.go b/services/metalv1/model_ip_reservation_type.go new file mode 100644 index 00000000..9d1a1fe6 --- /dev/null +++ b/services/metalv1/model_ip_reservation_type.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// IPReservationType the model 'IPReservationType' +type IPReservationType string + +// List of IPReservation_type +const ( + IPRESERVATIONTYPE_GLOBAL_IPV4 IPReservationType = "global_ipv4" + IPRESERVATIONTYPE_PUBLIC_IPV4 IPReservationType = "public_ipv4" + IPRESERVATIONTYPE_PRIVATE_IPV4 IPReservationType = "private_ipv4" + IPRESERVATIONTYPE_PUBLIC_IPV6 IPReservationType = "public_ipv6" +) + +// All allowed values of IPReservationType enum +var AllowedIPReservationTypeEnumValues = []IPReservationType{ + "global_ipv4", + "public_ipv4", + "private_ipv4", + "public_ipv6", +} + +func (v *IPReservationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IPReservationType(value) + for _, existing := range AllowedIPReservationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IPReservationType", value) +} + +// NewIPReservationTypeFromValue returns a pointer to a valid IPReservationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIPReservationTypeFromValue(v string) (*IPReservationType, error) { + ev := IPReservationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IPReservationType: valid values are %v", v, AllowedIPReservationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IPReservationType) IsValid() bool { + for _, existing := range AllowedIPReservationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IPReservation_type value +func (v IPReservationType) Ptr() *IPReservationType { + return &v +} + +type NullableIPReservationType struct { + value *IPReservationType + isSet bool +} + +func (v NullableIPReservationType) Get() *IPReservationType { + return v.value +} + +func (v *NullableIPReservationType) Set(val *IPReservationType) { + v.value = val + v.isSet = true +} + +func (v NullableIPReservationType) IsSet() bool { + return v.isSet +} + +func (v *NullableIPReservationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIPReservationType(val *IPReservationType) *NullableIPReservationType { + return &NullableIPReservationType{value: val, isSet: true} +} + +func (v NullableIPReservationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIPReservationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_license.go b/services/metalv1/model_license.go new file mode 100644 index 00000000..90523065 --- /dev/null +++ b/services/metalv1/model_license.go @@ -0,0 +1,339 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the License type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &License{} + +// License struct for License +type License struct { + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + LicenseKey *string `json:"license_key,omitempty"` + LicenseeProduct *Href `json:"licensee_product,omitempty"` + Project *Href `json:"project,omitempty"` + Size *float32 `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _License License + +// NewLicense instantiates a new License object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicense() *License { + this := License{} + return &this +} + +// NewLicenseWithDefaults instantiates a new License object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseWithDefaults() *License { + this := License{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *License) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *License) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *License) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *License) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *License) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *License) SetId(v string) { + o.Id = &v +} + +// GetLicenseKey returns the LicenseKey field value if set, zero value otherwise. +func (o *License) GetLicenseKey() string { + if o == nil || IsNil(o.LicenseKey) { + var ret string + return ret + } + return *o.LicenseKey +} + +// GetLicenseKeyOk returns a tuple with the LicenseKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetLicenseKeyOk() (*string, bool) { + if o == nil || IsNil(o.LicenseKey) { + return nil, false + } + return o.LicenseKey, true +} + +// HasLicenseKey returns a boolean if a field has been set. +func (o *License) HasLicenseKey() bool { + if o != nil && !IsNil(o.LicenseKey) { + return true + } + + return false +} + +// SetLicenseKey gets a reference to the given string and assigns it to the LicenseKey field. +func (o *License) SetLicenseKey(v string) { + o.LicenseKey = &v +} + +// GetLicenseeProduct returns the LicenseeProduct field value if set, zero value otherwise. +func (o *License) GetLicenseeProduct() Href { + if o == nil || IsNil(o.LicenseeProduct) { + var ret Href + return ret + } + return *o.LicenseeProduct +} + +// GetLicenseeProductOk returns a tuple with the LicenseeProduct field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetLicenseeProductOk() (*Href, bool) { + if o == nil || IsNil(o.LicenseeProduct) { + return nil, false + } + return o.LicenseeProduct, true +} + +// HasLicenseeProduct returns a boolean if a field has been set. +func (o *License) HasLicenseeProduct() bool { + if o != nil && !IsNil(o.LicenseeProduct) { + return true + } + + return false +} + +// SetLicenseeProduct gets a reference to the given Href and assigns it to the LicenseeProduct field. +func (o *License) SetLicenseeProduct(v Href) { + o.LicenseeProduct = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *License) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *License) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *License) SetProject(v Href) { + o.Project = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *License) GetSize() float32 { + if o == nil || IsNil(o.Size) { + var ret float32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *License) GetSizeOk() (*float32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *License) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float32 and assigns it to the Size field. +func (o *License) SetSize(v float32) { + o.Size = &v +} + +func (o License) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o License) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.LicenseKey) { + toSerialize["license_key"] = o.LicenseKey + } + if !IsNil(o.LicenseeProduct) { + toSerialize["licensee_product"] = o.LicenseeProduct + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *License) UnmarshalJSON(bytes []byte) (err error) { + varLicense := _License{} + + err = json.Unmarshal(bytes, &varLicense) + + if err != nil { + return err + } + + *o = License(varLicense) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "license_key") + delete(additionalProperties, "licensee_product") + delete(additionalProperties, "project") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicense struct { + value *License + isSet bool +} + +func (v NullableLicense) Get() *License { + return v.value +} + +func (v *NullableLicense) Set(val *License) { + v.value = val + v.isSet = true +} + +func (v NullableLicense) IsSet() bool { + return v.isSet +} + +func (v *NullableLicense) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicense(val *License) *NullableLicense { + return &NullableLicense{value: val, isSet: true} +} + +func (v NullableLicense) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicense) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_license_create_input.go b/services/metalv1/model_license_create_input.go new file mode 100644 index 00000000..6cf1368e --- /dev/null +++ b/services/metalv1/model_license_create_input.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the LicenseCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseCreateInput{} + +// LicenseCreateInput struct for LicenseCreateInput +type LicenseCreateInput struct { + Description *string `json:"description,omitempty"` + LicenseeProductId *string `json:"licensee_product_id,omitempty"` + Size *float32 `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LicenseCreateInput LicenseCreateInput + +// NewLicenseCreateInput instantiates a new LicenseCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseCreateInput() *LicenseCreateInput { + this := LicenseCreateInput{} + return &this +} + +// NewLicenseCreateInputWithDefaults instantiates a new LicenseCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseCreateInputWithDefaults() *LicenseCreateInput { + this := LicenseCreateInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LicenseCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LicenseCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LicenseCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetLicenseeProductId returns the LicenseeProductId field value if set, zero value otherwise. +func (o *LicenseCreateInput) GetLicenseeProductId() string { + if o == nil || IsNil(o.LicenseeProductId) { + var ret string + return ret + } + return *o.LicenseeProductId +} + +// GetLicenseeProductIdOk returns a tuple with the LicenseeProductId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseCreateInput) GetLicenseeProductIdOk() (*string, bool) { + if o == nil || IsNil(o.LicenseeProductId) { + return nil, false + } + return o.LicenseeProductId, true +} + +// HasLicenseeProductId returns a boolean if a field has been set. +func (o *LicenseCreateInput) HasLicenseeProductId() bool { + if o != nil && !IsNil(o.LicenseeProductId) { + return true + } + + return false +} + +// SetLicenseeProductId gets a reference to the given string and assigns it to the LicenseeProductId field. +func (o *LicenseCreateInput) SetLicenseeProductId(v string) { + o.LicenseeProductId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *LicenseCreateInput) GetSize() float32 { + if o == nil || IsNil(o.Size) { + var ret float32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseCreateInput) GetSizeOk() (*float32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *LicenseCreateInput) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float32 and assigns it to the Size field. +func (o *LicenseCreateInput) SetSize(v float32) { + o.Size = &v +} + +func (o LicenseCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.LicenseeProductId) { + toSerialize["licensee_product_id"] = o.LicenseeProductId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varLicenseCreateInput := _LicenseCreateInput{} + + err = json.Unmarshal(bytes, &varLicenseCreateInput) + + if err != nil { + return err + } + + *o = LicenseCreateInput(varLicenseCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "licensee_product_id") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseCreateInput struct { + value *LicenseCreateInput + isSet bool +} + +func (v NullableLicenseCreateInput) Get() *LicenseCreateInput { + return v.value +} + +func (v *NullableLicenseCreateInput) Set(val *LicenseCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseCreateInput(val *LicenseCreateInput) *NullableLicenseCreateInput { + return &NullableLicenseCreateInput{value: val, isSet: true} +} + +func (v NullableLicenseCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_license_list.go b/services/metalv1/model_license_list.go new file mode 100644 index 00000000..d3cf1acf --- /dev/null +++ b/services/metalv1/model_license_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the LicenseList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseList{} + +// LicenseList struct for LicenseList +type LicenseList struct { + Licenses []License `json:"licenses,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LicenseList LicenseList + +// NewLicenseList instantiates a new LicenseList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseList() *LicenseList { + this := LicenseList{} + return &this +} + +// NewLicenseListWithDefaults instantiates a new LicenseList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseListWithDefaults() *LicenseList { + this := LicenseList{} + return &this +} + +// GetLicenses returns the Licenses field value if set, zero value otherwise. +func (o *LicenseList) GetLicenses() []License { + if o == nil || IsNil(o.Licenses) { + var ret []License + return ret + } + return o.Licenses +} + +// GetLicensesOk returns a tuple with the Licenses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseList) GetLicensesOk() ([]License, bool) { + if o == nil || IsNil(o.Licenses) { + return nil, false + } + return o.Licenses, true +} + +// HasLicenses returns a boolean if a field has been set. +func (o *LicenseList) HasLicenses() bool { + if o != nil && !IsNil(o.Licenses) { + return true + } + + return false +} + +// SetLicenses gets a reference to the given []License and assigns it to the Licenses field. +func (o *LicenseList) SetLicenses(v []License) { + o.Licenses = v +} + +func (o LicenseList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Licenses) { + toSerialize["licenses"] = o.Licenses + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseList) UnmarshalJSON(bytes []byte) (err error) { + varLicenseList := _LicenseList{} + + err = json.Unmarshal(bytes, &varLicenseList) + + if err != nil { + return err + } + + *o = LicenseList(varLicenseList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "licenses") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseList struct { + value *LicenseList + isSet bool +} + +func (v NullableLicenseList) Get() *LicenseList { + return v.value +} + +func (v *NullableLicenseList) Set(val *LicenseList) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseList) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseList(val *LicenseList) *NullableLicenseList { + return &NullableLicenseList{value: val, isSet: true} +} + +func (v NullableLicenseList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_license_update_input.go b/services/metalv1/model_license_update_input.go new file mode 100644 index 00000000..5b478203 --- /dev/null +++ b/services/metalv1/model_license_update_input.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the LicenseUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseUpdateInput{} + +// LicenseUpdateInput struct for LicenseUpdateInput +type LicenseUpdateInput struct { + Description *string `json:"description,omitempty"` + Size *float32 `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LicenseUpdateInput LicenseUpdateInput + +// NewLicenseUpdateInput instantiates a new LicenseUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseUpdateInput() *LicenseUpdateInput { + this := LicenseUpdateInput{} + return &this +} + +// NewLicenseUpdateInputWithDefaults instantiates a new LicenseUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseUpdateInputWithDefaults() *LicenseUpdateInput { + this := LicenseUpdateInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LicenseUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LicenseUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LicenseUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *LicenseUpdateInput) GetSize() float32 { + if o == nil || IsNil(o.Size) { + var ret float32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LicenseUpdateInput) GetSizeOk() (*float32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *LicenseUpdateInput) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float32 and assigns it to the Size field. +func (o *LicenseUpdateInput) SetSize(v float32) { + o.Size = &v +} + +func (o LicenseUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varLicenseUpdateInput := _LicenseUpdateInput{} + + err = json.Unmarshal(bytes, &varLicenseUpdateInput) + + if err != nil { + return err + } + + *o = LicenseUpdateInput(varLicenseUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseUpdateInput struct { + value *LicenseUpdateInput + isSet bool +} + +func (v NullableLicenseUpdateInput) Get() *LicenseUpdateInput { + return v.value +} + +func (v *NullableLicenseUpdateInput) Set(val *LicenseUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseUpdateInput(val *LicenseUpdateInput) *NullableLicenseUpdateInput { + return &NullableLicenseUpdateInput{value: val, isSet: true} +} + +func (v NullableLicenseUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_line_item.go b/services/metalv1/model_line_item.go new file mode 100644 index 00000000..6f1757a9 --- /dev/null +++ b/services/metalv1/model_line_item.go @@ -0,0 +1,376 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the LineItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LineItem{} + +// LineItem struct for LineItem +type LineItem struct { + Amount *float32 `json:"amount,omitempty"` + Currency *string `json:"currency,omitempty"` + Description *string `json:"description,omitempty"` + Details *string `json:"details,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Unit *string `json:"unit,omitempty"` + UnitPrice *float32 `json:"unit_price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LineItem LineItem + +// NewLineItem instantiates a new LineItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLineItem() *LineItem { + this := LineItem{} + return &this +} + +// NewLineItemWithDefaults instantiates a new LineItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLineItemWithDefaults() *LineItem { + this := LineItem{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *LineItem) GetAmount() float32 { + if o == nil || IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetAmountOk() (*float32, bool) { + if o == nil || IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *LineItem) HasAmount() bool { + if o != nil && !IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *LineItem) SetAmount(v float32) { + o.Amount = &v +} + +// GetCurrency returns the Currency field value if set, zero value otherwise. +func (o *LineItem) GetCurrency() string { + if o == nil || IsNil(o.Currency) { + var ret string + return ret + } + return *o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetCurrencyOk() (*string, bool) { + if o == nil || IsNil(o.Currency) { + return nil, false + } + return o.Currency, true +} + +// HasCurrency returns a boolean if a field has been set. +func (o *LineItem) HasCurrency() bool { + if o != nil && !IsNil(o.Currency) { + return true + } + + return false +} + +// SetCurrency gets a reference to the given string and assigns it to the Currency field. +func (o *LineItem) SetCurrency(v string) { + o.Currency = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *LineItem) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *LineItem) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *LineItem) SetDescription(v string) { + o.Description = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *LineItem) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *LineItem) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *LineItem) SetDetails(v string) { + o.Details = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *LineItem) GetPlan() Plan { + if o == nil || IsNil(o.Plan) { + var ret Plan + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetPlanOk() (*Plan, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *LineItem) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given Plan and assigns it to the Plan field. +func (o *LineItem) SetPlan(v Plan) { + o.Plan = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *LineItem) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *LineItem) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *LineItem) SetUnit(v string) { + o.Unit = &v +} + +// GetUnitPrice returns the UnitPrice field value if set, zero value otherwise. +func (o *LineItem) GetUnitPrice() float32 { + if o == nil || IsNil(o.UnitPrice) { + var ret float32 + return ret + } + return *o.UnitPrice +} + +// GetUnitPriceOk returns a tuple with the UnitPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LineItem) GetUnitPriceOk() (*float32, bool) { + if o == nil || IsNil(o.UnitPrice) { + return nil, false + } + return o.UnitPrice, true +} + +// HasUnitPrice returns a boolean if a field has been set. +func (o *LineItem) HasUnitPrice() bool { + if o != nil && !IsNil(o.UnitPrice) { + return true + } + + return false +} + +// SetUnitPrice gets a reference to the given float32 and assigns it to the UnitPrice field. +func (o *LineItem) SetUnitPrice(v float32) { + o.UnitPrice = &v +} + +func (o LineItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LineItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !IsNil(o.Currency) { + toSerialize["currency"] = o.Currency + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + if !IsNil(o.UnitPrice) { + toSerialize["unit_price"] = o.UnitPrice + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LineItem) UnmarshalJSON(bytes []byte) (err error) { + varLineItem := _LineItem{} + + err = json.Unmarshal(bytes, &varLineItem) + + if err != nil { + return err + } + + *o = LineItem(varLineItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "currency") + delete(additionalProperties, "description") + delete(additionalProperties, "details") + delete(additionalProperties, "plan") + delete(additionalProperties, "unit") + delete(additionalProperties, "unit_price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLineItem struct { + value *LineItem + isSet bool +} + +func (v NullableLineItem) Get() *LineItem { + return v.value +} + +func (v *NullableLineItem) Set(val *LineItem) { + v.value = val + v.isSet = true +} + +func (v NullableLineItem) IsSet() bool { + return v.isSet +} + +func (v *NullableLineItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLineItem(val *LineItem) *NullableLineItem { + return &NullableLineItem{value: val, isSet: true} +} + +func (v NullableLineItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLineItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_membership.go b/services/metalv1/model_membership.go new file mode 100644 index 00000000..4469edda --- /dev/null +++ b/services/metalv1/model_membership.go @@ -0,0 +1,377 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Membership type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Membership{} + +// Membership struct for Membership +type Membership struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Project *Href `json:"project,omitempty"` + Roles []string `json:"roles,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + User *Href `json:"user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Membership Membership + +// NewMembership instantiates a new Membership object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMembership() *Membership { + this := Membership{} + return &this +} + +// NewMembershipWithDefaults instantiates a new Membership object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMembershipWithDefaults() *Membership { + this := Membership{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Membership) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Membership) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Membership) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Membership) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Membership) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Membership) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Membership) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Membership) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Membership) SetId(v string) { + o.Id = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *Membership) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *Membership) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *Membership) SetProject(v Href) { + o.Project = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *Membership) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *Membership) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *Membership) SetRoles(v []string) { + o.Roles = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Membership) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Membership) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Membership) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *Membership) GetUser() Href { + if o == nil || IsNil(o.User) { + var ret Href + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Membership) GetUserOk() (*Href, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *Membership) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given Href and assigns it to the User field. +func (o *Membership) SetUser(v Href) { + o.User = &v +} + +func (o Membership) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Membership) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Membership) UnmarshalJSON(bytes []byte) (err error) { + varMembership := _Membership{} + + err = json.Unmarshal(bytes, &varMembership) + + if err != nil { + return err + } + + *o = Membership(varMembership) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "project") + delete(additionalProperties, "roles") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMembership struct { + value *Membership + isSet bool +} + +func (v NullableMembership) Get() *Membership { + return v.value +} + +func (v *NullableMembership) Set(val *Membership) { + v.value = val + v.isSet = true +} + +func (v NullableMembership) IsSet() bool { + return v.isSet +} + +func (v *NullableMembership) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMembership(val *Membership) *NullableMembership { + return &NullableMembership{value: val, isSet: true} +} + +func (v NullableMembership) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMembership) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_membership_input.go b/services/metalv1/model_membership_input.go new file mode 100644 index 00000000..a1c3ab16 --- /dev/null +++ b/services/metalv1/model_membership_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MembershipInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MembershipInput{} + +// MembershipInput struct for MembershipInput +type MembershipInput struct { + Role []string `json:"role,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MembershipInput MembershipInput + +// NewMembershipInput instantiates a new MembershipInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMembershipInput() *MembershipInput { + this := MembershipInput{} + return &this +} + +// NewMembershipInputWithDefaults instantiates a new MembershipInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMembershipInputWithDefaults() *MembershipInput { + this := MembershipInput{} + return &this +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *MembershipInput) GetRole() []string { + if o == nil || IsNil(o.Role) { + var ret []string + return ret + } + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MembershipInput) GetRoleOk() ([]string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *MembershipInput) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given []string and assigns it to the Role field. +func (o *MembershipInput) SetRole(v []string) { + o.Role = v +} + +func (o MembershipInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MembershipInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MembershipInput) UnmarshalJSON(bytes []byte) (err error) { + varMembershipInput := _MembershipInput{} + + err = json.Unmarshal(bytes, &varMembershipInput) + + if err != nil { + return err + } + + *o = MembershipInput(varMembershipInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "role") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMembershipInput struct { + value *MembershipInput + isSet bool +} + +func (v NullableMembershipInput) Get() *MembershipInput { + return v.value +} + +func (v *NullableMembershipInput) Set(val *MembershipInput) { + v.value = val + v.isSet = true +} + +func (v NullableMembershipInput) IsSet() bool { + return v.isSet +} + +func (v *NullableMembershipInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMembershipInput(val *MembershipInput) *NullableMembershipInput { + return &NullableMembershipInput{value: val, isSet: true} +} + +func (v NullableMembershipInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMembershipInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_membership_list.go b/services/metalv1/model_membership_list.go new file mode 100644 index 00000000..e8eb2370 --- /dev/null +++ b/services/metalv1/model_membership_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MembershipList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MembershipList{} + +// MembershipList struct for MembershipList +type MembershipList struct { + Memberships []Membership `json:"memberships,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MembershipList MembershipList + +// NewMembershipList instantiates a new MembershipList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMembershipList() *MembershipList { + this := MembershipList{} + return &this +} + +// NewMembershipListWithDefaults instantiates a new MembershipList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMembershipListWithDefaults() *MembershipList { + this := MembershipList{} + return &this +} + +// GetMemberships returns the Memberships field value if set, zero value otherwise. +func (o *MembershipList) GetMemberships() []Membership { + if o == nil || IsNil(o.Memberships) { + var ret []Membership + return ret + } + return o.Memberships +} + +// GetMembershipsOk returns a tuple with the Memberships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MembershipList) GetMembershipsOk() ([]Membership, bool) { + if o == nil || IsNil(o.Memberships) { + return nil, false + } + return o.Memberships, true +} + +// HasMemberships returns a boolean if a field has been set. +func (o *MembershipList) HasMemberships() bool { + if o != nil && !IsNil(o.Memberships) { + return true + } + + return false +} + +// SetMemberships gets a reference to the given []Membership and assigns it to the Memberships field. +func (o *MembershipList) SetMemberships(v []Membership) { + o.Memberships = v +} + +func (o MembershipList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MembershipList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Memberships) { + toSerialize["memberships"] = o.Memberships + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MembershipList) UnmarshalJSON(bytes []byte) (err error) { + varMembershipList := _MembershipList{} + + err = json.Unmarshal(bytes, &varMembershipList) + + if err != nil { + return err + } + + *o = MembershipList(varMembershipList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "memberships") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMembershipList struct { + value *MembershipList + isSet bool +} + +func (v NullableMembershipList) Get() *MembershipList { + return v.value +} + +func (v *NullableMembershipList) Set(val *MembershipList) { + v.value = val + v.isSet = true +} + +func (v NullableMembershipList) IsSet() bool { + return v.isSet +} + +func (v *NullableMembershipList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMembershipList(val *MembershipList) *NullableMembershipList { + return &NullableMembershipList{value: val, isSet: true} +} + +func (v NullableMembershipList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMembershipList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_meta.go b/services/metalv1/model_meta.go new file mode 100644 index 00000000..b96affa8 --- /dev/null +++ b/services/metalv1/model_meta.go @@ -0,0 +1,413 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Meta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Meta{} + +// Meta struct for Meta +type Meta struct { + First *Href `json:"first,omitempty"` + Last *Href `json:"last,omitempty"` + Next *Href `json:"next,omitempty"` + Previous *Href `json:"previous,omitempty"` + Self *Href `json:"self,omitempty"` + Total *int32 `json:"total,omitempty"` + CurrentPage *int32 `json:"current_page,omitempty"` + LastPage *int32 `json:"last_page,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Meta Meta + +// NewMeta instantiates a new Meta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMeta() *Meta { + this := Meta{} + return &this +} + +// NewMetaWithDefaults instantiates a new Meta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetaWithDefaults() *Meta { + this := Meta{} + return &this +} + +// GetFirst returns the First field value if set, zero value otherwise. +func (o *Meta) GetFirst() Href { + if o == nil || IsNil(o.First) { + var ret Href + return ret + } + return *o.First +} + +// GetFirstOk returns a tuple with the First field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetFirstOk() (*Href, bool) { + if o == nil || IsNil(o.First) { + return nil, false + } + return o.First, true +} + +// HasFirst returns a boolean if a field has been set. +func (o *Meta) HasFirst() bool { + if o != nil && !IsNil(o.First) { + return true + } + + return false +} + +// SetFirst gets a reference to the given Href and assigns it to the First field. +func (o *Meta) SetFirst(v Href) { + o.First = &v +} + +// GetLast returns the Last field value if set, zero value otherwise. +func (o *Meta) GetLast() Href { + if o == nil || IsNil(o.Last) { + var ret Href + return ret + } + return *o.Last +} + +// GetLastOk returns a tuple with the Last field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetLastOk() (*Href, bool) { + if o == nil || IsNil(o.Last) { + return nil, false + } + return o.Last, true +} + +// HasLast returns a boolean if a field has been set. +func (o *Meta) HasLast() bool { + if o != nil && !IsNil(o.Last) { + return true + } + + return false +} + +// SetLast gets a reference to the given Href and assigns it to the Last field. +func (o *Meta) SetLast(v Href) { + o.Last = &v +} + +// GetNext returns the Next field value if set, zero value otherwise. +func (o *Meta) GetNext() Href { + if o == nil || IsNil(o.Next) { + var ret Href + return ret + } + return *o.Next +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetNextOk() (*Href, bool) { + if o == nil || IsNil(o.Next) { + return nil, false + } + return o.Next, true +} + +// HasNext returns a boolean if a field has been set. +func (o *Meta) HasNext() bool { + if o != nil && !IsNil(o.Next) { + return true + } + + return false +} + +// SetNext gets a reference to the given Href and assigns it to the Next field. +func (o *Meta) SetNext(v Href) { + o.Next = &v +} + +// GetPrevious returns the Previous field value if set, zero value otherwise. +func (o *Meta) GetPrevious() Href { + if o == nil || IsNil(o.Previous) { + var ret Href + return ret + } + return *o.Previous +} + +// GetPreviousOk returns a tuple with the Previous field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetPreviousOk() (*Href, bool) { + if o == nil || IsNil(o.Previous) { + return nil, false + } + return o.Previous, true +} + +// HasPrevious returns a boolean if a field has been set. +func (o *Meta) HasPrevious() bool { + if o != nil && !IsNil(o.Previous) { + return true + } + + return false +} + +// SetPrevious gets a reference to the given Href and assigns it to the Previous field. +func (o *Meta) SetPrevious(v Href) { + o.Previous = &v +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *Meta) GetSelf() Href { + if o == nil || IsNil(o.Self) { + var ret Href + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetSelfOk() (*Href, bool) { + if o == nil || IsNil(o.Self) { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *Meta) HasSelf() bool { + if o != nil && !IsNil(o.Self) { + return true + } + + return false +} + +// SetSelf gets a reference to the given Href and assigns it to the Self field. +func (o *Meta) SetSelf(v Href) { + o.Self = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *Meta) GetTotal() int32 { + if o == nil || IsNil(o.Total) { + var ret int32 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetTotalOk() (*int32, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *Meta) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int32 and assigns it to the Total field. +func (o *Meta) SetTotal(v int32) { + o.Total = &v +} + +// GetCurrentPage returns the CurrentPage field value if set, zero value otherwise. +func (o *Meta) GetCurrentPage() int32 { + if o == nil || IsNil(o.CurrentPage) { + var ret int32 + return ret + } + return *o.CurrentPage +} + +// GetCurrentPageOk returns a tuple with the CurrentPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetCurrentPageOk() (*int32, bool) { + if o == nil || IsNil(o.CurrentPage) { + return nil, false + } + return o.CurrentPage, true +} + +// HasCurrentPage returns a boolean if a field has been set. +func (o *Meta) HasCurrentPage() bool { + if o != nil && !IsNil(o.CurrentPage) { + return true + } + + return false +} + +// SetCurrentPage gets a reference to the given int32 and assigns it to the CurrentPage field. +func (o *Meta) SetCurrentPage(v int32) { + o.CurrentPage = &v +} + +// GetLastPage returns the LastPage field value if set, zero value otherwise. +func (o *Meta) GetLastPage() int32 { + if o == nil || IsNil(o.LastPage) { + var ret int32 + return ret + } + return *o.LastPage +} + +// GetLastPageOk returns a tuple with the LastPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Meta) GetLastPageOk() (*int32, bool) { + if o == nil || IsNil(o.LastPage) { + return nil, false + } + return o.LastPage, true +} + +// HasLastPage returns a boolean if a field has been set. +func (o *Meta) HasLastPage() bool { + if o != nil && !IsNil(o.LastPage) { + return true + } + + return false +} + +// SetLastPage gets a reference to the given int32 and assigns it to the LastPage field. +func (o *Meta) SetLastPage(v int32) { + o.LastPage = &v +} + +func (o Meta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Meta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.First) { + toSerialize["first"] = o.First + } + if !IsNil(o.Last) { + toSerialize["last"] = o.Last + } + if !IsNil(o.Next) { + toSerialize["next"] = o.Next + } + if !IsNil(o.Previous) { + toSerialize["previous"] = o.Previous + } + if !IsNil(o.Self) { + toSerialize["self"] = o.Self + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.CurrentPage) { + toSerialize["current_page"] = o.CurrentPage + } + if !IsNil(o.LastPage) { + toSerialize["last_page"] = o.LastPage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Meta) UnmarshalJSON(bytes []byte) (err error) { + varMeta := _Meta{} + + err = json.Unmarshal(bytes, &varMeta) + + if err != nil { + return err + } + + *o = Meta(varMeta) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "first") + delete(additionalProperties, "last") + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "self") + delete(additionalProperties, "total") + delete(additionalProperties, "current_page") + delete(additionalProperties, "last_page") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMeta struct { + value *Meta + isSet bool +} + +func (v NullableMeta) Get() *Meta { + return v.value +} + +func (v *NullableMeta) Set(val *Meta) { + v.value = val + v.isSet = true +} + +func (v NullableMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMeta(val *Meta) *NullableMeta { + return &NullableMeta{value: val, isSet: true} +} + +func (v NullableMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metadata.go b/services/metalv1/model_metadata.go new file mode 100644 index 00000000..9bdd6747 --- /dev/null +++ b/services/metalv1/model_metadata.go @@ -0,0 +1,788 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Metadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metadata{} + +// Metadata struct for Metadata +type Metadata struct { + Class *string `json:"class,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + // The facility code of the instance + Facility *string `json:"facility,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Id *string `json:"id,omitempty"` + Iqn *string `json:"iqn,omitempty"` + // The metro code of the instance + Metro *string `json:"metro,omitempty"` + Network *MetadataNetwork `json:"network,omitempty"` + OperatingSystem map[string]interface{} `json:"operating_system,omitempty"` + // The plan slug of the instance + Plan *string `json:"plan,omitempty"` + // An array of the private subnets + PrivateSubnets []string `json:"private_subnets,omitempty"` + Reserved *bool `json:"reserved,omitempty"` + // The specs of the plan version of the instance + Specs map[string]interface{} `json:"specs,omitempty"` + SshKeys []string `json:"ssh_keys,omitempty"` + SwitchShortId *string `json:"switch_short_id,omitempty"` + State *DeviceState `json:"state,omitempty"` + Tags []string `json:"tags,omitempty"` + Volumes []string `json:"volumes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Metadata Metadata + +// NewMetadata instantiates a new Metadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadata() *Metadata { + this := Metadata{} + return &this +} + +// NewMetadataWithDefaults instantiates a new Metadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataWithDefaults() *Metadata { + this := Metadata{} + return &this +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Metadata) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Metadata) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Metadata) SetClass(v string) { + o.Class = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *Metadata) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *Metadata) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *Metadata) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *Metadata) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *Metadata) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *Metadata) SetFacility(v string) { + o.Facility = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *Metadata) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *Metadata) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *Metadata) SetHostname(v string) { + o.Hostname = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Metadata) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Metadata) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Metadata) SetId(v string) { + o.Id = &v +} + +// GetIqn returns the Iqn field value if set, zero value otherwise. +func (o *Metadata) GetIqn() string { + if o == nil || IsNil(o.Iqn) { + var ret string + return ret + } + return *o.Iqn +} + +// GetIqnOk returns a tuple with the Iqn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetIqnOk() (*string, bool) { + if o == nil || IsNil(o.Iqn) { + return nil, false + } + return o.Iqn, true +} + +// HasIqn returns a boolean if a field has been set. +func (o *Metadata) HasIqn() bool { + if o != nil && !IsNil(o.Iqn) { + return true + } + + return false +} + +// SetIqn gets a reference to the given string and assigns it to the Iqn field. +func (o *Metadata) SetIqn(v string) { + o.Iqn = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *Metadata) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *Metadata) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *Metadata) SetMetro(v string) { + o.Metro = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *Metadata) GetNetwork() MetadataNetwork { + if o == nil || IsNil(o.Network) { + var ret MetadataNetwork + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetNetworkOk() (*MetadataNetwork, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *Metadata) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given MetadataNetwork and assigns it to the Network field. +func (o *Metadata) SetNetwork(v MetadataNetwork) { + o.Network = &v +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *Metadata) GetOperatingSystem() map[string]interface{} { + if o == nil || IsNil(o.OperatingSystem) { + var ret map[string]interface{} + return ret + } + return o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetOperatingSystemOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return map[string]interface{}{}, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *Metadata) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given map[string]interface{} and assigns it to the OperatingSystem field. +func (o *Metadata) SetOperatingSystem(v map[string]interface{}) { + o.OperatingSystem = v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *Metadata) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *Metadata) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *Metadata) SetPlan(v string) { + o.Plan = &v +} + +// GetPrivateSubnets returns the PrivateSubnets field value if set, zero value otherwise. +func (o *Metadata) GetPrivateSubnets() []string { + if o == nil || IsNil(o.PrivateSubnets) { + var ret []string + return ret + } + return o.PrivateSubnets +} + +// GetPrivateSubnetsOk returns a tuple with the PrivateSubnets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetPrivateSubnetsOk() ([]string, bool) { + if o == nil || IsNil(o.PrivateSubnets) { + return nil, false + } + return o.PrivateSubnets, true +} + +// HasPrivateSubnets returns a boolean if a field has been set. +func (o *Metadata) HasPrivateSubnets() bool { + if o != nil && !IsNil(o.PrivateSubnets) { + return true + } + + return false +} + +// SetPrivateSubnets gets a reference to the given []string and assigns it to the PrivateSubnets field. +func (o *Metadata) SetPrivateSubnets(v []string) { + o.PrivateSubnets = v +} + +// GetReserved returns the Reserved field value if set, zero value otherwise. +func (o *Metadata) GetReserved() bool { + if o == nil || IsNil(o.Reserved) { + var ret bool + return ret + } + return *o.Reserved +} + +// GetReservedOk returns a tuple with the Reserved field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetReservedOk() (*bool, bool) { + if o == nil || IsNil(o.Reserved) { + return nil, false + } + return o.Reserved, true +} + +// HasReserved returns a boolean if a field has been set. +func (o *Metadata) HasReserved() bool { + if o != nil && !IsNil(o.Reserved) { + return true + } + + return false +} + +// SetReserved gets a reference to the given bool and assigns it to the Reserved field. +func (o *Metadata) SetReserved(v bool) { + o.Reserved = &v +} + +// GetSpecs returns the Specs field value if set, zero value otherwise. +func (o *Metadata) GetSpecs() map[string]interface{} { + if o == nil || IsNil(o.Specs) { + var ret map[string]interface{} + return ret + } + return o.Specs +} + +// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetSpecsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Specs) { + return map[string]interface{}{}, false + } + return o.Specs, true +} + +// HasSpecs returns a boolean if a field has been set. +func (o *Metadata) HasSpecs() bool { + if o != nil && !IsNil(o.Specs) { + return true + } + + return false +} + +// SetSpecs gets a reference to the given map[string]interface{} and assigns it to the Specs field. +func (o *Metadata) SetSpecs(v map[string]interface{}) { + o.Specs = v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *Metadata) GetSshKeys() []string { + if o == nil || IsNil(o.SshKeys) { + var ret []string + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *Metadata) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []string and assigns it to the SshKeys field. +func (o *Metadata) SetSshKeys(v []string) { + o.SshKeys = v +} + +// GetSwitchShortId returns the SwitchShortId field value if set, zero value otherwise. +func (o *Metadata) GetSwitchShortId() string { + if o == nil || IsNil(o.SwitchShortId) { + var ret string + return ret + } + return *o.SwitchShortId +} + +// GetSwitchShortIdOk returns a tuple with the SwitchShortId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetSwitchShortIdOk() (*string, bool) { + if o == nil || IsNil(o.SwitchShortId) { + return nil, false + } + return o.SwitchShortId, true +} + +// HasSwitchShortId returns a boolean if a field has been set. +func (o *Metadata) HasSwitchShortId() bool { + if o != nil && !IsNil(o.SwitchShortId) { + return true + } + + return false +} + +// SetSwitchShortId gets a reference to the given string and assigns it to the SwitchShortId field. +func (o *Metadata) SetSwitchShortId(v string) { + o.SwitchShortId = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Metadata) GetState() DeviceState { + if o == nil || IsNil(o.State) { + var ret DeviceState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetStateOk() (*DeviceState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Metadata) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given DeviceState and assigns it to the State field. +func (o *Metadata) SetState(v DeviceState) { + o.State = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Metadata) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Metadata) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Metadata) SetTags(v []string) { + o.Tags = v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Metadata) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metadata) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Metadata) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *Metadata) SetVolumes(v []string) { + o.Volumes = v +} + +func (o Metadata) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Metadata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Iqn) { + toSerialize["iqn"] = o.Iqn + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.OperatingSystem) { + toSerialize["operating_system"] = o.OperatingSystem + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.PrivateSubnets) { + toSerialize["private_subnets"] = o.PrivateSubnets + } + if !IsNil(o.Reserved) { + toSerialize["reserved"] = o.Reserved + } + if !IsNil(o.Specs) { + toSerialize["specs"] = o.Specs + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.SwitchShortId) { + toSerialize["switch_short_id"] = o.SwitchShortId + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Metadata) UnmarshalJSON(bytes []byte) (err error) { + varMetadata := _Metadata{} + + err = json.Unmarshal(bytes, &varMetadata) + + if err != nil { + return err + } + + *o = Metadata(varMetadata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "class") + delete(additionalProperties, "customdata") + delete(additionalProperties, "facility") + delete(additionalProperties, "hostname") + delete(additionalProperties, "id") + delete(additionalProperties, "iqn") + delete(additionalProperties, "metro") + delete(additionalProperties, "network") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_subnets") + delete(additionalProperties, "reserved") + delete(additionalProperties, "specs") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "switch_short_id") + delete(additionalProperties, "state") + delete(additionalProperties, "tags") + delete(additionalProperties, "volumes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetadata struct { + value *Metadata + isSet bool +} + +func (v NullableMetadata) Get() *Metadata { + return v.value +} + +func (v *NullableMetadata) Set(val *Metadata) { + v.value = val + v.isSet = true +} + +func (v NullableMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadata(val *Metadata) *NullableMetadata { + return &NullableMetadata{value: val, isSet: true} +} + +func (v NullableMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metadata_network.go b/services/metalv1/model_metadata_network.go new file mode 100644 index 00000000..f5185611 --- /dev/null +++ b/services/metalv1/model_metadata_network.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MetadataNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataNetwork{} + +// MetadataNetwork struct for MetadataNetwork +type MetadataNetwork struct { + Addresses []string `json:"addresses,omitempty"` + Interfaces []map[string]interface{} `json:"interfaces,omitempty"` + Network *MetadataNetworkNetwork `json:"network,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetadataNetwork MetadataNetwork + +// NewMetadataNetwork instantiates a new MetadataNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadataNetwork() *MetadataNetwork { + this := MetadataNetwork{} + return &this +} + +// NewMetadataNetworkWithDefaults instantiates a new MetadataNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataNetworkWithDefaults() *MetadataNetwork { + this := MetadataNetwork{} + return &this +} + +// GetAddresses returns the Addresses field value if set, zero value otherwise. +func (o *MetadataNetwork) GetAddresses() []string { + if o == nil || IsNil(o.Addresses) { + var ret []string + return ret + } + return o.Addresses +} + +// GetAddressesOk returns a tuple with the Addresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetwork) GetAddressesOk() ([]string, bool) { + if o == nil || IsNil(o.Addresses) { + return nil, false + } + return o.Addresses, true +} + +// HasAddresses returns a boolean if a field has been set. +func (o *MetadataNetwork) HasAddresses() bool { + if o != nil && !IsNil(o.Addresses) { + return true + } + + return false +} + +// SetAddresses gets a reference to the given []string and assigns it to the Addresses field. +func (o *MetadataNetwork) SetAddresses(v []string) { + o.Addresses = v +} + +// GetInterfaces returns the Interfaces field value if set, zero value otherwise. +func (o *MetadataNetwork) GetInterfaces() []map[string]interface{} { + if o == nil || IsNil(o.Interfaces) { + var ret []map[string]interface{} + return ret + } + return o.Interfaces +} + +// GetInterfacesOk returns a tuple with the Interfaces field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetwork) GetInterfacesOk() ([]map[string]interface{}, bool) { + if o == nil || IsNil(o.Interfaces) { + return nil, false + } + return o.Interfaces, true +} + +// HasInterfaces returns a boolean if a field has been set. +func (o *MetadataNetwork) HasInterfaces() bool { + if o != nil && !IsNil(o.Interfaces) { + return true + } + + return false +} + +// SetInterfaces gets a reference to the given []map[string]interface{} and assigns it to the Interfaces field. +func (o *MetadataNetwork) SetInterfaces(v []map[string]interface{}) { + o.Interfaces = v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *MetadataNetwork) GetNetwork() MetadataNetworkNetwork { + if o == nil || IsNil(o.Network) { + var ret MetadataNetworkNetwork + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetwork) GetNetworkOk() (*MetadataNetworkNetwork, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *MetadataNetwork) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given MetadataNetworkNetwork and assigns it to the Network field. +func (o *MetadataNetwork) SetNetwork(v MetadataNetworkNetwork) { + o.Network = &v +} + +func (o MetadataNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetadataNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Addresses) { + toSerialize["addresses"] = o.Addresses + } + if !IsNil(o.Interfaces) { + toSerialize["interfaces"] = o.Interfaces + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetadataNetwork) UnmarshalJSON(bytes []byte) (err error) { + varMetadataNetwork := _MetadataNetwork{} + + err = json.Unmarshal(bytes, &varMetadataNetwork) + + if err != nil { + return err + } + + *o = MetadataNetwork(varMetadataNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "addresses") + delete(additionalProperties, "interfaces") + delete(additionalProperties, "network") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetadataNetwork struct { + value *MetadataNetwork + isSet bool +} + +func (v NullableMetadataNetwork) Get() *MetadataNetwork { + return v.value +} + +func (v *NullableMetadataNetwork) Set(val *MetadataNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableMetadataNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadataNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadataNetwork(val *MetadataNetwork) *NullableMetadataNetwork { + return &NullableMetadataNetwork{value: val, isSet: true} +} + +func (v NullableMetadataNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadataNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metadata_network_network.go b/services/metalv1/model_metadata_network_network.go new file mode 100644 index 00000000..380b2f29 --- /dev/null +++ b/services/metalv1/model_metadata_network_network.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MetadataNetworkNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataNetworkNetwork{} + +// MetadataNetworkNetwork struct for MetadataNetworkNetwork +type MetadataNetworkNetwork struct { + Bonding *MetadataNetworkNetworkBonding `json:"bonding,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetadataNetworkNetwork MetadataNetworkNetwork + +// NewMetadataNetworkNetwork instantiates a new MetadataNetworkNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadataNetworkNetwork() *MetadataNetworkNetwork { + this := MetadataNetworkNetwork{} + return &this +} + +// NewMetadataNetworkNetworkWithDefaults instantiates a new MetadataNetworkNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataNetworkNetworkWithDefaults() *MetadataNetworkNetwork { + this := MetadataNetworkNetwork{} + return &this +} + +// GetBonding returns the Bonding field value if set, zero value otherwise. +func (o *MetadataNetworkNetwork) GetBonding() MetadataNetworkNetworkBonding { + if o == nil || IsNil(o.Bonding) { + var ret MetadataNetworkNetworkBonding + return ret + } + return *o.Bonding +} + +// GetBondingOk returns a tuple with the Bonding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetworkNetwork) GetBondingOk() (*MetadataNetworkNetworkBonding, bool) { + if o == nil || IsNil(o.Bonding) { + return nil, false + } + return o.Bonding, true +} + +// HasBonding returns a boolean if a field has been set. +func (o *MetadataNetworkNetwork) HasBonding() bool { + if o != nil && !IsNil(o.Bonding) { + return true + } + + return false +} + +// SetBonding gets a reference to the given MetadataNetworkNetworkBonding and assigns it to the Bonding field. +func (o *MetadataNetworkNetwork) SetBonding(v MetadataNetworkNetworkBonding) { + o.Bonding = &v +} + +func (o MetadataNetworkNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetadataNetworkNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bonding) { + toSerialize["bonding"] = o.Bonding + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetadataNetworkNetwork) UnmarshalJSON(bytes []byte) (err error) { + varMetadataNetworkNetwork := _MetadataNetworkNetwork{} + + err = json.Unmarshal(bytes, &varMetadataNetworkNetwork) + + if err != nil { + return err + } + + *o = MetadataNetworkNetwork(varMetadataNetworkNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bonding") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetadataNetworkNetwork struct { + value *MetadataNetworkNetwork + isSet bool +} + +func (v NullableMetadataNetworkNetwork) Get() *MetadataNetworkNetwork { + return v.value +} + +func (v *NullableMetadataNetworkNetwork) Set(val *MetadataNetworkNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableMetadataNetworkNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadataNetworkNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadataNetworkNetwork(val *MetadataNetworkNetwork) *NullableMetadataNetworkNetwork { + return &NullableMetadataNetworkNetwork{value: val, isSet: true} +} + +func (v NullableMetadataNetworkNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadataNetworkNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metadata_network_network_bonding.go b/services/metalv1/model_metadata_network_network_bonding.go new file mode 100644 index 00000000..e934b4b6 --- /dev/null +++ b/services/metalv1/model_metadata_network_network_bonding.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MetadataNetworkNetworkBonding type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadataNetworkNetworkBonding{} + +// MetadataNetworkNetworkBonding struct for MetadataNetworkNetworkBonding +type MetadataNetworkNetworkBonding struct { + LinkAggregation *string `json:"link_aggregation,omitempty"` + Mac *string `json:"mac,omitempty"` + Mode *int32 `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetadataNetworkNetworkBonding MetadataNetworkNetworkBonding + +// NewMetadataNetworkNetworkBonding instantiates a new MetadataNetworkNetworkBonding object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadataNetworkNetworkBonding() *MetadataNetworkNetworkBonding { + this := MetadataNetworkNetworkBonding{} + return &this +} + +// NewMetadataNetworkNetworkBondingWithDefaults instantiates a new MetadataNetworkNetworkBonding object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataNetworkNetworkBondingWithDefaults() *MetadataNetworkNetworkBonding { + this := MetadataNetworkNetworkBonding{} + return &this +} + +// GetLinkAggregation returns the LinkAggregation field value if set, zero value otherwise. +func (o *MetadataNetworkNetworkBonding) GetLinkAggregation() string { + if o == nil || IsNil(o.LinkAggregation) { + var ret string + return ret + } + return *o.LinkAggregation +} + +// GetLinkAggregationOk returns a tuple with the LinkAggregation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetworkNetworkBonding) GetLinkAggregationOk() (*string, bool) { + if o == nil || IsNil(o.LinkAggregation) { + return nil, false + } + return o.LinkAggregation, true +} + +// HasLinkAggregation returns a boolean if a field has been set. +func (o *MetadataNetworkNetworkBonding) HasLinkAggregation() bool { + if o != nil && !IsNil(o.LinkAggregation) { + return true + } + + return false +} + +// SetLinkAggregation gets a reference to the given string and assigns it to the LinkAggregation field. +func (o *MetadataNetworkNetworkBonding) SetLinkAggregation(v string) { + o.LinkAggregation = &v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *MetadataNetworkNetworkBonding) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetworkNetworkBonding) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *MetadataNetworkNetworkBonding) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *MetadataNetworkNetworkBonding) SetMac(v string) { + o.Mac = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *MetadataNetworkNetworkBonding) GetMode() int32 { + if o == nil || IsNil(o.Mode) { + var ret int32 + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetadataNetworkNetworkBonding) GetModeOk() (*int32, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *MetadataNetworkNetworkBonding) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given int32 and assigns it to the Mode field. +func (o *MetadataNetworkNetworkBonding) SetMode(v int32) { + o.Mode = &v +} + +func (o MetadataNetworkNetworkBonding) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetadataNetworkNetworkBonding) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LinkAggregation) { + toSerialize["link_aggregation"] = o.LinkAggregation + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetadataNetworkNetworkBonding) UnmarshalJSON(bytes []byte) (err error) { + varMetadataNetworkNetworkBonding := _MetadataNetworkNetworkBonding{} + + err = json.Unmarshal(bytes, &varMetadataNetworkNetworkBonding) + + if err != nil { + return err + } + + *o = MetadataNetworkNetworkBonding(varMetadataNetworkNetworkBonding) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "link_aggregation") + delete(additionalProperties, "mac") + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetadataNetworkNetworkBonding struct { + value *MetadataNetworkNetworkBonding + isSet bool +} + +func (v NullableMetadataNetworkNetworkBonding) Get() *MetadataNetworkNetworkBonding { + return v.value +} + +func (v *NullableMetadataNetworkNetworkBonding) Set(val *MetadataNetworkNetworkBonding) { + v.value = val + v.isSet = true +} + +func (v NullableMetadataNetworkNetworkBonding) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadataNetworkNetworkBonding) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadataNetworkNetworkBonding(val *MetadataNetworkNetworkBonding) *NullableMetadataNetworkNetworkBonding { + return &NullableMetadataNetworkNetworkBonding{value: val, isSet: true} +} + +func (v NullableMetadataNetworkNetworkBonding) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadataNetworkNetworkBonding) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway.go b/services/metalv1/model_metal_gateway.go new file mode 100644 index 00000000..b56d1823 --- /dev/null +++ b/services/metalv1/model_metal_gateway.go @@ -0,0 +1,451 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the MetalGateway type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetalGateway{} + +// MetalGateway struct for MetalGateway +type MetalGateway struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedBy *Href `json:"created_by,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + IpReservation *IPReservation `json:"ip_reservation,omitempty"` + Project *Project `json:"project,omitempty"` + State *MetalGatewayState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetalGateway MetalGateway + +// NewMetalGateway instantiates a new MetalGateway object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetalGateway() *MetalGateway { + this := MetalGateway{} + return &this +} + +// NewMetalGatewayWithDefaults instantiates a new MetalGateway object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetalGatewayWithDefaults() *MetalGateway { + this := MetalGateway{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *MetalGateway) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *MetalGateway) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *MetalGateway) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *MetalGateway) GetCreatedBy() Href { + if o == nil || IsNil(o.CreatedBy) { + var ret Href + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetCreatedByOk() (*Href, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *MetalGateway) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given Href and assigns it to the CreatedBy field. +func (o *MetalGateway) SetCreatedBy(v Href) { + o.CreatedBy = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *MetalGateway) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *MetalGateway) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *MetalGateway) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MetalGateway) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MetalGateway) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MetalGateway) SetId(v string) { + o.Id = &v +} + +// GetIpReservation returns the IpReservation field value if set, zero value otherwise. +func (o *MetalGateway) GetIpReservation() IPReservation { + if o == nil || IsNil(o.IpReservation) { + var ret IPReservation + return ret + } + return *o.IpReservation +} + +// GetIpReservationOk returns a tuple with the IpReservation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetIpReservationOk() (*IPReservation, bool) { + if o == nil || IsNil(o.IpReservation) { + return nil, false + } + return o.IpReservation, true +} + +// HasIpReservation returns a boolean if a field has been set. +func (o *MetalGateway) HasIpReservation() bool { + if o != nil && !IsNil(o.IpReservation) { + return true + } + + return false +} + +// SetIpReservation gets a reference to the given IPReservation and assigns it to the IpReservation field. +func (o *MetalGateway) SetIpReservation(v IPReservation) { + o.IpReservation = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *MetalGateway) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *MetalGateway) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *MetalGateway) SetProject(v Project) { + o.Project = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *MetalGateway) GetState() MetalGatewayState { + if o == nil || IsNil(o.State) { + var ret MetalGatewayState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetStateOk() (*MetalGatewayState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *MetalGateway) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given MetalGatewayState and assigns it to the State field. +func (o *MetalGateway) SetState(v MetalGatewayState) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *MetalGateway) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *MetalGateway) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *MetalGateway) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVirtualNetwork returns the VirtualNetwork field value if set, zero value otherwise. +func (o *MetalGateway) GetVirtualNetwork() VirtualNetwork { + if o == nil || IsNil(o.VirtualNetwork) { + var ret VirtualNetwork + return ret + } + return *o.VirtualNetwork +} + +// GetVirtualNetworkOk returns a tuple with the VirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGateway) GetVirtualNetworkOk() (*VirtualNetwork, bool) { + if o == nil || IsNil(o.VirtualNetwork) { + return nil, false + } + return o.VirtualNetwork, true +} + +// HasVirtualNetwork returns a boolean if a field has been set. +func (o *MetalGateway) HasVirtualNetwork() bool { + if o != nil && !IsNil(o.VirtualNetwork) { + return true + } + + return false +} + +// SetVirtualNetwork gets a reference to the given VirtualNetwork and assigns it to the VirtualNetwork field. +func (o *MetalGateway) SetVirtualNetwork(v VirtualNetwork) { + o.VirtualNetwork = &v +} + +func (o MetalGateway) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetalGateway) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpReservation) { + toSerialize["ip_reservation"] = o.IpReservation + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.VirtualNetwork) { + toSerialize["virtual_network"] = o.VirtualNetwork + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetalGateway) UnmarshalJSON(bytes []byte) (err error) { + varMetalGateway := _MetalGateway{} + + err = json.Unmarshal(bytes, &varMetalGateway) + + if err != nil { + return err + } + + *o = MetalGateway(varMetalGateway) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "ip_reservation") + delete(additionalProperties, "project") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "virtual_network") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetalGateway struct { + value *MetalGateway + isSet bool +} + +func (v NullableMetalGateway) Get() *MetalGateway { + return v.value +} + +func (v *NullableMetalGateway) Set(val *MetalGateway) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGateway) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGateway) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGateway(val *MetalGateway) *NullableMetalGateway { + return &NullableMetalGateway{value: val, isSet: true} +} + +func (v NullableMetalGateway) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGateway) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_create_input.go b/services/metalv1/model_metal_gateway_create_input.go new file mode 100644 index 00000000..05c548e0 --- /dev/null +++ b/services/metalv1/model_metal_gateway_create_input.go @@ -0,0 +1,244 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the MetalGatewayCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetalGatewayCreateInput{} + +// MetalGatewayCreateInput struct for MetalGatewayCreateInput +type MetalGatewayCreateInput struct { + // The UUID of an IP reservation that belongs to the same project as where the metal gateway will be created in. This field is required unless the private IPv4 subnet size is specified. + IpReservationId *string `json:"ip_reservation_id,omitempty"` + // The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + // The UUID of a metro virtual network that belongs to the same project as where the metal gateway will be created in. + VirtualNetworkId string `json:"virtual_network_id"` + AdditionalProperties map[string]interface{} +} + +type _MetalGatewayCreateInput MetalGatewayCreateInput + +// NewMetalGatewayCreateInput instantiates a new MetalGatewayCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetalGatewayCreateInput(virtualNetworkId string) *MetalGatewayCreateInput { + this := MetalGatewayCreateInput{} + this.VirtualNetworkId = virtualNetworkId + return &this +} + +// NewMetalGatewayCreateInputWithDefaults instantiates a new MetalGatewayCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetalGatewayCreateInputWithDefaults() *MetalGatewayCreateInput { + this := MetalGatewayCreateInput{} + return &this +} + +// GetIpReservationId returns the IpReservationId field value if set, zero value otherwise. +func (o *MetalGatewayCreateInput) GetIpReservationId() string { + if o == nil || IsNil(o.IpReservationId) { + var ret string + return ret + } + return *o.IpReservationId +} + +// GetIpReservationIdOk returns a tuple with the IpReservationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayCreateInput) GetIpReservationIdOk() (*string, bool) { + if o == nil || IsNil(o.IpReservationId) { + return nil, false + } + return o.IpReservationId, true +} + +// HasIpReservationId returns a boolean if a field has been set. +func (o *MetalGatewayCreateInput) HasIpReservationId() bool { + if o != nil && !IsNil(o.IpReservationId) { + return true + } + + return false +} + +// SetIpReservationId gets a reference to the given string and assigns it to the IpReservationId field. +func (o *MetalGatewayCreateInput) SetIpReservationId(v string) { + o.IpReservationId = &v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *MetalGatewayCreateInput) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayCreateInput) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *MetalGatewayCreateInput) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *MetalGatewayCreateInput) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetVirtualNetworkId returns the VirtualNetworkId field value +func (o *MetalGatewayCreateInput) GetVirtualNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.VirtualNetworkId +} + +// GetVirtualNetworkIdOk returns a tuple with the VirtualNetworkId field value +// and a boolean to check if the value has been set. +func (o *MetalGatewayCreateInput) GetVirtualNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VirtualNetworkId, true +} + +// SetVirtualNetworkId sets field value +func (o *MetalGatewayCreateInput) SetVirtualNetworkId(v string) { + o.VirtualNetworkId = v +} + +func (o MetalGatewayCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetalGatewayCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IpReservationId) { + toSerialize["ip_reservation_id"] = o.IpReservationId + } + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + toSerialize["virtual_network_id"] = o.VirtualNetworkId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetalGatewayCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "virtual_network_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMetalGatewayCreateInput := _MetalGatewayCreateInput{} + + err = json.Unmarshal(bytes, &varMetalGatewayCreateInput) + + if err != nil { + return err + } + + *o = MetalGatewayCreateInput(varMetalGatewayCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ip_reservation_id") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "virtual_network_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetalGatewayCreateInput struct { + value *MetalGatewayCreateInput + isSet bool +} + +func (v NullableMetalGatewayCreateInput) Get() *MetalGatewayCreateInput { + return v.value +} + +func (v *NullableMetalGatewayCreateInput) Set(val *MetalGatewayCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayCreateInput(val *MetalGatewayCreateInput) *NullableMetalGatewayCreateInput { + return &NullableMetalGatewayCreateInput{value: val, isSet: true} +} + +func (v NullableMetalGatewayCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_elastic_ip_create_input.go b/services/metalv1/model_metal_gateway_elastic_ip_create_input.go new file mode 100644 index 00000000..e931c9eb --- /dev/null +++ b/services/metalv1/model_metal_gateway_elastic_ip_create_input.go @@ -0,0 +1,274 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the MetalGatewayElasticIpCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetalGatewayElasticIpCreateInput{} + +// MetalGatewayElasticIpCreateInput struct for MetalGatewayElasticIpCreateInput +type MetalGatewayElasticIpCreateInput struct { + // An IP address (or IP Address range) contained within one of the project's IP Reservations + Address string `json:"address"` + // An IP address contained within the Metal Gateways' IP Reservation range. + NextHop string `json:"next_hop"` + // Optional User-defined JSON object value. + Customdata map[string]interface{} `json:"customdata,omitempty"` + // Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetalGatewayElasticIpCreateInput MetalGatewayElasticIpCreateInput + +// NewMetalGatewayElasticIpCreateInput instantiates a new MetalGatewayElasticIpCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetalGatewayElasticIpCreateInput(address string, nextHop string) *MetalGatewayElasticIpCreateInput { + this := MetalGatewayElasticIpCreateInput{} + this.Address = address + this.NextHop = nextHop + return &this +} + +// NewMetalGatewayElasticIpCreateInputWithDefaults instantiates a new MetalGatewayElasticIpCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetalGatewayElasticIpCreateInputWithDefaults() *MetalGatewayElasticIpCreateInput { + this := MetalGatewayElasticIpCreateInput{} + return &this +} + +// GetAddress returns the Address field value +func (o *MetalGatewayElasticIpCreateInput) GetAddress() string { + if o == nil { + var ret string + return ret + } + + return o.Address +} + +// GetAddressOk returns a tuple with the Address field value +// and a boolean to check if the value has been set. +func (o *MetalGatewayElasticIpCreateInput) GetAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Address, true +} + +// SetAddress sets field value +func (o *MetalGatewayElasticIpCreateInput) SetAddress(v string) { + o.Address = v +} + +// GetNextHop returns the NextHop field value +func (o *MetalGatewayElasticIpCreateInput) GetNextHop() string { + if o == nil { + var ret string + return ret + } + + return o.NextHop +} + +// GetNextHopOk returns a tuple with the NextHop field value +// and a boolean to check if the value has been set. +func (o *MetalGatewayElasticIpCreateInput) GetNextHopOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NextHop, true +} + +// SetNextHop sets field value +func (o *MetalGatewayElasticIpCreateInput) SetNextHop(v string) { + o.NextHop = v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *MetalGatewayElasticIpCreateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayElasticIpCreateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *MetalGatewayElasticIpCreateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *MetalGatewayElasticIpCreateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *MetalGatewayElasticIpCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayElasticIpCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *MetalGatewayElasticIpCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *MetalGatewayElasticIpCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o MetalGatewayElasticIpCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetalGatewayElasticIpCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["address"] = o.Address + toSerialize["next_hop"] = o.NextHop + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetalGatewayElasticIpCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "address", + "next_hop", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMetalGatewayElasticIpCreateInput := _MetalGatewayElasticIpCreateInput{} + + err = json.Unmarshal(bytes, &varMetalGatewayElasticIpCreateInput) + + if err != nil { + return err + } + + *o = MetalGatewayElasticIpCreateInput(varMetalGatewayElasticIpCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "next_hop") + delete(additionalProperties, "customdata") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetalGatewayElasticIpCreateInput struct { + value *MetalGatewayElasticIpCreateInput + isSet bool +} + +func (v NullableMetalGatewayElasticIpCreateInput) Get() *MetalGatewayElasticIpCreateInput { + return v.value +} + +func (v *NullableMetalGatewayElasticIpCreateInput) Set(val *MetalGatewayElasticIpCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayElasticIpCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayElasticIpCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayElasticIpCreateInput(val *MetalGatewayElasticIpCreateInput) *NullableMetalGatewayElasticIpCreateInput { + return &NullableMetalGatewayElasticIpCreateInput{value: val, isSet: true} +} + +func (v NullableMetalGatewayElasticIpCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayElasticIpCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_list.go b/services/metalv1/model_metal_gateway_list.go new file mode 100644 index 00000000..27518f40 --- /dev/null +++ b/services/metalv1/model_metal_gateway_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MetalGatewayList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetalGatewayList{} + +// MetalGatewayList struct for MetalGatewayList +type MetalGatewayList struct { + MetalGateways []MetalGatewayListMetalGatewaysInner `json:"metal_gateways,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetalGatewayList MetalGatewayList + +// NewMetalGatewayList instantiates a new MetalGatewayList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetalGatewayList() *MetalGatewayList { + this := MetalGatewayList{} + return &this +} + +// NewMetalGatewayListWithDefaults instantiates a new MetalGatewayList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetalGatewayListWithDefaults() *MetalGatewayList { + this := MetalGatewayList{} + return &this +} + +// GetMetalGateways returns the MetalGateways field value if set, zero value otherwise. +func (o *MetalGatewayList) GetMetalGateways() []MetalGatewayListMetalGatewaysInner { + if o == nil || IsNil(o.MetalGateways) { + var ret []MetalGatewayListMetalGatewaysInner + return ret + } + return o.MetalGateways +} + +// GetMetalGatewaysOk returns a tuple with the MetalGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayList) GetMetalGatewaysOk() ([]MetalGatewayListMetalGatewaysInner, bool) { + if o == nil || IsNil(o.MetalGateways) { + return nil, false + } + return o.MetalGateways, true +} + +// HasMetalGateways returns a boolean if a field has been set. +func (o *MetalGatewayList) HasMetalGateways() bool { + if o != nil && !IsNil(o.MetalGateways) { + return true + } + + return false +} + +// SetMetalGateways gets a reference to the given []MetalGatewayListMetalGatewaysInner and assigns it to the MetalGateways field. +func (o *MetalGatewayList) SetMetalGateways(v []MetalGatewayListMetalGatewaysInner) { + o.MetalGateways = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *MetalGatewayList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *MetalGatewayList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *MetalGatewayList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o MetalGatewayList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetalGatewayList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MetalGateways) { + toSerialize["metal_gateways"] = o.MetalGateways + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetalGatewayList) UnmarshalJSON(bytes []byte) (err error) { + varMetalGatewayList := _MetalGatewayList{} + + err = json.Unmarshal(bytes, &varMetalGatewayList) + + if err != nil { + return err + } + + *o = MetalGatewayList(varMetalGatewayList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "metal_gateways") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetalGatewayList struct { + value *MetalGatewayList + isSet bool +} + +func (v NullableMetalGatewayList) Get() *MetalGatewayList { + return v.value +} + +func (v *NullableMetalGatewayList) Set(val *MetalGatewayList) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayList) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayList(val *MetalGatewayList) *NullableMetalGatewayList { + return &NullableMetalGatewayList{value: val, isSet: true} +} + +func (v NullableMetalGatewayList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_list_metal_gateways_inner.go b/services/metalv1/model_metal_gateway_list_metal_gateways_inner.go new file mode 100644 index 00000000..71b0f173 --- /dev/null +++ b/services/metalv1/model_metal_gateway_list_metal_gateways_inner.go @@ -0,0 +1,104 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// MetalGatewayListMetalGatewaysInner struct for MetalGatewayListMetalGatewaysInner +type MetalGatewayListMetalGatewaysInner struct { + MetalGateway *MetalGateway + VrfMetalGateway *VrfMetalGateway +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *MetalGatewayListMetalGatewaysInner) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into MetalGateway + err = json.Unmarshal(data, &dst.MetalGateway) + if err == nil { + jsonMetalGateway, _ := json.Marshal(dst.MetalGateway) + if string(jsonMetalGateway) == "{}" { // empty struct + dst.MetalGateway = nil + } else { + return nil // data stored in dst.MetalGateway, return on the first match + } + } else { + dst.MetalGateway = nil + } + + // try to unmarshal JSON data into VrfMetalGateway + err = json.Unmarshal(data, &dst.VrfMetalGateway) + if err == nil { + jsonVrfMetalGateway, _ := json.Marshal(dst.VrfMetalGateway) + if string(jsonVrfMetalGateway) == "{}" { // empty struct + dst.VrfMetalGateway = nil + } else { + return nil // data stored in dst.VrfMetalGateway, return on the first match + } + } else { + dst.VrfMetalGateway = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(MetalGatewayListMetalGatewaysInner)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src *MetalGatewayListMetalGatewaysInner) MarshalJSON() ([]byte, error) { + if src.MetalGateway != nil { + return json.Marshal(&src.MetalGateway) + } + + if src.VrfMetalGateway != nil { + return json.Marshal(&src.VrfMetalGateway) + } + + return nil, nil // no data in anyOf schemas +} + +type NullableMetalGatewayListMetalGatewaysInner struct { + value *MetalGatewayListMetalGatewaysInner + isSet bool +} + +func (v NullableMetalGatewayListMetalGatewaysInner) Get() *MetalGatewayListMetalGatewaysInner { + return v.value +} + +func (v *NullableMetalGatewayListMetalGatewaysInner) Set(val *MetalGatewayListMetalGatewaysInner) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayListMetalGatewaysInner) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayListMetalGatewaysInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayListMetalGatewaysInner(val *MetalGatewayListMetalGatewaysInner) *NullableMetalGatewayListMetalGatewaysInner { + return &NullableMetalGatewayListMetalGatewaysInner{value: val, isSet: true} +} + +func (v NullableMetalGatewayListMetalGatewaysInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayListMetalGatewaysInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_lite.go b/services/metalv1/model_metal_gateway_lite.go new file mode 100644 index 00000000..3a7fe261 --- /dev/null +++ b/services/metalv1/model_metal_gateway_lite.go @@ -0,0 +1,379 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the MetalGatewayLite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetalGatewayLite{} + +// MetalGatewayLite struct for MetalGatewayLite +type MetalGatewayLite struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + // The gateway address with subnet CIDR value for this Metal Gateway. For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 would have a gateway address of 10.1.2.1/27. + GatewayAddress *string `json:"gateway_address,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + State *MetalGatewayState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + // The VLAN id of the Virtual Network record associated to this Metal Gateway. + Vlan *int32 `json:"vlan,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetalGatewayLite MetalGatewayLite + +// NewMetalGatewayLite instantiates a new MetalGatewayLite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetalGatewayLite() *MetalGatewayLite { + this := MetalGatewayLite{} + return &this +} + +// NewMetalGatewayLiteWithDefaults instantiates a new MetalGatewayLite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetalGatewayLiteWithDefaults() *MetalGatewayLite { + this := MetalGatewayLite{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *MetalGatewayLite) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetGatewayAddress returns the GatewayAddress field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetGatewayAddress() string { + if o == nil || IsNil(o.GatewayAddress) { + var ret string + return ret + } + return *o.GatewayAddress +} + +// GetGatewayAddressOk returns a tuple with the GatewayAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetGatewayAddressOk() (*string, bool) { + if o == nil || IsNil(o.GatewayAddress) { + return nil, false + } + return o.GatewayAddress, true +} + +// HasGatewayAddress returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasGatewayAddress() bool { + if o != nil && !IsNil(o.GatewayAddress) { + return true + } + + return false +} + +// SetGatewayAddress gets a reference to the given string and assigns it to the GatewayAddress field. +func (o *MetalGatewayLite) SetGatewayAddress(v string) { + o.GatewayAddress = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *MetalGatewayLite) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MetalGatewayLite) SetId(v string) { + o.Id = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetState() MetalGatewayState { + if o == nil || IsNil(o.State) { + var ret MetalGatewayState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetStateOk() (*MetalGatewayState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given MetalGatewayState and assigns it to the State field. +func (o *MetalGatewayLite) SetState(v MetalGatewayState) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *MetalGatewayLite) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise. +func (o *MetalGatewayLite) GetVlan() int32 { + if o == nil || IsNil(o.Vlan) { + var ret int32 + return ret + } + return *o.Vlan +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetalGatewayLite) GetVlanOk() (*int32, bool) { + if o == nil || IsNil(o.Vlan) { + return nil, false + } + return o.Vlan, true +} + +// HasVlan returns a boolean if a field has been set. +func (o *MetalGatewayLite) HasVlan() bool { + if o != nil && !IsNil(o.Vlan) { + return true + } + + return false +} + +// SetVlan gets a reference to the given int32 and assigns it to the Vlan field. +func (o *MetalGatewayLite) SetVlan(v int32) { + o.Vlan = &v +} + +func (o MetalGatewayLite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetalGatewayLite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.GatewayAddress) { + toSerialize["gateway_address"] = o.GatewayAddress + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Vlan) { + toSerialize["vlan"] = o.Vlan + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetalGatewayLite) UnmarshalJSON(bytes []byte) (err error) { + varMetalGatewayLite := _MetalGatewayLite{} + + err = json.Unmarshal(bytes, &varMetalGatewayLite) + + if err != nil { + return err + } + + *o = MetalGatewayLite(varMetalGatewayLite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "gateway_address") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "vlan") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetalGatewayLite struct { + value *MetalGatewayLite + isSet bool +} + +func (v NullableMetalGatewayLite) Get() *MetalGatewayLite { + return v.value +} + +func (v *NullableMetalGatewayLite) Set(val *MetalGatewayLite) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayLite) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayLite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayLite(val *MetalGatewayLite) *NullableMetalGatewayLite { + return &NullableMetalGatewayLite{value: val, isSet: true} +} + +func (v NullableMetalGatewayLite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayLite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metal_gateway_state.go b/services/metalv1/model_metal_gateway_state.go new file mode 100644 index 00000000..dba9dc6d --- /dev/null +++ b/services/metalv1/model_metal_gateway_state.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// MetalGatewayState The current state of the Metal Gateway. 'Ready' indicates the gateway record has been configured, but is currently not active on the network. 'Active' indicates the gateway has been configured on the network. 'Deleting' is a temporary state used to indicate that the gateway is in the process of being un-configured from the network, after which the gateway record will be deleted. +type MetalGatewayState string + +// List of MetalGateway_state +const ( + METALGATEWAYSTATE_READY MetalGatewayState = "ready" + METALGATEWAYSTATE_ACTIVE MetalGatewayState = "active" + METALGATEWAYSTATE_DELETING MetalGatewayState = "deleting" +) + +// All allowed values of MetalGatewayState enum +var AllowedMetalGatewayStateEnumValues = []MetalGatewayState{ + "ready", + "active", + "deleting", +} + +func (v *MetalGatewayState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MetalGatewayState(value) + for _, existing := range AllowedMetalGatewayStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid MetalGatewayState", value) +} + +// NewMetalGatewayStateFromValue returns a pointer to a valid MetalGatewayState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMetalGatewayStateFromValue(v string) (*MetalGatewayState, error) { + ev := MetalGatewayState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MetalGatewayState: valid values are %v", v, AllowedMetalGatewayStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MetalGatewayState) IsValid() bool { + for _, existing := range AllowedMetalGatewayStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MetalGateway_state value +func (v MetalGatewayState) Ptr() *MetalGatewayState { + return &v +} + +type NullableMetalGatewayState struct { + value *MetalGatewayState + isSet bool +} + +func (v NullableMetalGatewayState) Get() *MetalGatewayState { + return v.value +} + +func (v *NullableMetalGatewayState) Set(val *MetalGatewayState) { + v.value = val + v.isSet = true +} + +func (v NullableMetalGatewayState) IsSet() bool { + return v.isSet +} + +func (v *NullableMetalGatewayState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetalGatewayState(val *MetalGatewayState) *NullableMetalGatewayState { + return &NullableMetalGatewayState{value: val, isSet: true} +} + +func (v NullableMetalGatewayState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetalGatewayState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metro.go b/services/metalv1/model_metro.go new file mode 100644 index 00000000..0d909cbc --- /dev/null +++ b/services/metalv1/model_metro.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Metro type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metro{} + +// Metro struct for Metro +type Metro struct { + Code *string `json:"code,omitempty"` + Country *string `json:"country,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Metro Metro + +// NewMetro instantiates a new Metro object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetro() *Metro { + this := Metro{} + return &this +} + +// NewMetroWithDefaults instantiates a new Metro object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetroWithDefaults() *Metro { + this := Metro{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *Metro) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metro) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *Metro) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *Metro) SetCode(v string) { + o.Code = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *Metro) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metro) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *Metro) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *Metro) SetCountry(v string) { + o.Country = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Metro) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metro) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Metro) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Metro) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Metro) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Metro) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Metro) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Metro) SetName(v string) { + o.Name = &v +} + +func (o Metro) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Metro) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Metro) UnmarshalJSON(bytes []byte) (err error) { + varMetro := _Metro{} + + err = json.Unmarshal(bytes, &varMetro) + + if err != nil { + return err + } + + *o = Metro(varMetro) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "country") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetro struct { + value *Metro + isSet bool +} + +func (v NullableMetro) Get() *Metro { + return v.value +} + +func (v *NullableMetro) Set(val *Metro) { + v.value = val + v.isSet = true +} + +func (v NullableMetro) IsSet() bool { + return v.isSet +} + +func (v *NullableMetro) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetro(val *Metro) *NullableMetro { + return &NullableMetro{value: val, isSet: true} +} + +func (v NullableMetro) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetro) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metro_input.go b/services/metalv1/model_metro_input.go new file mode 100644 index 00000000..973f221a --- /dev/null +++ b/services/metalv1/model_metro_input.go @@ -0,0 +1,168 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the MetroInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetroInput{} + +// MetroInput struct for MetroInput +type MetroInput struct { + // Metro code or ID of where the instance should be provisioned in. Either metro or facility must be provided. + Metro string `json:"metro"` + AdditionalProperties map[string]interface{} +} + +type _MetroInput MetroInput + +// NewMetroInput instantiates a new MetroInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetroInput(metro string) *MetroInput { + this := MetroInput{} + this.Metro = metro + return &this +} + +// NewMetroInputWithDefaults instantiates a new MetroInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetroInputWithDefaults() *MetroInput { + this := MetroInput{} + return &this +} + +// GetMetro returns the Metro field value +func (o *MetroInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *MetroInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *MetroInput) SetMetro(v string) { + o.Metro = v +} + +func (o MetroInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetroInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["metro"] = o.Metro + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetroInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMetroInput := _MetroInput{} + + err = json.Unmarshal(bytes, &varMetroInput) + + if err != nil { + return err + } + + *o = MetroInput(varMetroInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "metro") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetroInput struct { + value *MetroInput + isSet bool +} + +func (v NullableMetroInput) Get() *MetroInput { + return v.value +} + +func (v *NullableMetroInput) Set(val *MetroInput) { + v.value = val + v.isSet = true +} + +func (v NullableMetroInput) IsSet() bool { + return v.isSet +} + +func (v *NullableMetroInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetroInput(val *MetroInput) *NullableMetroInput { + return &NullableMetroInput{value: val, isSet: true} +} + +func (v NullableMetroInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetroInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_metro_list.go b/services/metalv1/model_metro_list.go new file mode 100644 index 00000000..b59d9fb6 --- /dev/null +++ b/services/metalv1/model_metro_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MetroList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetroList{} + +// MetroList struct for MetroList +type MetroList struct { + Metros []Metro `json:"metros,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MetroList MetroList + +// NewMetroList instantiates a new MetroList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetroList() *MetroList { + this := MetroList{} + return &this +} + +// NewMetroListWithDefaults instantiates a new MetroList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetroListWithDefaults() *MetroList { + this := MetroList{} + return &this +} + +// GetMetros returns the Metros field value if set, zero value otherwise. +func (o *MetroList) GetMetros() []Metro { + if o == nil || IsNil(o.Metros) { + var ret []Metro + return ret + } + return o.Metros +} + +// GetMetrosOk returns a tuple with the Metros field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MetroList) GetMetrosOk() ([]Metro, bool) { + if o == nil || IsNil(o.Metros) { + return nil, false + } + return o.Metros, true +} + +// HasMetros returns a boolean if a field has been set. +func (o *MetroList) HasMetros() bool { + if o != nil && !IsNil(o.Metros) { + return true + } + + return false +} + +// SetMetros gets a reference to the given []Metro and assigns it to the Metros field. +func (o *MetroList) SetMetros(v []Metro) { + o.Metros = v +} + +func (o MetroList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MetroList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Metros) { + toSerialize["metros"] = o.Metros + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MetroList) UnmarshalJSON(bytes []byte) (err error) { + varMetroList := _MetroList{} + + err = json.Unmarshal(bytes, &varMetroList) + + if err != nil { + return err + } + + *o = MetroList(varMetroList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "metros") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetroList struct { + value *MetroList + isSet bool +} + +func (v NullableMetroList) Get() *MetroList { + return v.value +} + +func (v *NullableMetroList) Set(val *MetroList) { + v.value = val + v.isSet = true +} + +func (v NullableMetroList) IsSet() bool { + return v.isSet +} + +func (v *NullableMetroList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetroList(val *MetroList) *NullableMetroList { + return &NullableMetroList{value: val, isSet: true} +} + +func (v NullableMetroList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetroList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_mount.go b/services/metalv1/model_mount.go new file mode 100644 index 00000000..91b8a76c --- /dev/null +++ b/services/metalv1/model_mount.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Mount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Mount{} + +// Mount struct for Mount +type Mount struct { + Device *string `json:"device,omitempty"` + Format *string `json:"format,omitempty"` + Point *string `json:"point,omitempty"` + Options []string `json:"options,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Mount Mount + +// NewMount instantiates a new Mount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMount() *Mount { + this := Mount{} + return &this +} + +// NewMountWithDefaults instantiates a new Mount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMountWithDefaults() *Mount { + this := Mount{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *Mount) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mount) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *Mount) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *Mount) SetDevice(v string) { + o.Device = &v +} + +// GetFormat returns the Format field value if set, zero value otherwise. +func (o *Mount) GetFormat() string { + if o == nil || IsNil(o.Format) { + var ret string + return ret + } + return *o.Format +} + +// GetFormatOk returns a tuple with the Format field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mount) GetFormatOk() (*string, bool) { + if o == nil || IsNil(o.Format) { + return nil, false + } + return o.Format, true +} + +// HasFormat returns a boolean if a field has been set. +func (o *Mount) HasFormat() bool { + if o != nil && !IsNil(o.Format) { + return true + } + + return false +} + +// SetFormat gets a reference to the given string and assigns it to the Format field. +func (o *Mount) SetFormat(v string) { + o.Format = &v +} + +// GetPoint returns the Point field value if set, zero value otherwise. +func (o *Mount) GetPoint() string { + if o == nil || IsNil(o.Point) { + var ret string + return ret + } + return *o.Point +} + +// GetPointOk returns a tuple with the Point field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mount) GetPointOk() (*string, bool) { + if o == nil || IsNil(o.Point) { + return nil, false + } + return o.Point, true +} + +// HasPoint returns a boolean if a field has been set. +func (o *Mount) HasPoint() bool { + if o != nil && !IsNil(o.Point) { + return true + } + + return false +} + +// SetPoint gets a reference to the given string and assigns it to the Point field. +func (o *Mount) SetPoint(v string) { + o.Point = &v +} + +// GetOptions returns the Options field value if set, zero value otherwise. +func (o *Mount) GetOptions() []string { + if o == nil || IsNil(o.Options) { + var ret []string + return ret + } + return o.Options +} + +// GetOptionsOk returns a tuple with the Options field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Mount) GetOptionsOk() ([]string, bool) { + if o == nil || IsNil(o.Options) { + return nil, false + } + return o.Options, true +} + +// HasOptions returns a boolean if a field has been set. +func (o *Mount) HasOptions() bool { + if o != nil && !IsNil(o.Options) { + return true + } + + return false +} + +// SetOptions gets a reference to the given []string and assigns it to the Options field. +func (o *Mount) SetOptions(v []string) { + o.Options = v +} + +func (o Mount) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Mount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Format) { + toSerialize["format"] = o.Format + } + if !IsNil(o.Point) { + toSerialize["point"] = o.Point + } + if !IsNil(o.Options) { + toSerialize["options"] = o.Options + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Mount) UnmarshalJSON(bytes []byte) (err error) { + varMount := _Mount{} + + err = json.Unmarshal(bytes, &varMount) + + if err != nil { + return err + } + + *o = Mount(varMount) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "format") + delete(additionalProperties, "point") + delete(additionalProperties, "options") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMount struct { + value *Mount + isSet bool +} + +func (v NullableMount) Get() *Mount { + return v.value +} + +func (v *NullableMount) Set(val *Mount) { + v.value = val + v.isSet = true +} + +func (v NullableMount) IsSet() bool { + return v.isSet +} + +func (v *NullableMount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMount(val *Mount) *NullableMount { + return &NullableMount{value: val, isSet: true} +} + +func (v NullableMount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_move_hardware_reservation_request.go b/services/metalv1/model_move_hardware_reservation_request.go new file mode 100644 index 00000000..1945211f --- /dev/null +++ b/services/metalv1/model_move_hardware_reservation_request.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the MoveHardwareReservationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MoveHardwareReservationRequest{} + +// MoveHardwareReservationRequest struct for MoveHardwareReservationRequest +type MoveHardwareReservationRequest struct { + ProjectId *string `json:"project_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MoveHardwareReservationRequest MoveHardwareReservationRequest + +// NewMoveHardwareReservationRequest instantiates a new MoveHardwareReservationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMoveHardwareReservationRequest() *MoveHardwareReservationRequest { + this := MoveHardwareReservationRequest{} + return &this +} + +// NewMoveHardwareReservationRequestWithDefaults instantiates a new MoveHardwareReservationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMoveHardwareReservationRequestWithDefaults() *MoveHardwareReservationRequest { + this := MoveHardwareReservationRequest{} + return &this +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *MoveHardwareReservationRequest) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MoveHardwareReservationRequest) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *MoveHardwareReservationRequest) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *MoveHardwareReservationRequest) SetProjectId(v string) { + o.ProjectId = &v +} + +func (o MoveHardwareReservationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MoveHardwareReservationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MoveHardwareReservationRequest) UnmarshalJSON(bytes []byte) (err error) { + varMoveHardwareReservationRequest := _MoveHardwareReservationRequest{} + + err = json.Unmarshal(bytes, &varMoveHardwareReservationRequest) + + if err != nil { + return err + } + + *o = MoveHardwareReservationRequest(varMoveHardwareReservationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "project_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMoveHardwareReservationRequest struct { + value *MoveHardwareReservationRequest + isSet bool +} + +func (v NullableMoveHardwareReservationRequest) Get() *MoveHardwareReservationRequest { + return v.value +} + +func (v *NullableMoveHardwareReservationRequest) Set(val *MoveHardwareReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMoveHardwareReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMoveHardwareReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMoveHardwareReservationRequest(val *MoveHardwareReservationRequest) *NullableMoveHardwareReservationRequest { + return &NullableMoveHardwareReservationRequest{value: val, isSet: true} +} + +func (v NullableMoveHardwareReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMoveHardwareReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_new_password.go b/services/metalv1/model_new_password.go new file mode 100644 index 00000000..06b34d64 --- /dev/null +++ b/services/metalv1/model_new_password.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the NewPassword type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewPassword{} + +// NewPassword struct for NewPassword +type NewPassword struct { + NewPassword *string `json:"new_password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NewPassword NewPassword + +// NewNewPassword instantiates a new NewPassword object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNewPassword() *NewPassword { + this := NewPassword{} + return &this +} + +// NewNewPasswordWithDefaults instantiates a new NewPassword object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewPasswordWithDefaults() *NewPassword { + this := NewPassword{} + return &this +} + +// GetNewPassword returns the NewPassword field value if set, zero value otherwise. +func (o *NewPassword) GetNewPassword() string { + if o == nil || IsNil(o.NewPassword) { + var ret string + return ret + } + return *o.NewPassword +} + +// GetNewPasswordOk returns a tuple with the NewPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NewPassword) GetNewPasswordOk() (*string, bool) { + if o == nil || IsNil(o.NewPassword) { + return nil, false + } + return o.NewPassword, true +} + +// HasNewPassword returns a boolean if a field has been set. +func (o *NewPassword) HasNewPassword() bool { + if o != nil && !IsNil(o.NewPassword) { + return true + } + + return false +} + +// SetNewPassword gets a reference to the given string and assigns it to the NewPassword field. +func (o *NewPassword) SetNewPassword(v string) { + o.NewPassword = &v +} + +func (o NewPassword) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewPassword) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NewPassword) { + toSerialize["new_password"] = o.NewPassword + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NewPassword) UnmarshalJSON(bytes []byte) (err error) { + varNewPassword := _NewPassword{} + + err = json.Unmarshal(bytes, &varNewPassword) + + if err != nil { + return err + } + + *o = NewPassword(varNewPassword) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "new_password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNewPassword struct { + value *NewPassword + isSet bool +} + +func (v NullableNewPassword) Get() *NewPassword { + return v.value +} + +func (v *NullableNewPassword) Set(val *NewPassword) { + v.value = val + v.isSet = true +} + +func (v NullableNewPassword) IsSet() bool { + return v.isSet +} + +func (v *NullableNewPassword) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewPassword(val *NewPassword) *NullableNewPassword { + return &NullableNewPassword{value: val, isSet: true} +} + +func (v NullableNewPassword) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewPassword) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_operating_system.go b/services/metalv1/model_operating_system.go new file mode 100644 index 00000000..f956eb11 --- /dev/null +++ b/services/metalv1/model_operating_system.go @@ -0,0 +1,528 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the OperatingSystem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperatingSystem{} + +// OperatingSystem struct for OperatingSystem +type OperatingSystem struct { + Distro *string `json:"distro,omitempty"` + DistroLabel *string `json:"distro_label,omitempty"` + Id *string `json:"id,omitempty"` + // Licenced OS is priced according to pricing property + Licensed *bool `json:"licensed,omitempty"` + Name *string `json:"name,omitempty"` + // Servers can be already preinstalled with OS in order to shorten provision time. + Preinstallable *bool `json:"preinstallable,omitempty"` + // This object contains price per time unit and optional multiplier value if licence price depends on hardware plan or components (e.g. number of cores) + Pricing map[string]interface{} `json:"pricing,omitempty"` + ProvisionableOn []string `json:"provisionable_on,omitempty"` + Slug *string `json:"slug,omitempty"` + Version *string `json:"version,omitempty"` + // Default operating system for the distro. + DefaultOperatingSystem *bool `json:"default_operating_system,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OperatingSystem OperatingSystem + +// NewOperatingSystem instantiates a new OperatingSystem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperatingSystem() *OperatingSystem { + this := OperatingSystem{} + return &this +} + +// NewOperatingSystemWithDefaults instantiates a new OperatingSystem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperatingSystemWithDefaults() *OperatingSystem { + this := OperatingSystem{} + return &this +} + +// GetDistro returns the Distro field value if set, zero value otherwise. +func (o *OperatingSystem) GetDistro() string { + if o == nil || IsNil(o.Distro) { + var ret string + return ret + } + return *o.Distro +} + +// GetDistroOk returns a tuple with the Distro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetDistroOk() (*string, bool) { + if o == nil || IsNil(o.Distro) { + return nil, false + } + return o.Distro, true +} + +// HasDistro returns a boolean if a field has been set. +func (o *OperatingSystem) HasDistro() bool { + if o != nil && !IsNil(o.Distro) { + return true + } + + return false +} + +// SetDistro gets a reference to the given string and assigns it to the Distro field. +func (o *OperatingSystem) SetDistro(v string) { + o.Distro = &v +} + +// GetDistroLabel returns the DistroLabel field value if set, zero value otherwise. +func (o *OperatingSystem) GetDistroLabel() string { + if o == nil || IsNil(o.DistroLabel) { + var ret string + return ret + } + return *o.DistroLabel +} + +// GetDistroLabelOk returns a tuple with the DistroLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetDistroLabelOk() (*string, bool) { + if o == nil || IsNil(o.DistroLabel) { + return nil, false + } + return o.DistroLabel, true +} + +// HasDistroLabel returns a boolean if a field has been set. +func (o *OperatingSystem) HasDistroLabel() bool { + if o != nil && !IsNil(o.DistroLabel) { + return true + } + + return false +} + +// SetDistroLabel gets a reference to the given string and assigns it to the DistroLabel field. +func (o *OperatingSystem) SetDistroLabel(v string) { + o.DistroLabel = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OperatingSystem) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OperatingSystem) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OperatingSystem) SetId(v string) { + o.Id = &v +} + +// GetLicensed returns the Licensed field value if set, zero value otherwise. +func (o *OperatingSystem) GetLicensed() bool { + if o == nil || IsNil(o.Licensed) { + var ret bool + return ret + } + return *o.Licensed +} + +// GetLicensedOk returns a tuple with the Licensed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetLicensedOk() (*bool, bool) { + if o == nil || IsNil(o.Licensed) { + return nil, false + } + return o.Licensed, true +} + +// HasLicensed returns a boolean if a field has been set. +func (o *OperatingSystem) HasLicensed() bool { + if o != nil && !IsNil(o.Licensed) { + return true + } + + return false +} + +// SetLicensed gets a reference to the given bool and assigns it to the Licensed field. +func (o *OperatingSystem) SetLicensed(v bool) { + o.Licensed = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OperatingSystem) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OperatingSystem) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OperatingSystem) SetName(v string) { + o.Name = &v +} + +// GetPreinstallable returns the Preinstallable field value if set, zero value otherwise. +func (o *OperatingSystem) GetPreinstallable() bool { + if o == nil || IsNil(o.Preinstallable) { + var ret bool + return ret + } + return *o.Preinstallable +} + +// GetPreinstallableOk returns a tuple with the Preinstallable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetPreinstallableOk() (*bool, bool) { + if o == nil || IsNil(o.Preinstallable) { + return nil, false + } + return o.Preinstallable, true +} + +// HasPreinstallable returns a boolean if a field has been set. +func (o *OperatingSystem) HasPreinstallable() bool { + if o != nil && !IsNil(o.Preinstallable) { + return true + } + + return false +} + +// SetPreinstallable gets a reference to the given bool and assigns it to the Preinstallable field. +func (o *OperatingSystem) SetPreinstallable(v bool) { + o.Preinstallable = &v +} + +// GetPricing returns the Pricing field value if set, zero value otherwise. +func (o *OperatingSystem) GetPricing() map[string]interface{} { + if o == nil || IsNil(o.Pricing) { + var ret map[string]interface{} + return ret + } + return o.Pricing +} + +// GetPricingOk returns a tuple with the Pricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetPricingOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Pricing) { + return map[string]interface{}{}, false + } + return o.Pricing, true +} + +// HasPricing returns a boolean if a field has been set. +func (o *OperatingSystem) HasPricing() bool { + if o != nil && !IsNil(o.Pricing) { + return true + } + + return false +} + +// SetPricing gets a reference to the given map[string]interface{} and assigns it to the Pricing field. +func (o *OperatingSystem) SetPricing(v map[string]interface{}) { + o.Pricing = v +} + +// GetProvisionableOn returns the ProvisionableOn field value if set, zero value otherwise. +func (o *OperatingSystem) GetProvisionableOn() []string { + if o == nil || IsNil(o.ProvisionableOn) { + var ret []string + return ret + } + return o.ProvisionableOn +} + +// GetProvisionableOnOk returns a tuple with the ProvisionableOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetProvisionableOnOk() ([]string, bool) { + if o == nil || IsNil(o.ProvisionableOn) { + return nil, false + } + return o.ProvisionableOn, true +} + +// HasProvisionableOn returns a boolean if a field has been set. +func (o *OperatingSystem) HasProvisionableOn() bool { + if o != nil && !IsNil(o.ProvisionableOn) { + return true + } + + return false +} + +// SetProvisionableOn gets a reference to the given []string and assigns it to the ProvisionableOn field. +func (o *OperatingSystem) SetProvisionableOn(v []string) { + o.ProvisionableOn = v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *OperatingSystem) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *OperatingSystem) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *OperatingSystem) SetSlug(v string) { + o.Slug = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *OperatingSystem) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *OperatingSystem) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *OperatingSystem) SetVersion(v string) { + o.Version = &v +} + +// GetDefaultOperatingSystem returns the DefaultOperatingSystem field value if set, zero value otherwise. +func (o *OperatingSystem) GetDefaultOperatingSystem() bool { + if o == nil || IsNil(o.DefaultOperatingSystem) { + var ret bool + return ret + } + return *o.DefaultOperatingSystem +} + +// GetDefaultOperatingSystemOk returns a tuple with the DefaultOperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetDefaultOperatingSystemOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultOperatingSystem) { + return nil, false + } + return o.DefaultOperatingSystem, true +} + +// HasDefaultOperatingSystem returns a boolean if a field has been set. +func (o *OperatingSystem) HasDefaultOperatingSystem() bool { + if o != nil && !IsNil(o.DefaultOperatingSystem) { + return true + } + + return false +} + +// SetDefaultOperatingSystem gets a reference to the given bool and assigns it to the DefaultOperatingSystem field. +func (o *OperatingSystem) SetDefaultOperatingSystem(v bool) { + o.DefaultOperatingSystem = &v +} + +func (o OperatingSystem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperatingSystem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Distro) { + toSerialize["distro"] = o.Distro + } + if !IsNil(o.DistroLabel) { + toSerialize["distro_label"] = o.DistroLabel + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Licensed) { + toSerialize["licensed"] = o.Licensed + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Preinstallable) { + toSerialize["preinstallable"] = o.Preinstallable + } + if !IsNil(o.Pricing) { + toSerialize["pricing"] = o.Pricing + } + if !IsNil(o.ProvisionableOn) { + toSerialize["provisionable_on"] = o.ProvisionableOn + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.DefaultOperatingSystem) { + toSerialize["default_operating_system"] = o.DefaultOperatingSystem + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OperatingSystem) UnmarshalJSON(bytes []byte) (err error) { + varOperatingSystem := _OperatingSystem{} + + err = json.Unmarshal(bytes, &varOperatingSystem) + + if err != nil { + return err + } + + *o = OperatingSystem(varOperatingSystem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "distro") + delete(additionalProperties, "distro_label") + delete(additionalProperties, "id") + delete(additionalProperties, "licensed") + delete(additionalProperties, "name") + delete(additionalProperties, "preinstallable") + delete(additionalProperties, "pricing") + delete(additionalProperties, "provisionable_on") + delete(additionalProperties, "slug") + delete(additionalProperties, "version") + delete(additionalProperties, "default_operating_system") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOperatingSystem struct { + value *OperatingSystem + isSet bool +} + +func (v NullableOperatingSystem) Get() *OperatingSystem { + return v.value +} + +func (v *NullableOperatingSystem) Set(val *OperatingSystem) { + v.value = val + v.isSet = true +} + +func (v NullableOperatingSystem) IsSet() bool { + return v.isSet +} + +func (v *NullableOperatingSystem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperatingSystem(val *OperatingSystem) *NullableOperatingSystem { + return &NullableOperatingSystem{value: val, isSet: true} +} + +func (v NullableOperatingSystem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperatingSystem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_operating_system_list.go b/services/metalv1/model_operating_system_list.go new file mode 100644 index 00000000..34ca6cdf --- /dev/null +++ b/services/metalv1/model_operating_system_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the OperatingSystemList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperatingSystemList{} + +// OperatingSystemList struct for OperatingSystemList +type OperatingSystemList struct { + OperatingSystems []OperatingSystem `json:"operating_systems,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OperatingSystemList OperatingSystemList + +// NewOperatingSystemList instantiates a new OperatingSystemList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperatingSystemList() *OperatingSystemList { + this := OperatingSystemList{} + return &this +} + +// NewOperatingSystemListWithDefaults instantiates a new OperatingSystemList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperatingSystemListWithDefaults() *OperatingSystemList { + this := OperatingSystemList{} + return &this +} + +// GetOperatingSystems returns the OperatingSystems field value if set, zero value otherwise. +func (o *OperatingSystemList) GetOperatingSystems() []OperatingSystem { + if o == nil || IsNil(o.OperatingSystems) { + var ret []OperatingSystem + return ret + } + return o.OperatingSystems +} + +// GetOperatingSystemsOk returns a tuple with the OperatingSystems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystemList) GetOperatingSystemsOk() ([]OperatingSystem, bool) { + if o == nil || IsNil(o.OperatingSystems) { + return nil, false + } + return o.OperatingSystems, true +} + +// HasOperatingSystems returns a boolean if a field has been set. +func (o *OperatingSystemList) HasOperatingSystems() bool { + if o != nil && !IsNil(o.OperatingSystems) { + return true + } + + return false +} + +// SetOperatingSystems gets a reference to the given []OperatingSystem and assigns it to the OperatingSystems field. +func (o *OperatingSystemList) SetOperatingSystems(v []OperatingSystem) { + o.OperatingSystems = v +} + +func (o OperatingSystemList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperatingSystemList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OperatingSystems) { + toSerialize["operating_systems"] = o.OperatingSystems + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OperatingSystemList) UnmarshalJSON(bytes []byte) (err error) { + varOperatingSystemList := _OperatingSystemList{} + + err = json.Unmarshal(bytes, &varOperatingSystemList) + + if err != nil { + return err + } + + *o = OperatingSystemList(varOperatingSystemList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "operating_systems") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOperatingSystemList struct { + value *OperatingSystemList + isSet bool +} + +func (v NullableOperatingSystemList) Get() *OperatingSystemList { + return v.value +} + +func (v *NullableOperatingSystemList) Set(val *OperatingSystemList) { + v.value = val + v.isSet = true +} + +func (v NullableOperatingSystemList) IsSet() bool { + return v.isSet +} + +func (v *NullableOperatingSystemList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperatingSystemList(val *OperatingSystemList) *NullableOperatingSystemList { + return &NullableOperatingSystemList{value: val, isSet: true} +} + +func (v NullableOperatingSystemList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperatingSystemList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_organization.go b/services/metalv1/model_organization.go new file mode 100644 index 00000000..02febe33 --- /dev/null +++ b/services/metalv1/model_organization.go @@ -0,0 +1,748 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Organization type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Organization{} + +// Organization struct for Organization +type Organization struct { + Address *Address `json:"address,omitempty"` + BillingAddress *Address `json:"billing_address,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + CreditAmount *float32 `json:"credit_amount,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Description *string `json:"description,omitempty"` + // Force to all members to have enabled the two factor authentication after that date, unless the value is null + Enforce2faAt *time.Time `json:"enforce_2fa_at,omitempty"` + Id *string `json:"id,omitempty"` + Logo *string `json:"logo,omitempty"` + Members []Href `json:"members,omitempty"` + Memberships []Href `json:"memberships,omitempty"` + Name *string `json:"name,omitempty"` + Projects []Href `json:"projects,omitempty"` + Terms *int32 `json:"terms,omitempty"` + Twitter *string `json:"twitter,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Website *string `json:"website,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Organization Organization + +// NewOrganization instantiates a new Organization object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrganization() *Organization { + this := Organization{} + return &this +} + +// NewOrganizationWithDefaults instantiates a new Organization object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrganizationWithDefaults() *Organization { + this := Organization{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Organization) GetAddress() Address { + if o == nil || IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetAddressOk() (*Address, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Organization) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *Organization) SetAddress(v Address) { + o.Address = &v +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *Organization) GetBillingAddress() Address { + if o == nil || IsNil(o.BillingAddress) { + var ret Address + return ret + } + return *o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetBillingAddressOk() (*Address, bool) { + if o == nil || IsNil(o.BillingAddress) { + return nil, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *Organization) HasBillingAddress() bool { + if o != nil && !IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. +func (o *Organization) SetBillingAddress(v Address) { + o.BillingAddress = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Organization) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Organization) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Organization) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreditAmount returns the CreditAmount field value if set, zero value otherwise. +func (o *Organization) GetCreditAmount() float32 { + if o == nil || IsNil(o.CreditAmount) { + var ret float32 + return ret + } + return *o.CreditAmount +} + +// GetCreditAmountOk returns a tuple with the CreditAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetCreditAmountOk() (*float32, bool) { + if o == nil || IsNil(o.CreditAmount) { + return nil, false + } + return o.CreditAmount, true +} + +// HasCreditAmount returns a boolean if a field has been set. +func (o *Organization) HasCreditAmount() bool { + if o != nil && !IsNil(o.CreditAmount) { + return true + } + + return false +} + +// SetCreditAmount gets a reference to the given float32 and assigns it to the CreditAmount field. +func (o *Organization) SetCreditAmount(v float32) { + o.CreditAmount = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *Organization) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *Organization) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *Organization) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Organization) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Organization) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Organization) SetDescription(v string) { + o.Description = &v +} + +// GetEnforce2faAt returns the Enforce2faAt field value if set, zero value otherwise. +func (o *Organization) GetEnforce2faAt() time.Time { + if o == nil || IsNil(o.Enforce2faAt) { + var ret time.Time + return ret + } + return *o.Enforce2faAt +} + +// GetEnforce2faAtOk returns a tuple with the Enforce2faAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetEnforce2faAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.Enforce2faAt) { + return nil, false + } + return o.Enforce2faAt, true +} + +// HasEnforce2faAt returns a boolean if a field has been set. +func (o *Organization) HasEnforce2faAt() bool { + if o != nil && !IsNil(o.Enforce2faAt) { + return true + } + + return false +} + +// SetEnforce2faAt gets a reference to the given time.Time and assigns it to the Enforce2faAt field. +func (o *Organization) SetEnforce2faAt(v time.Time) { + o.Enforce2faAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Organization) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Organization) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Organization) SetId(v string) { + o.Id = &v +} + +// GetLogo returns the Logo field value if set, zero value otherwise. +func (o *Organization) GetLogo() string { + if o == nil || IsNil(o.Logo) { + var ret string + return ret + } + return *o.Logo +} + +// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetLogoOk() (*string, bool) { + if o == nil || IsNil(o.Logo) { + return nil, false + } + return o.Logo, true +} + +// HasLogo returns a boolean if a field has been set. +func (o *Organization) HasLogo() bool { + if o != nil && !IsNil(o.Logo) { + return true + } + + return false +} + +// SetLogo gets a reference to the given string and assigns it to the Logo field. +func (o *Organization) SetLogo(v string) { + o.Logo = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *Organization) GetMembers() []Href { + if o == nil || IsNil(o.Members) { + var ret []Href + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetMembersOk() ([]Href, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *Organization) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []Href and assigns it to the Members field. +func (o *Organization) SetMembers(v []Href) { + o.Members = v +} + +// GetMemberships returns the Memberships field value if set, zero value otherwise. +func (o *Organization) GetMemberships() []Href { + if o == nil || IsNil(o.Memberships) { + var ret []Href + return ret + } + return o.Memberships +} + +// GetMembershipsOk returns a tuple with the Memberships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetMembershipsOk() ([]Href, bool) { + if o == nil || IsNil(o.Memberships) { + return nil, false + } + return o.Memberships, true +} + +// HasMemberships returns a boolean if a field has been set. +func (o *Organization) HasMemberships() bool { + if o != nil && !IsNil(o.Memberships) { + return true + } + + return false +} + +// SetMemberships gets a reference to the given []Href and assigns it to the Memberships field. +func (o *Organization) SetMemberships(v []Href) { + o.Memberships = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Organization) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Organization) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Organization) SetName(v string) { + o.Name = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *Organization) GetProjects() []Href { + if o == nil || IsNil(o.Projects) { + var ret []Href + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetProjectsOk() ([]Href, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *Organization) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []Href and assigns it to the Projects field. +func (o *Organization) SetProjects(v []Href) { + o.Projects = v +} + +// GetTerms returns the Terms field value if set, zero value otherwise. +func (o *Organization) GetTerms() int32 { + if o == nil || IsNil(o.Terms) { + var ret int32 + return ret + } + return *o.Terms +} + +// GetTermsOk returns a tuple with the Terms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetTermsOk() (*int32, bool) { + if o == nil || IsNil(o.Terms) { + return nil, false + } + return o.Terms, true +} + +// HasTerms returns a boolean if a field has been set. +func (o *Organization) HasTerms() bool { + if o != nil && !IsNil(o.Terms) { + return true + } + + return false +} + +// SetTerms gets a reference to the given int32 and assigns it to the Terms field. +func (o *Organization) SetTerms(v int32) { + o.Terms = &v +} + +// GetTwitter returns the Twitter field value if set, zero value otherwise. +func (o *Organization) GetTwitter() string { + if o == nil || IsNil(o.Twitter) { + var ret string + return ret + } + return *o.Twitter +} + +// GetTwitterOk returns a tuple with the Twitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetTwitterOk() (*string, bool) { + if o == nil || IsNil(o.Twitter) { + return nil, false + } + return o.Twitter, true +} + +// HasTwitter returns a boolean if a field has been set. +func (o *Organization) HasTwitter() bool { + if o != nil && !IsNil(o.Twitter) { + return true + } + + return false +} + +// SetTwitter gets a reference to the given string and assigns it to the Twitter field. +func (o *Organization) SetTwitter(v string) { + o.Twitter = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Organization) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Organization) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Organization) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetWebsite returns the Website field value if set, zero value otherwise. +func (o *Organization) GetWebsite() string { + if o == nil || IsNil(o.Website) { + var ret string + return ret + } + return *o.Website +} + +// GetWebsiteOk returns a tuple with the Website field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Organization) GetWebsiteOk() (*string, bool) { + if o == nil || IsNil(o.Website) { + return nil, false + } + return o.Website, true +} + +// HasWebsite returns a boolean if a field has been set. +func (o *Organization) HasWebsite() bool { + if o != nil && !IsNil(o.Website) { + return true + } + + return false +} + +// SetWebsite gets a reference to the given string and assigns it to the Website field. +func (o *Organization) SetWebsite(v string) { + o.Website = &v +} + +func (o Organization) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Organization) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.BillingAddress) { + toSerialize["billing_address"] = o.BillingAddress + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreditAmount) { + toSerialize["credit_amount"] = o.CreditAmount + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enforce2faAt) { + toSerialize["enforce_2fa_at"] = o.Enforce2faAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Logo) { + toSerialize["logo"] = o.Logo + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + if !IsNil(o.Memberships) { + toSerialize["memberships"] = o.Memberships + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + if !IsNil(o.Terms) { + toSerialize["terms"] = o.Terms + } + if !IsNil(o.Twitter) { + toSerialize["twitter"] = o.Twitter + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Website) { + toSerialize["website"] = o.Website + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Organization) UnmarshalJSON(bytes []byte) (err error) { + varOrganization := _Organization{} + + err = json.Unmarshal(bytes, &varOrganization) + + if err != nil { + return err + } + + *o = Organization(varOrganization) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "billing_address") + delete(additionalProperties, "created_at") + delete(additionalProperties, "credit_amount") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "enforce_2fa_at") + delete(additionalProperties, "id") + delete(additionalProperties, "logo") + delete(additionalProperties, "members") + delete(additionalProperties, "memberships") + delete(additionalProperties, "name") + delete(additionalProperties, "projects") + delete(additionalProperties, "terms") + delete(additionalProperties, "twitter") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "website") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrganization struct { + value *Organization + isSet bool +} + +func (v NullableOrganization) Get() *Organization { + return v.value +} + +func (v *NullableOrganization) Set(val *Organization) { + v.value = val + v.isSet = true +} + +func (v NullableOrganization) IsSet() bool { + return v.isSet +} + +func (v *NullableOrganization) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrganization(val *Organization) *NullableOrganization { + return &NullableOrganization{value: val, isSet: true} +} + +func (v NullableOrganization) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrganization) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_organization_input.go b/services/metalv1/model_organization_input.go new file mode 100644 index 00000000..7154577b --- /dev/null +++ b/services/metalv1/model_organization_input.go @@ -0,0 +1,453 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the OrganizationInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrganizationInput{} + +// OrganizationInput struct for OrganizationInput +type OrganizationInput struct { + Address *Address `json:"address,omitempty"` + BillingAddress *Address `json:"billing_address,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Description *string `json:"description,omitempty"` + // Force to all members to have enabled the two factor authentication after that date, unless the value is null + Enforce2faAt *time.Time `json:"enforce_2fa_at,omitempty"` + // The logo for the organization; must be base64-encoded image data + Logo *string `json:"logo,omitempty"` + Name *string `json:"name,omitempty"` + Twitter *string `json:"twitter,omitempty"` + Website *string `json:"website,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrganizationInput OrganizationInput + +// NewOrganizationInput instantiates a new OrganizationInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrganizationInput() *OrganizationInput { + this := OrganizationInput{} + return &this +} + +// NewOrganizationInputWithDefaults instantiates a new OrganizationInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrganizationInputWithDefaults() *OrganizationInput { + this := OrganizationInput{} + return &this +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *OrganizationInput) GetAddress() Address { + if o == nil || IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetAddressOk() (*Address, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *OrganizationInput) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *OrganizationInput) SetAddress(v Address) { + o.Address = &v +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *OrganizationInput) GetBillingAddress() Address { + if o == nil || IsNil(o.BillingAddress) { + var ret Address + return ret + } + return *o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetBillingAddressOk() (*Address, bool) { + if o == nil || IsNil(o.BillingAddress) { + return nil, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *OrganizationInput) HasBillingAddress() bool { + if o != nil && !IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given Address and assigns it to the BillingAddress field. +func (o *OrganizationInput) SetBillingAddress(v Address) { + o.BillingAddress = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *OrganizationInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *OrganizationInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *OrganizationInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *OrganizationInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OrganizationInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OrganizationInput) SetDescription(v string) { + o.Description = &v +} + +// GetEnforce2faAt returns the Enforce2faAt field value if set, zero value otherwise. +func (o *OrganizationInput) GetEnforce2faAt() time.Time { + if o == nil || IsNil(o.Enforce2faAt) { + var ret time.Time + return ret + } + return *o.Enforce2faAt +} + +// GetEnforce2faAtOk returns a tuple with the Enforce2faAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetEnforce2faAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.Enforce2faAt) { + return nil, false + } + return o.Enforce2faAt, true +} + +// HasEnforce2faAt returns a boolean if a field has been set. +func (o *OrganizationInput) HasEnforce2faAt() bool { + if o != nil && !IsNil(o.Enforce2faAt) { + return true + } + + return false +} + +// SetEnforce2faAt gets a reference to the given time.Time and assigns it to the Enforce2faAt field. +func (o *OrganizationInput) SetEnforce2faAt(v time.Time) { + o.Enforce2faAt = &v +} + +// GetLogo returns the Logo field value if set, zero value otherwise. +func (o *OrganizationInput) GetLogo() string { + if o == nil || IsNil(o.Logo) { + var ret string + return ret + } + return *o.Logo +} + +// GetLogoOk returns a tuple with the Logo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetLogoOk() (*string, bool) { + if o == nil || IsNil(o.Logo) { + return nil, false + } + return o.Logo, true +} + +// HasLogo returns a boolean if a field has been set. +func (o *OrganizationInput) HasLogo() bool { + if o != nil && !IsNil(o.Logo) { + return true + } + + return false +} + +// SetLogo gets a reference to the given string and assigns it to the Logo field. +func (o *OrganizationInput) SetLogo(v string) { + o.Logo = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OrganizationInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrganizationInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrganizationInput) SetName(v string) { + o.Name = &v +} + +// GetTwitter returns the Twitter field value if set, zero value otherwise. +func (o *OrganizationInput) GetTwitter() string { + if o == nil || IsNil(o.Twitter) { + var ret string + return ret + } + return *o.Twitter +} + +// GetTwitterOk returns a tuple with the Twitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetTwitterOk() (*string, bool) { + if o == nil || IsNil(o.Twitter) { + return nil, false + } + return o.Twitter, true +} + +// HasTwitter returns a boolean if a field has been set. +func (o *OrganizationInput) HasTwitter() bool { + if o != nil && !IsNil(o.Twitter) { + return true + } + + return false +} + +// SetTwitter gets a reference to the given string and assigns it to the Twitter field. +func (o *OrganizationInput) SetTwitter(v string) { + o.Twitter = &v +} + +// GetWebsite returns the Website field value if set, zero value otherwise. +func (o *OrganizationInput) GetWebsite() string { + if o == nil || IsNil(o.Website) { + var ret string + return ret + } + return *o.Website +} + +// GetWebsiteOk returns a tuple with the Website field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationInput) GetWebsiteOk() (*string, bool) { + if o == nil || IsNil(o.Website) { + return nil, false + } + return o.Website, true +} + +// HasWebsite returns a boolean if a field has been set. +func (o *OrganizationInput) HasWebsite() bool { + if o != nil && !IsNil(o.Website) { + return true + } + + return false +} + +// SetWebsite gets a reference to the given string and assigns it to the Website field. +func (o *OrganizationInput) SetWebsite(v string) { + o.Website = &v +} + +func (o OrganizationInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrganizationInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.BillingAddress) { + toSerialize["billing_address"] = o.BillingAddress + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enforce2faAt) { + toSerialize["enforce_2fa_at"] = o.Enforce2faAt + } + if !IsNil(o.Logo) { + toSerialize["logo"] = o.Logo + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Twitter) { + toSerialize["twitter"] = o.Twitter + } + if !IsNil(o.Website) { + toSerialize["website"] = o.Website + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrganizationInput) UnmarshalJSON(bytes []byte) (err error) { + varOrganizationInput := _OrganizationInput{} + + err = json.Unmarshal(bytes, &varOrganizationInput) + + if err != nil { + return err + } + + *o = OrganizationInput(varOrganizationInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address") + delete(additionalProperties, "billing_address") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "enforce_2fa_at") + delete(additionalProperties, "logo") + delete(additionalProperties, "name") + delete(additionalProperties, "twitter") + delete(additionalProperties, "website") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrganizationInput struct { + value *OrganizationInput + isSet bool +} + +func (v NullableOrganizationInput) Get() *OrganizationInput { + return v.value +} + +func (v *NullableOrganizationInput) Set(val *OrganizationInput) { + v.value = val + v.isSet = true +} + +func (v NullableOrganizationInput) IsSet() bool { + return v.isSet +} + +func (v *NullableOrganizationInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrganizationInput(val *OrganizationInput) *NullableOrganizationInput { + return &NullableOrganizationInput{value: val, isSet: true} +} + +func (v NullableOrganizationInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrganizationInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_organization_list.go b/services/metalv1/model_organization_list.go new file mode 100644 index 00000000..c70c594b --- /dev/null +++ b/services/metalv1/model_organization_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the OrganizationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrganizationList{} + +// OrganizationList struct for OrganizationList +type OrganizationList struct { + Meta *Meta `json:"meta,omitempty"` + Organizations []Organization `json:"organizations,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrganizationList OrganizationList + +// NewOrganizationList instantiates a new OrganizationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrganizationList() *OrganizationList { + this := OrganizationList{} + return &this +} + +// NewOrganizationListWithDefaults instantiates a new OrganizationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrganizationListWithDefaults() *OrganizationList { + this := OrganizationList{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *OrganizationList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *OrganizationList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *OrganizationList) SetMeta(v Meta) { + o.Meta = &v +} + +// GetOrganizations returns the Organizations field value if set, zero value otherwise. +func (o *OrganizationList) GetOrganizations() []Organization { + if o == nil || IsNil(o.Organizations) { + var ret []Organization + return ret + } + return o.Organizations +} + +// GetOrganizationsOk returns a tuple with the Organizations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrganizationList) GetOrganizationsOk() ([]Organization, bool) { + if o == nil || IsNil(o.Organizations) { + return nil, false + } + return o.Organizations, true +} + +// HasOrganizations returns a boolean if a field has been set. +func (o *OrganizationList) HasOrganizations() bool { + if o != nil && !IsNil(o.Organizations) { + return true + } + + return false +} + +// SetOrganizations gets a reference to the given []Organization and assigns it to the Organizations field. +func (o *OrganizationList) SetOrganizations(v []Organization) { + o.Organizations = v +} + +func (o OrganizationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrganizationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !IsNil(o.Organizations) { + toSerialize["organizations"] = o.Organizations + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrganizationList) UnmarshalJSON(bytes []byte) (err error) { + varOrganizationList := _OrganizationList{} + + err = json.Unmarshal(bytes, &varOrganizationList) + + if err != nil { + return err + } + + *o = OrganizationList(varOrganizationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "meta") + delete(additionalProperties, "organizations") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrganizationList struct { + value *OrganizationList + isSet bool +} + +func (v NullableOrganizationList) Get() *OrganizationList { + return v.value +} + +func (v *NullableOrganizationList) Set(val *OrganizationList) { + v.value = val + v.isSet = true +} + +func (v NullableOrganizationList) IsSet() bool { + return v.isSet +} + +func (v *NullableOrganizationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrganizationList(val *OrganizationList) *NullableOrganizationList { + return &NullableOrganizationList{value: val, isSet: true} +} + +func (v NullableOrganizationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrganizationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_parent_block.go b/services/metalv1/model_parent_block.go new file mode 100644 index 00000000..43a3a373 --- /dev/null +++ b/services/metalv1/model_parent_block.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ParentBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ParentBlock{} + +// ParentBlock struct for ParentBlock +type ParentBlock struct { + Cidr *int32 `json:"cidr,omitempty"` + Href *string `json:"href,omitempty"` + Netmask *string `json:"netmask,omitempty"` + Network *string `json:"network,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ParentBlock ParentBlock + +// NewParentBlock instantiates a new ParentBlock object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewParentBlock() *ParentBlock { + this := ParentBlock{} + return &this +} + +// NewParentBlockWithDefaults instantiates a new ParentBlock object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewParentBlockWithDefaults() *ParentBlock { + this := ParentBlock{} + return &this +} + +// GetCidr returns the Cidr field value if set, zero value otherwise. +func (o *ParentBlock) GetCidr() int32 { + if o == nil || IsNil(o.Cidr) { + var ret int32 + return ret + } + return *o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParentBlock) GetCidrOk() (*int32, bool) { + if o == nil || IsNil(o.Cidr) { + return nil, false + } + return o.Cidr, true +} + +// HasCidr returns a boolean if a field has been set. +func (o *ParentBlock) HasCidr() bool { + if o != nil && !IsNil(o.Cidr) { + return true + } + + return false +} + +// SetCidr gets a reference to the given int32 and assigns it to the Cidr field. +func (o *ParentBlock) SetCidr(v int32) { + o.Cidr = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *ParentBlock) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParentBlock) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *ParentBlock) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *ParentBlock) SetHref(v string) { + o.Href = &v +} + +// GetNetmask returns the Netmask field value if set, zero value otherwise. +func (o *ParentBlock) GetNetmask() string { + if o == nil || IsNil(o.Netmask) { + var ret string + return ret + } + return *o.Netmask +} + +// GetNetmaskOk returns a tuple with the Netmask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParentBlock) GetNetmaskOk() (*string, bool) { + if o == nil || IsNil(o.Netmask) { + return nil, false + } + return o.Netmask, true +} + +// HasNetmask returns a boolean if a field has been set. +func (o *ParentBlock) HasNetmask() bool { + if o != nil && !IsNil(o.Netmask) { + return true + } + + return false +} + +// SetNetmask gets a reference to the given string and assigns it to the Netmask field. +func (o *ParentBlock) SetNetmask(v string) { + o.Netmask = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *ParentBlock) GetNetwork() string { + if o == nil || IsNil(o.Network) { + var ret string + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ParentBlock) GetNetworkOk() (*string, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *ParentBlock) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given string and assigns it to the Network field. +func (o *ParentBlock) SetNetwork(v string) { + o.Network = &v +} + +func (o ParentBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ParentBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cidr) { + toSerialize["cidr"] = o.Cidr + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Netmask) { + toSerialize["netmask"] = o.Netmask + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ParentBlock) UnmarshalJSON(bytes []byte) (err error) { + varParentBlock := _ParentBlock{} + + err = json.Unmarshal(bytes, &varParentBlock) + + if err != nil { + return err + } + + *o = ParentBlock(varParentBlock) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cidr") + delete(additionalProperties, "href") + delete(additionalProperties, "netmask") + delete(additionalProperties, "network") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableParentBlock struct { + value *ParentBlock + isSet bool +} + +func (v NullableParentBlock) Get() *ParentBlock { + return v.value +} + +func (v *NullableParentBlock) Set(val *ParentBlock) { + v.value = val + v.isSet = true +} + +func (v NullableParentBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableParentBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableParentBlock(val *ParentBlock) *NullableParentBlock { + return &NullableParentBlock{value: val, isSet: true} +} + +func (v NullableParentBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableParentBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_partition.go b/services/metalv1/model_partition.go new file mode 100644 index 00000000..7fea4757 --- /dev/null +++ b/services/metalv1/model_partition.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Partition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Partition{} + +// Partition struct for Partition +type Partition struct { + Label *string `json:"label,omitempty"` + Number *int32 `json:"number,omitempty"` + Size *string `json:"size,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Partition Partition + +// NewPartition instantiates a new Partition object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartition() *Partition { + this := Partition{} + return &this +} + +// NewPartitionWithDefaults instantiates a new Partition object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartitionWithDefaults() *Partition { + this := Partition{} + return &this +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *Partition) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Partition) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *Partition) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *Partition) SetLabel(v string) { + o.Label = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Partition) GetNumber() int32 { + if o == nil || IsNil(o.Number) { + var ret int32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Partition) GetNumberOk() (*int32, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Partition) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given int32 and assigns it to the Number field. +func (o *Partition) SetNumber(v int32) { + o.Number = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Partition) GetSize() string { + if o == nil || IsNil(o.Size) { + var ret string + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Partition) GetSizeOk() (*string, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Partition) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given string and assigns it to the Size field. +func (o *Partition) SetSize(v string) { + o.Size = &v +} + +func (o Partition) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Partition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Partition) UnmarshalJSON(bytes []byte) (err error) { + varPartition := _Partition{} + + err = json.Unmarshal(bytes, &varPartition) + + if err != nil { + return err + } + + *o = Partition(varPartition) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "label") + delete(additionalProperties, "number") + delete(additionalProperties, "size") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartition struct { + value *Partition + isSet bool +} + +func (v NullablePartition) Get() *Partition { + return v.value +} + +func (v *NullablePartition) Set(val *Partition) { + v.value = val + v.isSet = true +} + +func (v NullablePartition) IsSet() bool { + return v.isSet +} + +func (v *NullablePartition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartition(val *Partition) *NullablePartition { + return &NullablePartition{value: val, isSet: true} +} + +func (v NullablePartition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_payment_method.go b/services/metalv1/model_payment_method.go new file mode 100644 index 00000000..ce8007cb --- /dev/null +++ b/services/metalv1/model_payment_method.go @@ -0,0 +1,673 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the PaymentMethod type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaymentMethod{} + +// PaymentMethod struct for PaymentMethod +type PaymentMethod struct { + BillingAddress *PaymentMethodBillingAddress `json:"billing_address,omitempty"` + CardType *string `json:"card_type,omitempty"` + CardholderName *string `json:"cardholder_name,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedByUser *Href `json:"created_by_user,omitempty"` + Default *bool `json:"default,omitempty"` + Email *string `json:"email,omitempty"` + ExpirationMonth *string `json:"expiration_month,omitempty"` + ExpirationYear *string `json:"expiration_year,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Organization *Href `json:"organization,omitempty"` + Projects []Href `json:"projects,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaymentMethod PaymentMethod + +// NewPaymentMethod instantiates a new PaymentMethod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethod() *PaymentMethod { + this := PaymentMethod{} + return &this +} + +// NewPaymentMethodWithDefaults instantiates a new PaymentMethod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodWithDefaults() *PaymentMethod { + this := PaymentMethod{} + return &this +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *PaymentMethod) GetBillingAddress() PaymentMethodBillingAddress { + if o == nil || IsNil(o.BillingAddress) { + var ret PaymentMethodBillingAddress + return ret + } + return *o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetBillingAddressOk() (*PaymentMethodBillingAddress, bool) { + if o == nil || IsNil(o.BillingAddress) { + return nil, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *PaymentMethod) HasBillingAddress() bool { + if o != nil && !IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given PaymentMethodBillingAddress and assigns it to the BillingAddress field. +func (o *PaymentMethod) SetBillingAddress(v PaymentMethodBillingAddress) { + o.BillingAddress = &v +} + +// GetCardType returns the CardType field value if set, zero value otherwise. +func (o *PaymentMethod) GetCardType() string { + if o == nil || IsNil(o.CardType) { + var ret string + return ret + } + return *o.CardType +} + +// GetCardTypeOk returns a tuple with the CardType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCardTypeOk() (*string, bool) { + if o == nil || IsNil(o.CardType) { + return nil, false + } + return o.CardType, true +} + +// HasCardType returns a boolean if a field has been set. +func (o *PaymentMethod) HasCardType() bool { + if o != nil && !IsNil(o.CardType) { + return true + } + + return false +} + +// SetCardType gets a reference to the given string and assigns it to the CardType field. +func (o *PaymentMethod) SetCardType(v string) { + o.CardType = &v +} + +// GetCardholderName returns the CardholderName field value if set, zero value otherwise. +func (o *PaymentMethod) GetCardholderName() string { + if o == nil || IsNil(o.CardholderName) { + var ret string + return ret + } + return *o.CardholderName +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCardholderNameOk() (*string, bool) { + if o == nil || IsNil(o.CardholderName) { + return nil, false + } + return o.CardholderName, true +} + +// HasCardholderName returns a boolean if a field has been set. +func (o *PaymentMethod) HasCardholderName() bool { + if o != nil && !IsNil(o.CardholderName) { + return true + } + + return false +} + +// SetCardholderName gets a reference to the given string and assigns it to the CardholderName field. +func (o *PaymentMethod) SetCardholderName(v string) { + o.CardholderName = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *PaymentMethod) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *PaymentMethod) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *PaymentMethod) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedByUser returns the CreatedByUser field value if set, zero value otherwise. +func (o *PaymentMethod) GetCreatedByUser() Href { + if o == nil || IsNil(o.CreatedByUser) { + var ret Href + return ret + } + return *o.CreatedByUser +} + +// GetCreatedByUserOk returns a tuple with the CreatedByUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetCreatedByUserOk() (*Href, bool) { + if o == nil || IsNil(o.CreatedByUser) { + return nil, false + } + return o.CreatedByUser, true +} + +// HasCreatedByUser returns a boolean if a field has been set. +func (o *PaymentMethod) HasCreatedByUser() bool { + if o != nil && !IsNil(o.CreatedByUser) { + return true + } + + return false +} + +// SetCreatedByUser gets a reference to the given Href and assigns it to the CreatedByUser field. +func (o *PaymentMethod) SetCreatedByUser(v Href) { + o.CreatedByUser = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *PaymentMethod) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *PaymentMethod) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *PaymentMethod) SetDefault(v bool) { + o.Default = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *PaymentMethod) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *PaymentMethod) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *PaymentMethod) SetEmail(v string) { + o.Email = &v +} + +// GetExpirationMonth returns the ExpirationMonth field value if set, zero value otherwise. +func (o *PaymentMethod) GetExpirationMonth() string { + if o == nil || IsNil(o.ExpirationMonth) { + var ret string + return ret + } + return *o.ExpirationMonth +} + +// GetExpirationMonthOk returns a tuple with the ExpirationMonth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetExpirationMonthOk() (*string, bool) { + if o == nil || IsNil(o.ExpirationMonth) { + return nil, false + } + return o.ExpirationMonth, true +} + +// HasExpirationMonth returns a boolean if a field has been set. +func (o *PaymentMethod) HasExpirationMonth() bool { + if o != nil && !IsNil(o.ExpirationMonth) { + return true + } + + return false +} + +// SetExpirationMonth gets a reference to the given string and assigns it to the ExpirationMonth field. +func (o *PaymentMethod) SetExpirationMonth(v string) { + o.ExpirationMonth = &v +} + +// GetExpirationYear returns the ExpirationYear field value if set, zero value otherwise. +func (o *PaymentMethod) GetExpirationYear() string { + if o == nil || IsNil(o.ExpirationYear) { + var ret string + return ret + } + return *o.ExpirationYear +} + +// GetExpirationYearOk returns a tuple with the ExpirationYear field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetExpirationYearOk() (*string, bool) { + if o == nil || IsNil(o.ExpirationYear) { + return nil, false + } + return o.ExpirationYear, true +} + +// HasExpirationYear returns a boolean if a field has been set. +func (o *PaymentMethod) HasExpirationYear() bool { + if o != nil && !IsNil(o.ExpirationYear) { + return true + } + + return false +} + +// SetExpirationYear gets a reference to the given string and assigns it to the ExpirationYear field. +func (o *PaymentMethod) SetExpirationYear(v string) { + o.ExpirationYear = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PaymentMethod) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PaymentMethod) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PaymentMethod) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PaymentMethod) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PaymentMethod) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PaymentMethod) SetName(v string) { + o.Name = &v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *PaymentMethod) GetOrganization() Href { + if o == nil || IsNil(o.Organization) { + var ret Href + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetOrganizationOk() (*Href, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *PaymentMethod) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Href and assigns it to the Organization field. +func (o *PaymentMethod) SetOrganization(v Href) { + o.Organization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *PaymentMethod) GetProjects() []Href { + if o == nil || IsNil(o.Projects) { + var ret []Href + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetProjectsOk() ([]Href, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *PaymentMethod) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []Href and assigns it to the Projects field. +func (o *PaymentMethod) SetProjects(v []Href) { + o.Projects = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PaymentMethod) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PaymentMethod) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PaymentMethod) SetType(v string) { + o.Type = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *PaymentMethod) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethod) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *PaymentMethod) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *PaymentMethod) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o PaymentMethod) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BillingAddress) { + toSerialize["billing_address"] = o.BillingAddress + } + if !IsNil(o.CardType) { + toSerialize["card_type"] = o.CardType + } + if !IsNil(o.CardholderName) { + toSerialize["cardholder_name"] = o.CardholderName + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedByUser) { + toSerialize["created_by_user"] = o.CreatedByUser + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.ExpirationMonth) { + toSerialize["expiration_month"] = o.ExpirationMonth + } + if !IsNil(o.ExpirationYear) { + toSerialize["expiration_year"] = o.ExpirationYear + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaymentMethod) UnmarshalJSON(bytes []byte) (err error) { + varPaymentMethod := _PaymentMethod{} + + err = json.Unmarshal(bytes, &varPaymentMethod) + + if err != nil { + return err + } + + *o = PaymentMethod(varPaymentMethod) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "billing_address") + delete(additionalProperties, "card_type") + delete(additionalProperties, "cardholder_name") + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by_user") + delete(additionalProperties, "default") + delete(additionalProperties, "email") + delete(additionalProperties, "expiration_month") + delete(additionalProperties, "expiration_year") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "organization") + delete(additionalProperties, "projects") + delete(additionalProperties, "type") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaymentMethod struct { + value *PaymentMethod + isSet bool +} + +func (v NullablePaymentMethod) Get() *PaymentMethod { + return v.value +} + +func (v *NullablePaymentMethod) Set(val *PaymentMethod) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethod) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethod(val *PaymentMethod) *NullablePaymentMethod { + return &NullablePaymentMethod{value: val, isSet: true} +} + +func (v NullablePaymentMethod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_payment_method_billing_address.go b/services/metalv1/model_payment_method_billing_address.go new file mode 100644 index 00000000..2503dbb2 --- /dev/null +++ b/services/metalv1/model_payment_method_billing_address.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PaymentMethodBillingAddress type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaymentMethodBillingAddress{} + +// PaymentMethodBillingAddress struct for PaymentMethodBillingAddress +type PaymentMethodBillingAddress struct { + CountryCodeAlpha2 *string `json:"country_code_alpha2,omitempty"` + PostalCode *string `json:"postal_code,omitempty"` + StreetAddress *string `json:"street_address,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaymentMethodBillingAddress PaymentMethodBillingAddress + +// NewPaymentMethodBillingAddress instantiates a new PaymentMethodBillingAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodBillingAddress() *PaymentMethodBillingAddress { + this := PaymentMethodBillingAddress{} + return &this +} + +// NewPaymentMethodBillingAddressWithDefaults instantiates a new PaymentMethodBillingAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodBillingAddressWithDefaults() *PaymentMethodBillingAddress { + this := PaymentMethodBillingAddress{} + return &this +} + +// GetCountryCodeAlpha2 returns the CountryCodeAlpha2 field value if set, zero value otherwise. +func (o *PaymentMethodBillingAddress) GetCountryCodeAlpha2() string { + if o == nil || IsNil(o.CountryCodeAlpha2) { + var ret string + return ret + } + return *o.CountryCodeAlpha2 +} + +// GetCountryCodeAlpha2Ok returns a tuple with the CountryCodeAlpha2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodBillingAddress) GetCountryCodeAlpha2Ok() (*string, bool) { + if o == nil || IsNil(o.CountryCodeAlpha2) { + return nil, false + } + return o.CountryCodeAlpha2, true +} + +// HasCountryCodeAlpha2 returns a boolean if a field has been set. +func (o *PaymentMethodBillingAddress) HasCountryCodeAlpha2() bool { + if o != nil && !IsNil(o.CountryCodeAlpha2) { + return true + } + + return false +} + +// SetCountryCodeAlpha2 gets a reference to the given string and assigns it to the CountryCodeAlpha2 field. +func (o *PaymentMethodBillingAddress) SetCountryCodeAlpha2(v string) { + o.CountryCodeAlpha2 = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *PaymentMethodBillingAddress) GetPostalCode() string { + if o == nil || IsNil(o.PostalCode) { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodBillingAddress) GetPostalCodeOk() (*string, bool) { + if o == nil || IsNil(o.PostalCode) { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *PaymentMethodBillingAddress) HasPostalCode() bool { + if o != nil && !IsNil(o.PostalCode) { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *PaymentMethodBillingAddress) SetPostalCode(v string) { + o.PostalCode = &v +} + +// GetStreetAddress returns the StreetAddress field value if set, zero value otherwise. +func (o *PaymentMethodBillingAddress) GetStreetAddress() string { + if o == nil || IsNil(o.StreetAddress) { + var ret string + return ret + } + return *o.StreetAddress +} + +// GetStreetAddressOk returns a tuple with the StreetAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodBillingAddress) GetStreetAddressOk() (*string, bool) { + if o == nil || IsNil(o.StreetAddress) { + return nil, false + } + return o.StreetAddress, true +} + +// HasStreetAddress returns a boolean if a field has been set. +func (o *PaymentMethodBillingAddress) HasStreetAddress() bool { + if o != nil && !IsNil(o.StreetAddress) { + return true + } + + return false +} + +// SetStreetAddress gets a reference to the given string and assigns it to the StreetAddress field. +func (o *PaymentMethodBillingAddress) SetStreetAddress(v string) { + o.StreetAddress = &v +} + +func (o PaymentMethodBillingAddress) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodBillingAddress) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CountryCodeAlpha2) { + toSerialize["country_code_alpha2"] = o.CountryCodeAlpha2 + } + if !IsNil(o.PostalCode) { + toSerialize["postal_code"] = o.PostalCode + } + if !IsNil(o.StreetAddress) { + toSerialize["street_address"] = o.StreetAddress + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaymentMethodBillingAddress) UnmarshalJSON(bytes []byte) (err error) { + varPaymentMethodBillingAddress := _PaymentMethodBillingAddress{} + + err = json.Unmarshal(bytes, &varPaymentMethodBillingAddress) + + if err != nil { + return err + } + + *o = PaymentMethodBillingAddress(varPaymentMethodBillingAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "country_code_alpha2") + delete(additionalProperties, "postal_code") + delete(additionalProperties, "street_address") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaymentMethodBillingAddress struct { + value *PaymentMethodBillingAddress + isSet bool +} + +func (v NullablePaymentMethodBillingAddress) Get() *PaymentMethodBillingAddress { + return v.value +} + +func (v *NullablePaymentMethodBillingAddress) Set(val *PaymentMethodBillingAddress) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodBillingAddress) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodBillingAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodBillingAddress(val *PaymentMethodBillingAddress) *NullablePaymentMethodBillingAddress { + return &NullablePaymentMethodBillingAddress{value: val, isSet: true} +} + +func (v NullablePaymentMethodBillingAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodBillingAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_payment_method_create_input.go b/services/metalv1/model_payment_method_create_input.go new file mode 100644 index 00000000..ddae05e2 --- /dev/null +++ b/services/metalv1/model_payment_method_create_input.go @@ -0,0 +1,233 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaymentMethodCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaymentMethodCreateInput{} + +// PaymentMethodCreateInput struct for PaymentMethodCreateInput +type PaymentMethodCreateInput struct { + Default *bool `json:"default,omitempty"` + Name string `json:"name"` + Nonce string `json:"nonce"` + AdditionalProperties map[string]interface{} +} + +type _PaymentMethodCreateInput PaymentMethodCreateInput + +// NewPaymentMethodCreateInput instantiates a new PaymentMethodCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodCreateInput(name string, nonce string) *PaymentMethodCreateInput { + this := PaymentMethodCreateInput{} + this.Name = name + this.Nonce = nonce + return &this +} + +// NewPaymentMethodCreateInputWithDefaults instantiates a new PaymentMethodCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodCreateInputWithDefaults() *PaymentMethodCreateInput { + this := PaymentMethodCreateInput{} + return &this +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *PaymentMethodCreateInput) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodCreateInput) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *PaymentMethodCreateInput) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *PaymentMethodCreateInput) SetDefault(v bool) { + o.Default = &v +} + +// GetName returns the Name field value +func (o *PaymentMethodCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PaymentMethodCreateInput) SetName(v string) { + o.Name = v +} + +// GetNonce returns the Nonce field value +func (o *PaymentMethodCreateInput) GetNonce() string { + if o == nil { + var ret string + return ret + } + + return o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodCreateInput) GetNonceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nonce, true +} + +// SetNonce sets field value +func (o *PaymentMethodCreateInput) SetNonce(v string) { + o.Nonce = v +} + +func (o PaymentMethodCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + toSerialize["name"] = o.Name + toSerialize["nonce"] = o.Nonce + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaymentMethodCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "nonce", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaymentMethodCreateInput := _PaymentMethodCreateInput{} + + err = json.Unmarshal(bytes, &varPaymentMethodCreateInput) + + if err != nil { + return err + } + + *o = PaymentMethodCreateInput(varPaymentMethodCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "default") + delete(additionalProperties, "name") + delete(additionalProperties, "nonce") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaymentMethodCreateInput struct { + value *PaymentMethodCreateInput + isSet bool +} + +func (v NullablePaymentMethodCreateInput) Get() *PaymentMethodCreateInput { + return v.value +} + +func (v *NullablePaymentMethodCreateInput) Set(val *PaymentMethodCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodCreateInput(val *PaymentMethodCreateInput) *NullablePaymentMethodCreateInput { + return &NullablePaymentMethodCreateInput{value: val, isSet: true} +} + +func (v NullablePaymentMethodCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_payment_method_list.go b/services/metalv1/model_payment_method_list.go new file mode 100644 index 00000000..76d4f390 --- /dev/null +++ b/services/metalv1/model_payment_method_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PaymentMethodList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaymentMethodList{} + +// PaymentMethodList struct for PaymentMethodList +type PaymentMethodList struct { + PaymentMethods []PaymentMethod `json:"payment_methods,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaymentMethodList PaymentMethodList + +// NewPaymentMethodList instantiates a new PaymentMethodList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodList() *PaymentMethodList { + this := PaymentMethodList{} + return &this +} + +// NewPaymentMethodListWithDefaults instantiates a new PaymentMethodList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodListWithDefaults() *PaymentMethodList { + this := PaymentMethodList{} + return &this +} + +// GetPaymentMethods returns the PaymentMethods field value if set, zero value otherwise. +func (o *PaymentMethodList) GetPaymentMethods() []PaymentMethod { + if o == nil || IsNil(o.PaymentMethods) { + var ret []PaymentMethod + return ret + } + return o.PaymentMethods +} + +// GetPaymentMethodsOk returns a tuple with the PaymentMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodList) GetPaymentMethodsOk() ([]PaymentMethod, bool) { + if o == nil || IsNil(o.PaymentMethods) { + return nil, false + } + return o.PaymentMethods, true +} + +// HasPaymentMethods returns a boolean if a field has been set. +func (o *PaymentMethodList) HasPaymentMethods() bool { + if o != nil && !IsNil(o.PaymentMethods) { + return true + } + + return false +} + +// SetPaymentMethods gets a reference to the given []PaymentMethod and assigns it to the PaymentMethods field. +func (o *PaymentMethodList) SetPaymentMethods(v []PaymentMethod) { + o.PaymentMethods = v +} + +func (o PaymentMethodList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PaymentMethods) { + toSerialize["payment_methods"] = o.PaymentMethods + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaymentMethodList) UnmarshalJSON(bytes []byte) (err error) { + varPaymentMethodList := _PaymentMethodList{} + + err = json.Unmarshal(bytes, &varPaymentMethodList) + + if err != nil { + return err + } + + *o = PaymentMethodList(varPaymentMethodList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "payment_methods") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaymentMethodList struct { + value *PaymentMethodList + isSet bool +} + +func (v NullablePaymentMethodList) Get() *PaymentMethodList { + return v.value +} + +func (v *NullablePaymentMethodList) Set(val *PaymentMethodList) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodList(val *PaymentMethodList) *NullablePaymentMethodList { + return &NullablePaymentMethodList{value: val, isSet: true} +} + +func (v NullablePaymentMethodList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_payment_method_update_input.go b/services/metalv1/model_payment_method_update_input.go new file mode 100644 index 00000000..729c8a7e --- /dev/null +++ b/services/metalv1/model_payment_method_update_input.go @@ -0,0 +1,339 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PaymentMethodUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaymentMethodUpdateInput{} + +// PaymentMethodUpdateInput struct for PaymentMethodUpdateInput +type PaymentMethodUpdateInput struct { + BillingAddress map[string]interface{} `json:"billing_address,omitempty"` + CardholderName *string `json:"cardholder_name,omitempty"` + Default *bool `json:"default,omitempty"` + ExpirationMonth *string `json:"expiration_month,omitempty"` + ExpirationYear *int32 `json:"expiration_year,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PaymentMethodUpdateInput PaymentMethodUpdateInput + +// NewPaymentMethodUpdateInput instantiates a new PaymentMethodUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodUpdateInput() *PaymentMethodUpdateInput { + this := PaymentMethodUpdateInput{} + return &this +} + +// NewPaymentMethodUpdateInputWithDefaults instantiates a new PaymentMethodUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodUpdateInputWithDefaults() *PaymentMethodUpdateInput { + this := PaymentMethodUpdateInput{} + return &this +} + +// GetBillingAddress returns the BillingAddress field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetBillingAddress() map[string]interface{} { + if o == nil || IsNil(o.BillingAddress) { + var ret map[string]interface{} + return ret + } + return o.BillingAddress +} + +// GetBillingAddressOk returns a tuple with the BillingAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetBillingAddressOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.BillingAddress) { + return map[string]interface{}{}, false + } + return o.BillingAddress, true +} + +// HasBillingAddress returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasBillingAddress() bool { + if o != nil && !IsNil(o.BillingAddress) { + return true + } + + return false +} + +// SetBillingAddress gets a reference to the given map[string]interface{} and assigns it to the BillingAddress field. +func (o *PaymentMethodUpdateInput) SetBillingAddress(v map[string]interface{}) { + o.BillingAddress = v +} + +// GetCardholderName returns the CardholderName field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetCardholderName() string { + if o == nil || IsNil(o.CardholderName) { + var ret string + return ret + } + return *o.CardholderName +} + +// GetCardholderNameOk returns a tuple with the CardholderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetCardholderNameOk() (*string, bool) { + if o == nil || IsNil(o.CardholderName) { + return nil, false + } + return o.CardholderName, true +} + +// HasCardholderName returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasCardholderName() bool { + if o != nil && !IsNil(o.CardholderName) { + return true + } + + return false +} + +// SetCardholderName gets a reference to the given string and assigns it to the CardholderName field. +func (o *PaymentMethodUpdateInput) SetCardholderName(v string) { + o.CardholderName = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *PaymentMethodUpdateInput) SetDefault(v bool) { + o.Default = &v +} + +// GetExpirationMonth returns the ExpirationMonth field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetExpirationMonth() string { + if o == nil || IsNil(o.ExpirationMonth) { + var ret string + return ret + } + return *o.ExpirationMonth +} + +// GetExpirationMonthOk returns a tuple with the ExpirationMonth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetExpirationMonthOk() (*string, bool) { + if o == nil || IsNil(o.ExpirationMonth) { + return nil, false + } + return o.ExpirationMonth, true +} + +// HasExpirationMonth returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasExpirationMonth() bool { + if o != nil && !IsNil(o.ExpirationMonth) { + return true + } + + return false +} + +// SetExpirationMonth gets a reference to the given string and assigns it to the ExpirationMonth field. +func (o *PaymentMethodUpdateInput) SetExpirationMonth(v string) { + o.ExpirationMonth = &v +} + +// GetExpirationYear returns the ExpirationYear field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetExpirationYear() int32 { + if o == nil || IsNil(o.ExpirationYear) { + var ret int32 + return ret + } + return *o.ExpirationYear +} + +// GetExpirationYearOk returns a tuple with the ExpirationYear field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetExpirationYearOk() (*int32, bool) { + if o == nil || IsNil(o.ExpirationYear) { + return nil, false + } + return o.ExpirationYear, true +} + +// HasExpirationYear returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasExpirationYear() bool { + if o != nil && !IsNil(o.ExpirationYear) { + return true + } + + return false +} + +// SetExpirationYear gets a reference to the given int32 and assigns it to the ExpirationYear field. +func (o *PaymentMethodUpdateInput) SetExpirationYear(v int32) { + o.ExpirationYear = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PaymentMethodUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PaymentMethodUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PaymentMethodUpdateInput) SetName(v string) { + o.Name = &v +} + +func (o PaymentMethodUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BillingAddress) { + toSerialize["billing_address"] = o.BillingAddress + } + if !IsNil(o.CardholderName) { + toSerialize["cardholder_name"] = o.CardholderName + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.ExpirationMonth) { + toSerialize["expiration_month"] = o.ExpirationMonth + } + if !IsNil(o.ExpirationYear) { + toSerialize["expiration_year"] = o.ExpirationYear + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaymentMethodUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varPaymentMethodUpdateInput := _PaymentMethodUpdateInput{} + + err = json.Unmarshal(bytes, &varPaymentMethodUpdateInput) + + if err != nil { + return err + } + + *o = PaymentMethodUpdateInput(varPaymentMethodUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "billing_address") + delete(additionalProperties, "cardholder_name") + delete(additionalProperties, "default") + delete(additionalProperties, "expiration_month") + delete(additionalProperties, "expiration_year") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaymentMethodUpdateInput struct { + value *PaymentMethodUpdateInput + isSet bool +} + +func (v NullablePaymentMethodUpdateInput) Get() *PaymentMethodUpdateInput { + return v.value +} + +func (v *NullablePaymentMethodUpdateInput) Set(val *PaymentMethodUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodUpdateInput(val *PaymentMethodUpdateInput) *NullablePaymentMethodUpdateInput { + return &NullablePaymentMethodUpdateInput{value: val, isSet: true} +} + +func (v NullablePaymentMethodUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan.go b/services/metalv1/model_plan.go new file mode 100644 index 00000000..4ba399b3 --- /dev/null +++ b/services/metalv1/model_plan.go @@ -0,0 +1,639 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Plan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Plan{} + +// Plan struct for Plan +type Plan struct { + // Shows which facilities the plan is available in, and the facility-based price if it is different from the default price. + AvailableIn []PlanAvailableInInner `json:"available_in,omitempty"` + // Shows which metros the plan is available in, and the metro-based price if it is different from the default price. + AvailableInMetros []PlanAvailableInMetrosInner `json:"available_in_metros,omitempty"` + // Categories of the plan, like compute or storage. A Plan can belong to multiple categories. + Categories []string `json:"categories,omitempty"` + Class *string `json:"class,omitempty"` + Description *string `json:"description,omitempty"` + DeploymentTypes []PlanDeploymentTypesInner `json:"deployment_types,omitempty"` + Id *string `json:"id,omitempty"` + // Deprecated. Always return false + Legacy *bool `json:"legacy,omitempty"` + Line *string `json:"line,omitempty"` + Name *string `json:"name,omitempty"` + Pricing map[string]interface{} `json:"pricing,omitempty"` + Slug *string `json:"slug,omitempty"` + Specs *PlanSpecs `json:"specs,omitempty"` + Type *PlanType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Plan Plan + +// NewPlan instantiates a new Plan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlan() *Plan { + this := Plan{} + return &this +} + +// NewPlanWithDefaults instantiates a new Plan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanWithDefaults() *Plan { + this := Plan{} + return &this +} + +// GetAvailableIn returns the AvailableIn field value if set, zero value otherwise. +func (o *Plan) GetAvailableIn() []PlanAvailableInInner { + if o == nil || IsNil(o.AvailableIn) { + var ret []PlanAvailableInInner + return ret + } + return o.AvailableIn +} + +// GetAvailableInOk returns a tuple with the AvailableIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetAvailableInOk() ([]PlanAvailableInInner, bool) { + if o == nil || IsNil(o.AvailableIn) { + return nil, false + } + return o.AvailableIn, true +} + +// HasAvailableIn returns a boolean if a field has been set. +func (o *Plan) HasAvailableIn() bool { + if o != nil && !IsNil(o.AvailableIn) { + return true + } + + return false +} + +// SetAvailableIn gets a reference to the given []PlanAvailableInInner and assigns it to the AvailableIn field. +func (o *Plan) SetAvailableIn(v []PlanAvailableInInner) { + o.AvailableIn = v +} + +// GetAvailableInMetros returns the AvailableInMetros field value if set, zero value otherwise. +func (o *Plan) GetAvailableInMetros() []PlanAvailableInMetrosInner { + if o == nil || IsNil(o.AvailableInMetros) { + var ret []PlanAvailableInMetrosInner + return ret + } + return o.AvailableInMetros +} + +// GetAvailableInMetrosOk returns a tuple with the AvailableInMetros field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetAvailableInMetrosOk() ([]PlanAvailableInMetrosInner, bool) { + if o == nil || IsNil(o.AvailableInMetros) { + return nil, false + } + return o.AvailableInMetros, true +} + +// HasAvailableInMetros returns a boolean if a field has been set. +func (o *Plan) HasAvailableInMetros() bool { + if o != nil && !IsNil(o.AvailableInMetros) { + return true + } + + return false +} + +// SetAvailableInMetros gets a reference to the given []PlanAvailableInMetrosInner and assigns it to the AvailableInMetros field. +func (o *Plan) SetAvailableInMetros(v []PlanAvailableInMetrosInner) { + o.AvailableInMetros = v +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *Plan) GetCategories() []string { + if o == nil || IsNil(o.Categories) { + var ret []string + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *Plan) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []string and assigns it to the Categories field. +func (o *Plan) SetCategories(v []string) { + o.Categories = v +} + +// GetClass returns the Class field value if set, zero value otherwise. +func (o *Plan) GetClass() string { + if o == nil || IsNil(o.Class) { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetClassOk() (*string, bool) { + if o == nil || IsNil(o.Class) { + return nil, false + } + return o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Plan) HasClass() bool { + if o != nil && !IsNil(o.Class) { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Plan) SetClass(v string) { + o.Class = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Plan) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Plan) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Plan) SetDescription(v string) { + o.Description = &v +} + +// GetDeploymentTypes returns the DeploymentTypes field value if set, zero value otherwise. +func (o *Plan) GetDeploymentTypes() []PlanDeploymentTypesInner { + if o == nil || IsNil(o.DeploymentTypes) { + var ret []PlanDeploymentTypesInner + return ret + } + return o.DeploymentTypes +} + +// GetDeploymentTypesOk returns a tuple with the DeploymentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetDeploymentTypesOk() ([]PlanDeploymentTypesInner, bool) { + if o == nil || IsNil(o.DeploymentTypes) { + return nil, false + } + return o.DeploymentTypes, true +} + +// HasDeploymentTypes returns a boolean if a field has been set. +func (o *Plan) HasDeploymentTypes() bool { + if o != nil && !IsNil(o.DeploymentTypes) { + return true + } + + return false +} + +// SetDeploymentTypes gets a reference to the given []PlanDeploymentTypesInner and assigns it to the DeploymentTypes field. +func (o *Plan) SetDeploymentTypes(v []PlanDeploymentTypesInner) { + o.DeploymentTypes = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Plan) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Plan) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Plan) SetId(v string) { + o.Id = &v +} + +// GetLegacy returns the Legacy field value if set, zero value otherwise. +func (o *Plan) GetLegacy() bool { + if o == nil || IsNil(o.Legacy) { + var ret bool + return ret + } + return *o.Legacy +} + +// GetLegacyOk returns a tuple with the Legacy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetLegacyOk() (*bool, bool) { + if o == nil || IsNil(o.Legacy) { + return nil, false + } + return o.Legacy, true +} + +// HasLegacy returns a boolean if a field has been set. +func (o *Plan) HasLegacy() bool { + if o != nil && !IsNil(o.Legacy) { + return true + } + + return false +} + +// SetLegacy gets a reference to the given bool and assigns it to the Legacy field. +func (o *Plan) SetLegacy(v bool) { + o.Legacy = &v +} + +// GetLine returns the Line field value if set, zero value otherwise. +func (o *Plan) GetLine() string { + if o == nil || IsNil(o.Line) { + var ret string + return ret + } + return *o.Line +} + +// GetLineOk returns a tuple with the Line field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetLineOk() (*string, bool) { + if o == nil || IsNil(o.Line) { + return nil, false + } + return o.Line, true +} + +// HasLine returns a boolean if a field has been set. +func (o *Plan) HasLine() bool { + if o != nil && !IsNil(o.Line) { + return true + } + + return false +} + +// SetLine gets a reference to the given string and assigns it to the Line field. +func (o *Plan) SetLine(v string) { + o.Line = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Plan) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Plan) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Plan) SetName(v string) { + o.Name = &v +} + +// GetPricing returns the Pricing field value if set, zero value otherwise. +func (o *Plan) GetPricing() map[string]interface{} { + if o == nil || IsNil(o.Pricing) { + var ret map[string]interface{} + return ret + } + return o.Pricing +} + +// GetPricingOk returns a tuple with the Pricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetPricingOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Pricing) { + return map[string]interface{}{}, false + } + return o.Pricing, true +} + +// HasPricing returns a boolean if a field has been set. +func (o *Plan) HasPricing() bool { + if o != nil && !IsNil(o.Pricing) { + return true + } + + return false +} + +// SetPricing gets a reference to the given map[string]interface{} and assigns it to the Pricing field. +func (o *Plan) SetPricing(v map[string]interface{}) { + o.Pricing = v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *Plan) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *Plan) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *Plan) SetSlug(v string) { + o.Slug = &v +} + +// GetSpecs returns the Specs field value if set, zero value otherwise. +func (o *Plan) GetSpecs() PlanSpecs { + if o == nil || IsNil(o.Specs) { + var ret PlanSpecs + return ret + } + return *o.Specs +} + +// GetSpecsOk returns a tuple with the Specs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetSpecsOk() (*PlanSpecs, bool) { + if o == nil || IsNil(o.Specs) { + return nil, false + } + return o.Specs, true +} + +// HasSpecs returns a boolean if a field has been set. +func (o *Plan) HasSpecs() bool { + if o != nil && !IsNil(o.Specs) { + return true + } + + return false +} + +// SetSpecs gets a reference to the given PlanSpecs and assigns it to the Specs field. +func (o *Plan) SetSpecs(v PlanSpecs) { + o.Specs = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Plan) GetType() PlanType { + if o == nil || IsNil(o.Type) { + var ret PlanType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Plan) GetTypeOk() (*PlanType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Plan) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PlanType and assigns it to the Type field. +func (o *Plan) SetType(v PlanType) { + o.Type = &v +} + +func (o Plan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Plan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailableIn) { + toSerialize["available_in"] = o.AvailableIn + } + if !IsNil(o.AvailableInMetros) { + toSerialize["available_in_metros"] = o.AvailableInMetros + } + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + if !IsNil(o.Class) { + toSerialize["class"] = o.Class + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DeploymentTypes) { + toSerialize["deployment_types"] = o.DeploymentTypes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Legacy) { + toSerialize["legacy"] = o.Legacy + } + if !IsNil(o.Line) { + toSerialize["line"] = o.Line + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Pricing) { + toSerialize["pricing"] = o.Pricing + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Specs) { + toSerialize["specs"] = o.Specs + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Plan) UnmarshalJSON(bytes []byte) (err error) { + varPlan := _Plan{} + + err = json.Unmarshal(bytes, &varPlan) + + if err != nil { + return err + } + + *o = Plan(varPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "available_in") + delete(additionalProperties, "available_in_metros") + delete(additionalProperties, "categories") + delete(additionalProperties, "class") + delete(additionalProperties, "description") + delete(additionalProperties, "deployment_types") + delete(additionalProperties, "id") + delete(additionalProperties, "legacy") + delete(additionalProperties, "line") + delete(additionalProperties, "name") + delete(additionalProperties, "pricing") + delete(additionalProperties, "slug") + delete(additionalProperties, "specs") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlan struct { + value *Plan + isSet bool +} + +func (v NullablePlan) Get() *Plan { + return v.value +} + +func (v *NullablePlan) Set(val *Plan) { + v.value = val + v.isSet = true +} + +func (v NullablePlan) IsSet() bool { + return v.isSet +} + +func (v *NullablePlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlan(val *Plan) *NullablePlan { + return &NullablePlan{value: val, isSet: true} +} + +func (v NullablePlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_available_in_inner.go b/services/metalv1/model_plan_available_in_inner.go new file mode 100644 index 00000000..bcfda23d --- /dev/null +++ b/services/metalv1/model_plan_available_in_inner.go @@ -0,0 +1,192 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanAvailableInInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanAvailableInInner{} + +// PlanAvailableInInner struct for PlanAvailableInInner +type PlanAvailableInInner struct { + // href to the Facility + Href *string `json:"href,omitempty"` + Price *PlanAvailableInInnerPrice `json:"price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanAvailableInInner PlanAvailableInInner + +// NewPlanAvailableInInner instantiates a new PlanAvailableInInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanAvailableInInner() *PlanAvailableInInner { + this := PlanAvailableInInner{} + return &this +} + +// NewPlanAvailableInInnerWithDefaults instantiates a new PlanAvailableInInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanAvailableInInnerWithDefaults() *PlanAvailableInInner { + this := PlanAvailableInInner{} + return &this +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PlanAvailableInInner) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanAvailableInInner) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PlanAvailableInInner) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PlanAvailableInInner) SetHref(v string) { + o.Href = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *PlanAvailableInInner) GetPrice() PlanAvailableInInnerPrice { + if o == nil || IsNil(o.Price) { + var ret PlanAvailableInInnerPrice + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanAvailableInInner) GetPriceOk() (*PlanAvailableInInnerPrice, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *PlanAvailableInInner) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given PlanAvailableInInnerPrice and assigns it to the Price field. +func (o *PlanAvailableInInner) SetPrice(v PlanAvailableInInnerPrice) { + o.Price = &v +} + +func (o PlanAvailableInInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanAvailableInInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanAvailableInInner) UnmarshalJSON(bytes []byte) (err error) { + varPlanAvailableInInner := _PlanAvailableInInner{} + + err = json.Unmarshal(bytes, &varPlanAvailableInInner) + + if err != nil { + return err + } + + *o = PlanAvailableInInner(varPlanAvailableInInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "href") + delete(additionalProperties, "price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanAvailableInInner struct { + value *PlanAvailableInInner + isSet bool +} + +func (v NullablePlanAvailableInInner) Get() *PlanAvailableInInner { + return v.value +} + +func (v *NullablePlanAvailableInInner) Set(val *PlanAvailableInInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanAvailableInInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanAvailableInInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanAvailableInInner(val *PlanAvailableInInner) *NullablePlanAvailableInInner { + return &NullablePlanAvailableInInner{value: val, isSet: true} +} + +func (v NullablePlanAvailableInInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanAvailableInInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_available_in_inner_price.go b/services/metalv1/model_plan_available_in_inner_price.go new file mode 100644 index 00000000..d1d55e08 --- /dev/null +++ b/services/metalv1/model_plan_available_in_inner_price.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanAvailableInInnerPrice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanAvailableInInnerPrice{} + +// PlanAvailableInInnerPrice struct for PlanAvailableInInnerPrice +type PlanAvailableInInnerPrice struct { + Hour *float64 `json:"hour,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanAvailableInInnerPrice PlanAvailableInInnerPrice + +// NewPlanAvailableInInnerPrice instantiates a new PlanAvailableInInnerPrice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanAvailableInInnerPrice() *PlanAvailableInInnerPrice { + this := PlanAvailableInInnerPrice{} + return &this +} + +// NewPlanAvailableInInnerPriceWithDefaults instantiates a new PlanAvailableInInnerPrice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanAvailableInInnerPriceWithDefaults() *PlanAvailableInInnerPrice { + this := PlanAvailableInInnerPrice{} + return &this +} + +// GetHour returns the Hour field value if set, zero value otherwise. +func (o *PlanAvailableInInnerPrice) GetHour() float64 { + if o == nil || IsNil(o.Hour) { + var ret float64 + return ret + } + return *o.Hour +} + +// GetHourOk returns a tuple with the Hour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanAvailableInInnerPrice) GetHourOk() (*float64, bool) { + if o == nil || IsNil(o.Hour) { + return nil, false + } + return o.Hour, true +} + +// HasHour returns a boolean if a field has been set. +func (o *PlanAvailableInInnerPrice) HasHour() bool { + if o != nil && !IsNil(o.Hour) { + return true + } + + return false +} + +// SetHour gets a reference to the given float64 and assigns it to the Hour field. +func (o *PlanAvailableInInnerPrice) SetHour(v float64) { + o.Hour = &v +} + +func (o PlanAvailableInInnerPrice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanAvailableInInnerPrice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hour) { + toSerialize["hour"] = o.Hour + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanAvailableInInnerPrice) UnmarshalJSON(bytes []byte) (err error) { + varPlanAvailableInInnerPrice := _PlanAvailableInInnerPrice{} + + err = json.Unmarshal(bytes, &varPlanAvailableInInnerPrice) + + if err != nil { + return err + } + + *o = PlanAvailableInInnerPrice(varPlanAvailableInInnerPrice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "hour") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanAvailableInInnerPrice struct { + value *PlanAvailableInInnerPrice + isSet bool +} + +func (v NullablePlanAvailableInInnerPrice) Get() *PlanAvailableInInnerPrice { + return v.value +} + +func (v *NullablePlanAvailableInInnerPrice) Set(val *PlanAvailableInInnerPrice) { + v.value = val + v.isSet = true +} + +func (v NullablePlanAvailableInInnerPrice) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanAvailableInInnerPrice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanAvailableInInnerPrice(val *PlanAvailableInInnerPrice) *NullablePlanAvailableInInnerPrice { + return &NullablePlanAvailableInInnerPrice{value: val, isSet: true} +} + +func (v NullablePlanAvailableInInnerPrice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanAvailableInInnerPrice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_available_in_metros_inner.go b/services/metalv1/model_plan_available_in_metros_inner.go new file mode 100644 index 00000000..f8894d66 --- /dev/null +++ b/services/metalv1/model_plan_available_in_metros_inner.go @@ -0,0 +1,192 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanAvailableInMetrosInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanAvailableInMetrosInner{} + +// PlanAvailableInMetrosInner struct for PlanAvailableInMetrosInner +type PlanAvailableInMetrosInner struct { + // href to the Metro + Href *string `json:"href,omitempty"` + Price *PlanAvailableInInnerPrice `json:"price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanAvailableInMetrosInner PlanAvailableInMetrosInner + +// NewPlanAvailableInMetrosInner instantiates a new PlanAvailableInMetrosInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanAvailableInMetrosInner() *PlanAvailableInMetrosInner { + this := PlanAvailableInMetrosInner{} + return &this +} + +// NewPlanAvailableInMetrosInnerWithDefaults instantiates a new PlanAvailableInMetrosInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanAvailableInMetrosInnerWithDefaults() *PlanAvailableInMetrosInner { + this := PlanAvailableInMetrosInner{} + return &this +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *PlanAvailableInMetrosInner) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanAvailableInMetrosInner) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *PlanAvailableInMetrosInner) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *PlanAvailableInMetrosInner) SetHref(v string) { + o.Href = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *PlanAvailableInMetrosInner) GetPrice() PlanAvailableInInnerPrice { + if o == nil || IsNil(o.Price) { + var ret PlanAvailableInInnerPrice + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanAvailableInMetrosInner) GetPriceOk() (*PlanAvailableInInnerPrice, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *PlanAvailableInMetrosInner) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given PlanAvailableInInnerPrice and assigns it to the Price field. +func (o *PlanAvailableInMetrosInner) SetPrice(v PlanAvailableInInnerPrice) { + o.Price = &v +} + +func (o PlanAvailableInMetrosInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanAvailableInMetrosInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanAvailableInMetrosInner) UnmarshalJSON(bytes []byte) (err error) { + varPlanAvailableInMetrosInner := _PlanAvailableInMetrosInner{} + + err = json.Unmarshal(bytes, &varPlanAvailableInMetrosInner) + + if err != nil { + return err + } + + *o = PlanAvailableInMetrosInner(varPlanAvailableInMetrosInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "href") + delete(additionalProperties, "price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanAvailableInMetrosInner struct { + value *PlanAvailableInMetrosInner + isSet bool +} + +func (v NullablePlanAvailableInMetrosInner) Get() *PlanAvailableInMetrosInner { + return v.value +} + +func (v *NullablePlanAvailableInMetrosInner) Set(val *PlanAvailableInMetrosInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanAvailableInMetrosInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanAvailableInMetrosInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanAvailableInMetrosInner(val *PlanAvailableInMetrosInner) *NullablePlanAvailableInMetrosInner { + return &NullablePlanAvailableInMetrosInner{value: val, isSet: true} +} + +func (v NullablePlanAvailableInMetrosInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanAvailableInMetrosInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_deployment_types_inner.go b/services/metalv1/model_plan_deployment_types_inner.go new file mode 100644 index 00000000..22cdf3b6 --- /dev/null +++ b/services/metalv1/model_plan_deployment_types_inner.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PlanDeploymentTypesInner the model 'PlanDeploymentTypesInner' +type PlanDeploymentTypesInner string + +// List of Plan_deployment_types_inner +const ( + PLANDEPLOYMENTTYPESINNER_ON_DEMAND PlanDeploymentTypesInner = "on_demand" + PLANDEPLOYMENTTYPESINNER_SPOT_MARKET PlanDeploymentTypesInner = "spot_market" +) + +// All allowed values of PlanDeploymentTypesInner enum +var AllowedPlanDeploymentTypesInnerEnumValues = []PlanDeploymentTypesInner{ + "on_demand", + "spot_market", +} + +func (v *PlanDeploymentTypesInner) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PlanDeploymentTypesInner(value) + for _, existing := range AllowedPlanDeploymentTypesInnerEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PlanDeploymentTypesInner", value) +} + +// NewPlanDeploymentTypesInnerFromValue returns a pointer to a valid PlanDeploymentTypesInner +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPlanDeploymentTypesInnerFromValue(v string) (*PlanDeploymentTypesInner, error) { + ev := PlanDeploymentTypesInner(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PlanDeploymentTypesInner: valid values are %v", v, AllowedPlanDeploymentTypesInnerEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PlanDeploymentTypesInner) IsValid() bool { + for _, existing := range AllowedPlanDeploymentTypesInnerEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Plan_deployment_types_inner value +func (v PlanDeploymentTypesInner) Ptr() *PlanDeploymentTypesInner { + return &v +} + +type NullablePlanDeploymentTypesInner struct { + value *PlanDeploymentTypesInner + isSet bool +} + +func (v NullablePlanDeploymentTypesInner) Get() *PlanDeploymentTypesInner { + return v.value +} + +func (v *NullablePlanDeploymentTypesInner) Set(val *PlanDeploymentTypesInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanDeploymentTypesInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanDeploymentTypesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanDeploymentTypesInner(val *PlanDeploymentTypesInner) *NullablePlanDeploymentTypesInner { + return &NullablePlanDeploymentTypesInner{value: val, isSet: true} +} + +func (v NullablePlanDeploymentTypesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanDeploymentTypesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_list.go b/services/metalv1/model_plan_list.go new file mode 100644 index 00000000..440782ed --- /dev/null +++ b/services/metalv1/model_plan_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanList{} + +// PlanList struct for PlanList +type PlanList struct { + Plans []Plan `json:"plans,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanList PlanList + +// NewPlanList instantiates a new PlanList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanList() *PlanList { + this := PlanList{} + return &this +} + +// NewPlanListWithDefaults instantiates a new PlanList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanListWithDefaults() *PlanList { + this := PlanList{} + return &this +} + +// GetPlans returns the Plans field value if set, zero value otherwise. +func (o *PlanList) GetPlans() []Plan { + if o == nil || IsNil(o.Plans) { + var ret []Plan + return ret + } + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanList) GetPlansOk() ([]Plan, bool) { + if o == nil || IsNil(o.Plans) { + return nil, false + } + return o.Plans, true +} + +// HasPlans returns a boolean if a field has been set. +func (o *PlanList) HasPlans() bool { + if o != nil && !IsNil(o.Plans) { + return true + } + + return false +} + +// SetPlans gets a reference to the given []Plan and assigns it to the Plans field. +func (o *PlanList) SetPlans(v []Plan) { + o.Plans = v +} + +func (o PlanList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Plans) { + toSerialize["plans"] = o.Plans + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanList) UnmarshalJSON(bytes []byte) (err error) { + varPlanList := _PlanList{} + + err = json.Unmarshal(bytes, &varPlanList) + + if err != nil { + return err + } + + *o = PlanList(varPlanList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "plans") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanList struct { + value *PlanList + isSet bool +} + +func (v NullablePlanList) Get() *PlanList { + return v.value +} + +func (v *NullablePlanList) Set(val *PlanList) { + v.value = val + v.isSet = true +} + +func (v NullablePlanList) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanList(val *PlanList) *NullablePlanList { + return &NullablePlanList{value: val, isSet: true} +} + +func (v NullablePlanList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs.go b/services/metalv1/model_plan_specs.go new file mode 100644 index 00000000..7e1ff06b --- /dev/null +++ b/services/metalv1/model_plan_specs.go @@ -0,0 +1,302 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecs{} + +// PlanSpecs struct for PlanSpecs +type PlanSpecs struct { + Cpus []PlanSpecsCpusInner `json:"cpus,omitempty"` + Memory *PlanSpecsMemory `json:"memory,omitempty"` + Drives []PlanSpecsDrivesInner `json:"drives,omitempty"` + Nics []PlanSpecsNicsInner `json:"nics,omitempty"` + Features *PlanSpecsFeatures `json:"features,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecs PlanSpecs + +// NewPlanSpecs instantiates a new PlanSpecs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecs() *PlanSpecs { + this := PlanSpecs{} + return &this +} + +// NewPlanSpecsWithDefaults instantiates a new PlanSpecs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsWithDefaults() *PlanSpecs { + this := PlanSpecs{} + return &this +} + +// GetCpus returns the Cpus field value if set, zero value otherwise. +func (o *PlanSpecs) GetCpus() []PlanSpecsCpusInner { + if o == nil || IsNil(o.Cpus) { + var ret []PlanSpecsCpusInner + return ret + } + return o.Cpus +} + +// GetCpusOk returns a tuple with the Cpus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecs) GetCpusOk() ([]PlanSpecsCpusInner, bool) { + if o == nil || IsNil(o.Cpus) { + return nil, false + } + return o.Cpus, true +} + +// HasCpus returns a boolean if a field has been set. +func (o *PlanSpecs) HasCpus() bool { + if o != nil && !IsNil(o.Cpus) { + return true + } + + return false +} + +// SetCpus gets a reference to the given []PlanSpecsCpusInner and assigns it to the Cpus field. +func (o *PlanSpecs) SetCpus(v []PlanSpecsCpusInner) { + o.Cpus = v +} + +// GetMemory returns the Memory field value if set, zero value otherwise. +func (o *PlanSpecs) GetMemory() PlanSpecsMemory { + if o == nil || IsNil(o.Memory) { + var ret PlanSpecsMemory + return ret + } + return *o.Memory +} + +// GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecs) GetMemoryOk() (*PlanSpecsMemory, bool) { + if o == nil || IsNil(o.Memory) { + return nil, false + } + return o.Memory, true +} + +// HasMemory returns a boolean if a field has been set. +func (o *PlanSpecs) HasMemory() bool { + if o != nil && !IsNil(o.Memory) { + return true + } + + return false +} + +// SetMemory gets a reference to the given PlanSpecsMemory and assigns it to the Memory field. +func (o *PlanSpecs) SetMemory(v PlanSpecsMemory) { + o.Memory = &v +} + +// GetDrives returns the Drives field value if set, zero value otherwise. +func (o *PlanSpecs) GetDrives() []PlanSpecsDrivesInner { + if o == nil || IsNil(o.Drives) { + var ret []PlanSpecsDrivesInner + return ret + } + return o.Drives +} + +// GetDrivesOk returns a tuple with the Drives field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecs) GetDrivesOk() ([]PlanSpecsDrivesInner, bool) { + if o == nil || IsNil(o.Drives) { + return nil, false + } + return o.Drives, true +} + +// HasDrives returns a boolean if a field has been set. +func (o *PlanSpecs) HasDrives() bool { + if o != nil && !IsNil(o.Drives) { + return true + } + + return false +} + +// SetDrives gets a reference to the given []PlanSpecsDrivesInner and assigns it to the Drives field. +func (o *PlanSpecs) SetDrives(v []PlanSpecsDrivesInner) { + o.Drives = v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *PlanSpecs) GetNics() []PlanSpecsNicsInner { + if o == nil || IsNil(o.Nics) { + var ret []PlanSpecsNicsInner + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecs) GetNicsOk() ([]PlanSpecsNicsInner, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *PlanSpecs) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []PlanSpecsNicsInner and assigns it to the Nics field. +func (o *PlanSpecs) SetNics(v []PlanSpecsNicsInner) { + o.Nics = v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *PlanSpecs) GetFeatures() PlanSpecsFeatures { + if o == nil || IsNil(o.Features) { + var ret PlanSpecsFeatures + return ret + } + return *o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecs) GetFeaturesOk() (*PlanSpecsFeatures, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *PlanSpecs) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given PlanSpecsFeatures and assigns it to the Features field. +func (o *PlanSpecs) SetFeatures(v PlanSpecsFeatures) { + o.Features = &v +} + +func (o PlanSpecs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Cpus) { + toSerialize["cpus"] = o.Cpus + } + if !IsNil(o.Memory) { + toSerialize["memory"] = o.Memory + } + if !IsNil(o.Drives) { + toSerialize["drives"] = o.Drives + } + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecs) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecs := _PlanSpecs{} + + err = json.Unmarshal(bytes, &varPlanSpecs) + + if err != nil { + return err + } + + *o = PlanSpecs(varPlanSpecs) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cpus") + delete(additionalProperties, "memory") + delete(additionalProperties, "drives") + delete(additionalProperties, "nics") + delete(additionalProperties, "features") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecs struct { + value *PlanSpecs + isSet bool +} + +func (v NullablePlanSpecs) Get() *PlanSpecs { + return v.value +} + +func (v *NullablePlanSpecs) Set(val *PlanSpecs) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecs) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecs(val *PlanSpecs) *NullablePlanSpecs { + return &NullablePlanSpecs{value: val, isSet: true} +} + +func (v NullablePlanSpecs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_cpus_inner.go b/services/metalv1/model_plan_specs_cpus_inner.go new file mode 100644 index 00000000..2cd0b163 --- /dev/null +++ b/services/metalv1/model_plan_specs_cpus_inner.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecsCpusInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecsCpusInner{} + +// PlanSpecsCpusInner struct for PlanSpecsCpusInner +type PlanSpecsCpusInner struct { + Count *int32 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecsCpusInner PlanSpecsCpusInner + +// NewPlanSpecsCpusInner instantiates a new PlanSpecsCpusInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecsCpusInner() *PlanSpecsCpusInner { + this := PlanSpecsCpusInner{} + return &this +} + +// NewPlanSpecsCpusInnerWithDefaults instantiates a new PlanSpecsCpusInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsCpusInnerWithDefaults() *PlanSpecsCpusInner { + this := PlanSpecsCpusInner{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PlanSpecsCpusInner) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsCpusInner) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PlanSpecsCpusInner) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PlanSpecsCpusInner) SetCount(v int32) { + o.Count = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PlanSpecsCpusInner) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsCpusInner) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PlanSpecsCpusInner) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PlanSpecsCpusInner) SetType(v string) { + o.Type = &v +} + +func (o PlanSpecsCpusInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecsCpusInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecsCpusInner) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecsCpusInner := _PlanSpecsCpusInner{} + + err = json.Unmarshal(bytes, &varPlanSpecsCpusInner) + + if err != nil { + return err + } + + *o = PlanSpecsCpusInner(varPlanSpecsCpusInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecsCpusInner struct { + value *PlanSpecsCpusInner + isSet bool +} + +func (v NullablePlanSpecsCpusInner) Get() *PlanSpecsCpusInner { + return v.value +} + +func (v *NullablePlanSpecsCpusInner) Set(val *PlanSpecsCpusInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsCpusInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsCpusInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsCpusInner(val *PlanSpecsCpusInner) *NullablePlanSpecsCpusInner { + return &NullablePlanSpecsCpusInner{value: val, isSet: true} +} + +func (v NullablePlanSpecsCpusInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsCpusInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_drives_inner.go b/services/metalv1/model_plan_specs_drives_inner.go new file mode 100644 index 00000000..213f4911 --- /dev/null +++ b/services/metalv1/model_plan_specs_drives_inner.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecsDrivesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecsDrivesInner{} + +// PlanSpecsDrivesInner struct for PlanSpecsDrivesInner +type PlanSpecsDrivesInner struct { + Count *int32 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + Size *string `json:"size,omitempty"` + Category *PlanSpecsDrivesInnerCategory `json:"category,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecsDrivesInner PlanSpecsDrivesInner + +// NewPlanSpecsDrivesInner instantiates a new PlanSpecsDrivesInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecsDrivesInner() *PlanSpecsDrivesInner { + this := PlanSpecsDrivesInner{} + return &this +} + +// NewPlanSpecsDrivesInnerWithDefaults instantiates a new PlanSpecsDrivesInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsDrivesInnerWithDefaults() *PlanSpecsDrivesInner { + this := PlanSpecsDrivesInner{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PlanSpecsDrivesInner) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsDrivesInner) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PlanSpecsDrivesInner) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PlanSpecsDrivesInner) SetCount(v int32) { + o.Count = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PlanSpecsDrivesInner) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsDrivesInner) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PlanSpecsDrivesInner) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PlanSpecsDrivesInner) SetType(v string) { + o.Type = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *PlanSpecsDrivesInner) GetSize() string { + if o == nil || IsNil(o.Size) { + var ret string + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsDrivesInner) GetSizeOk() (*string, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *PlanSpecsDrivesInner) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given string and assigns it to the Size field. +func (o *PlanSpecsDrivesInner) SetSize(v string) { + o.Size = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *PlanSpecsDrivesInner) GetCategory() PlanSpecsDrivesInnerCategory { + if o == nil || IsNil(o.Category) { + var ret PlanSpecsDrivesInnerCategory + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsDrivesInner) GetCategoryOk() (*PlanSpecsDrivesInnerCategory, bool) { + if o == nil || IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *PlanSpecsDrivesInner) HasCategory() bool { + if o != nil && !IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given PlanSpecsDrivesInnerCategory and assigns it to the Category field. +func (o *PlanSpecsDrivesInner) SetCategory(v PlanSpecsDrivesInnerCategory) { + o.Category = &v +} + +func (o PlanSpecsDrivesInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecsDrivesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Category) { + toSerialize["category"] = o.Category + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecsDrivesInner) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecsDrivesInner := _PlanSpecsDrivesInner{} + + err = json.Unmarshal(bytes, &varPlanSpecsDrivesInner) + + if err != nil { + return err + } + + *o = PlanSpecsDrivesInner(varPlanSpecsDrivesInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "type") + delete(additionalProperties, "size") + delete(additionalProperties, "category") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecsDrivesInner struct { + value *PlanSpecsDrivesInner + isSet bool +} + +func (v NullablePlanSpecsDrivesInner) Get() *PlanSpecsDrivesInner { + return v.value +} + +func (v *NullablePlanSpecsDrivesInner) Set(val *PlanSpecsDrivesInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsDrivesInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsDrivesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsDrivesInner(val *PlanSpecsDrivesInner) *NullablePlanSpecsDrivesInner { + return &NullablePlanSpecsDrivesInner{value: val, isSet: true} +} + +func (v NullablePlanSpecsDrivesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsDrivesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_drives_inner_category.go b/services/metalv1/model_plan_specs_drives_inner_category.go new file mode 100644 index 00000000..7aeaef81 --- /dev/null +++ b/services/metalv1/model_plan_specs_drives_inner_category.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PlanSpecsDrivesInnerCategory the model 'PlanSpecsDrivesInnerCategory' +type PlanSpecsDrivesInnerCategory string + +// List of Plan_specs_drives_inner_category +const ( + PLANSPECSDRIVESINNERCATEGORY_BOOT PlanSpecsDrivesInnerCategory = "boot" + PLANSPECSDRIVESINNERCATEGORY_CACHE PlanSpecsDrivesInnerCategory = "cache" + PLANSPECSDRIVESINNERCATEGORY_STORAGE PlanSpecsDrivesInnerCategory = "storage" +) + +// All allowed values of PlanSpecsDrivesInnerCategory enum +var AllowedPlanSpecsDrivesInnerCategoryEnumValues = []PlanSpecsDrivesInnerCategory{ + "boot", + "cache", + "storage", +} + +func (v *PlanSpecsDrivesInnerCategory) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PlanSpecsDrivesInnerCategory(value) + for _, existing := range AllowedPlanSpecsDrivesInnerCategoryEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PlanSpecsDrivesInnerCategory", value) +} + +// NewPlanSpecsDrivesInnerCategoryFromValue returns a pointer to a valid PlanSpecsDrivesInnerCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPlanSpecsDrivesInnerCategoryFromValue(v string) (*PlanSpecsDrivesInnerCategory, error) { + ev := PlanSpecsDrivesInnerCategory(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PlanSpecsDrivesInnerCategory: valid values are %v", v, AllowedPlanSpecsDrivesInnerCategoryEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PlanSpecsDrivesInnerCategory) IsValid() bool { + for _, existing := range AllowedPlanSpecsDrivesInnerCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Plan_specs_drives_inner_category value +func (v PlanSpecsDrivesInnerCategory) Ptr() *PlanSpecsDrivesInnerCategory { + return &v +} + +type NullablePlanSpecsDrivesInnerCategory struct { + value *PlanSpecsDrivesInnerCategory + isSet bool +} + +func (v NullablePlanSpecsDrivesInnerCategory) Get() *PlanSpecsDrivesInnerCategory { + return v.value +} + +func (v *NullablePlanSpecsDrivesInnerCategory) Set(val *PlanSpecsDrivesInnerCategory) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsDrivesInnerCategory) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsDrivesInnerCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsDrivesInnerCategory(val *PlanSpecsDrivesInnerCategory) *NullablePlanSpecsDrivesInnerCategory { + return &NullablePlanSpecsDrivesInnerCategory{value: val, isSet: true} +} + +func (v NullablePlanSpecsDrivesInnerCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsDrivesInnerCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_features.go b/services/metalv1/model_plan_specs_features.go new file mode 100644 index 00000000..93a613c5 --- /dev/null +++ b/services/metalv1/model_plan_specs_features.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecsFeatures type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecsFeatures{} + +// PlanSpecsFeatures struct for PlanSpecsFeatures +type PlanSpecsFeatures struct { + Raid *bool `json:"raid,omitempty"` + Txt *bool `json:"txt,omitempty"` + Uefi *bool `json:"uefi,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecsFeatures PlanSpecsFeatures + +// NewPlanSpecsFeatures instantiates a new PlanSpecsFeatures object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecsFeatures() *PlanSpecsFeatures { + this := PlanSpecsFeatures{} + return &this +} + +// NewPlanSpecsFeaturesWithDefaults instantiates a new PlanSpecsFeatures object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsFeaturesWithDefaults() *PlanSpecsFeatures { + this := PlanSpecsFeatures{} + return &this +} + +// GetRaid returns the Raid field value if set, zero value otherwise. +func (o *PlanSpecsFeatures) GetRaid() bool { + if o == nil || IsNil(o.Raid) { + var ret bool + return ret + } + return *o.Raid +} + +// GetRaidOk returns a tuple with the Raid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsFeatures) GetRaidOk() (*bool, bool) { + if o == nil || IsNil(o.Raid) { + return nil, false + } + return o.Raid, true +} + +// HasRaid returns a boolean if a field has been set. +func (o *PlanSpecsFeatures) HasRaid() bool { + if o != nil && !IsNil(o.Raid) { + return true + } + + return false +} + +// SetRaid gets a reference to the given bool and assigns it to the Raid field. +func (o *PlanSpecsFeatures) SetRaid(v bool) { + o.Raid = &v +} + +// GetTxt returns the Txt field value if set, zero value otherwise. +func (o *PlanSpecsFeatures) GetTxt() bool { + if o == nil || IsNil(o.Txt) { + var ret bool + return ret + } + return *o.Txt +} + +// GetTxtOk returns a tuple with the Txt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsFeatures) GetTxtOk() (*bool, bool) { + if o == nil || IsNil(o.Txt) { + return nil, false + } + return o.Txt, true +} + +// HasTxt returns a boolean if a field has been set. +func (o *PlanSpecsFeatures) HasTxt() bool { + if o != nil && !IsNil(o.Txt) { + return true + } + + return false +} + +// SetTxt gets a reference to the given bool and assigns it to the Txt field. +func (o *PlanSpecsFeatures) SetTxt(v bool) { + o.Txt = &v +} + +// GetUefi returns the Uefi field value if set, zero value otherwise. +func (o *PlanSpecsFeatures) GetUefi() bool { + if o == nil || IsNil(o.Uefi) { + var ret bool + return ret + } + return *o.Uefi +} + +// GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsFeatures) GetUefiOk() (*bool, bool) { + if o == nil || IsNil(o.Uefi) { + return nil, false + } + return o.Uefi, true +} + +// HasUefi returns a boolean if a field has been set. +func (o *PlanSpecsFeatures) HasUefi() bool { + if o != nil && !IsNil(o.Uefi) { + return true + } + + return false +} + +// SetUefi gets a reference to the given bool and assigns it to the Uefi field. +func (o *PlanSpecsFeatures) SetUefi(v bool) { + o.Uefi = &v +} + +func (o PlanSpecsFeatures) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecsFeatures) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Raid) { + toSerialize["raid"] = o.Raid + } + if !IsNil(o.Txt) { + toSerialize["txt"] = o.Txt + } + if !IsNil(o.Uefi) { + toSerialize["uefi"] = o.Uefi + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecsFeatures) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecsFeatures := _PlanSpecsFeatures{} + + err = json.Unmarshal(bytes, &varPlanSpecsFeatures) + + if err != nil { + return err + } + + *o = PlanSpecsFeatures(varPlanSpecsFeatures) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "raid") + delete(additionalProperties, "txt") + delete(additionalProperties, "uefi") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecsFeatures struct { + value *PlanSpecsFeatures + isSet bool +} + +func (v NullablePlanSpecsFeatures) Get() *PlanSpecsFeatures { + return v.value +} + +func (v *NullablePlanSpecsFeatures) Set(val *PlanSpecsFeatures) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsFeatures) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsFeatures) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsFeatures(val *PlanSpecsFeatures) *NullablePlanSpecsFeatures { + return &NullablePlanSpecsFeatures{value: val, isSet: true} +} + +func (v NullablePlanSpecsFeatures) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsFeatures) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_memory.go b/services/metalv1/model_plan_specs_memory.go new file mode 100644 index 00000000..1e29579c --- /dev/null +++ b/services/metalv1/model_plan_specs_memory.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecsMemory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecsMemory{} + +// PlanSpecsMemory struct for PlanSpecsMemory +type PlanSpecsMemory struct { + Total *string `json:"total,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecsMemory PlanSpecsMemory + +// NewPlanSpecsMemory instantiates a new PlanSpecsMemory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecsMemory() *PlanSpecsMemory { + this := PlanSpecsMemory{} + return &this +} + +// NewPlanSpecsMemoryWithDefaults instantiates a new PlanSpecsMemory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsMemoryWithDefaults() *PlanSpecsMemory { + this := PlanSpecsMemory{} + return &this +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *PlanSpecsMemory) GetTotal() string { + if o == nil || IsNil(o.Total) { + var ret string + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsMemory) GetTotalOk() (*string, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *PlanSpecsMemory) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *PlanSpecsMemory) SetTotal(v string) { + o.Total = &v +} + +func (o PlanSpecsMemory) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecsMemory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecsMemory) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecsMemory := _PlanSpecsMemory{} + + err = json.Unmarshal(bytes, &varPlanSpecsMemory) + + if err != nil { + return err + } + + *o = PlanSpecsMemory(varPlanSpecsMemory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "total") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecsMemory struct { + value *PlanSpecsMemory + isSet bool +} + +func (v NullablePlanSpecsMemory) Get() *PlanSpecsMemory { + return v.value +} + +func (v *NullablePlanSpecsMemory) Set(val *PlanSpecsMemory) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsMemory) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsMemory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsMemory(val *PlanSpecsMemory) *NullablePlanSpecsMemory { + return &NullablePlanSpecsMemory{value: val, isSet: true} +} + +func (v NullablePlanSpecsMemory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsMemory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_specs_nics_inner.go b/services/metalv1/model_plan_specs_nics_inner.go new file mode 100644 index 00000000..8fb9fede --- /dev/null +++ b/services/metalv1/model_plan_specs_nics_inner.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PlanSpecsNicsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlanSpecsNicsInner{} + +// PlanSpecsNicsInner struct for PlanSpecsNicsInner +type PlanSpecsNicsInner struct { + Count *int32 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlanSpecsNicsInner PlanSpecsNicsInner + +// NewPlanSpecsNicsInner instantiates a new PlanSpecsNicsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlanSpecsNicsInner() *PlanSpecsNicsInner { + this := PlanSpecsNicsInner{} + return &this +} + +// NewPlanSpecsNicsInnerWithDefaults instantiates a new PlanSpecsNicsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlanSpecsNicsInnerWithDefaults() *PlanSpecsNicsInner { + this := PlanSpecsNicsInner{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *PlanSpecsNicsInner) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsNicsInner) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *PlanSpecsNicsInner) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *PlanSpecsNicsInner) SetCount(v int32) { + o.Count = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PlanSpecsNicsInner) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlanSpecsNicsInner) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PlanSpecsNicsInner) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PlanSpecsNicsInner) SetType(v string) { + o.Type = &v +} + +func (o PlanSpecsNicsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlanSpecsNicsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlanSpecsNicsInner) UnmarshalJSON(bytes []byte) (err error) { + varPlanSpecsNicsInner := _PlanSpecsNicsInner{} + + err = json.Unmarshal(bytes, &varPlanSpecsNicsInner) + + if err != nil { + return err + } + + *o = PlanSpecsNicsInner(varPlanSpecsNicsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlanSpecsNicsInner struct { + value *PlanSpecsNicsInner + isSet bool +} + +func (v NullablePlanSpecsNicsInner) Get() *PlanSpecsNicsInner { + return v.value +} + +func (v *NullablePlanSpecsNicsInner) Set(val *PlanSpecsNicsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePlanSpecsNicsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanSpecsNicsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanSpecsNicsInner(val *PlanSpecsNicsInner) *NullablePlanSpecsNicsInner { + return &NullablePlanSpecsNicsInner{value: val, isSet: true} +} + +func (v NullablePlanSpecsNicsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanSpecsNicsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_plan_type.go b/services/metalv1/model_plan_type.go new file mode 100644 index 00000000..ecf64791 --- /dev/null +++ b/services/metalv1/model_plan_type.go @@ -0,0 +1,113 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PlanType The plan type +type PlanType string + +// List of Plan_type +const ( + PLANTYPE_STANDARD PlanType = "standard" + PLANTYPE_WORKLOAD_OPTIMIZED PlanType = "workload_optimized" + PLANTYPE_CUSTOM PlanType = "custom" +) + +// All allowed values of PlanType enum +var AllowedPlanTypeEnumValues = []PlanType{ + "standard", + "workload_optimized", + "custom", +} + +func (v *PlanType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PlanType(value) + for _, existing := range AllowedPlanTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PlanType", value) +} + +// NewPlanTypeFromValue returns a pointer to a valid PlanType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPlanTypeFromValue(v string) (*PlanType, error) { + ev := PlanType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PlanType: valid values are %v", v, AllowedPlanTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PlanType) IsValid() bool { + for _, existing := range AllowedPlanTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Plan_type value +func (v PlanType) Ptr() *PlanType { + return &v +} + +type NullablePlanType struct { + value *PlanType + isSet bool +} + +func (v NullablePlanType) Get() *PlanType { + return v.value +} + +func (v *NullablePlanType) Set(val *PlanType) { + v.value = val + v.isSet = true +} + +func (v NullablePlanType) IsSet() bool { + return v.isSet +} + +func (v *NullablePlanType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlanType(val *PlanType) *NullablePlanType { + return &NullablePlanType{value: val, isSet: true} +} + +func (v NullablePlanType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlanType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port.go b/services/metalv1/model_port.go new file mode 100644 index 00000000..17b235cf --- /dev/null +++ b/services/metalv1/model_port.go @@ -0,0 +1,488 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Port type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Port{} + +// Port Port is a hardware port associated with a reserved or instantiated hardware device. +type Port struct { + Bond *BondPortData `json:"bond,omitempty"` + Data *PortData `json:"data,omitempty"` + // Indicates whether or not the bond can be broken on the port (when applicable). + DisbondOperationSupported *bool `json:"disbond_operation_supported,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *PortType `json:"type,omitempty"` + NetworkType *PortNetworkType `json:"network_type,omitempty"` + NativeVirtualNetwork *VirtualNetwork `json:"native_virtual_network,omitempty"` + VirtualNetworks []Href `json:"virtual_networks,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Port Port + +// NewPort instantiates a new Port object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPort() *Port { + this := Port{} + return &this +} + +// NewPortWithDefaults instantiates a new Port object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortWithDefaults() *Port { + this := Port{} + return &this +} + +// GetBond returns the Bond field value if set, zero value otherwise. +func (o *Port) GetBond() BondPortData { + if o == nil || IsNil(o.Bond) { + var ret BondPortData + return ret + } + return *o.Bond +} + +// GetBondOk returns a tuple with the Bond field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetBondOk() (*BondPortData, bool) { + if o == nil || IsNil(o.Bond) { + return nil, false + } + return o.Bond, true +} + +// HasBond returns a boolean if a field has been set. +func (o *Port) HasBond() bool { + if o != nil && !IsNil(o.Bond) { + return true + } + + return false +} + +// SetBond gets a reference to the given BondPortData and assigns it to the Bond field. +func (o *Port) SetBond(v BondPortData) { + o.Bond = &v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *Port) GetData() PortData { + if o == nil || IsNil(o.Data) { + var ret PortData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetDataOk() (*PortData, bool) { + if o == nil || IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *Port) HasData() bool { + if o != nil && !IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given PortData and assigns it to the Data field. +func (o *Port) SetData(v PortData) { + o.Data = &v +} + +// GetDisbondOperationSupported returns the DisbondOperationSupported field value if set, zero value otherwise. +func (o *Port) GetDisbondOperationSupported() bool { + if o == nil || IsNil(o.DisbondOperationSupported) { + var ret bool + return ret + } + return *o.DisbondOperationSupported +} + +// GetDisbondOperationSupportedOk returns a tuple with the DisbondOperationSupported field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetDisbondOperationSupportedOk() (*bool, bool) { + if o == nil || IsNil(o.DisbondOperationSupported) { + return nil, false + } + return o.DisbondOperationSupported, true +} + +// HasDisbondOperationSupported returns a boolean if a field has been set. +func (o *Port) HasDisbondOperationSupported() bool { + if o != nil && !IsNil(o.DisbondOperationSupported) { + return true + } + + return false +} + +// SetDisbondOperationSupported gets a reference to the given bool and assigns it to the DisbondOperationSupported field. +func (o *Port) SetDisbondOperationSupported(v bool) { + o.DisbondOperationSupported = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Port) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Port) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Port) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Port) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Port) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Port) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Port) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Port) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Port) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Port) GetType() PortType { + if o == nil || IsNil(o.Type) { + var ret PortType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetTypeOk() (*PortType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Port) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PortType and assigns it to the Type field. +func (o *Port) SetType(v PortType) { + o.Type = &v +} + +// GetNetworkType returns the NetworkType field value if set, zero value otherwise. +func (o *Port) GetNetworkType() PortNetworkType { + if o == nil || IsNil(o.NetworkType) { + var ret PortNetworkType + return ret + } + return *o.NetworkType +} + +// GetNetworkTypeOk returns a tuple with the NetworkType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetNetworkTypeOk() (*PortNetworkType, bool) { + if o == nil || IsNil(o.NetworkType) { + return nil, false + } + return o.NetworkType, true +} + +// HasNetworkType returns a boolean if a field has been set. +func (o *Port) HasNetworkType() bool { + if o != nil && !IsNil(o.NetworkType) { + return true + } + + return false +} + +// SetNetworkType gets a reference to the given PortNetworkType and assigns it to the NetworkType field. +func (o *Port) SetNetworkType(v PortNetworkType) { + o.NetworkType = &v +} + +// GetNativeVirtualNetwork returns the NativeVirtualNetwork field value if set, zero value otherwise. +func (o *Port) GetNativeVirtualNetwork() VirtualNetwork { + if o == nil || IsNil(o.NativeVirtualNetwork) { + var ret VirtualNetwork + return ret + } + return *o.NativeVirtualNetwork +} + +// GetNativeVirtualNetworkOk returns a tuple with the NativeVirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetNativeVirtualNetworkOk() (*VirtualNetwork, bool) { + if o == nil || IsNil(o.NativeVirtualNetwork) { + return nil, false + } + return o.NativeVirtualNetwork, true +} + +// HasNativeVirtualNetwork returns a boolean if a field has been set. +func (o *Port) HasNativeVirtualNetwork() bool { + if o != nil && !IsNil(o.NativeVirtualNetwork) { + return true + } + + return false +} + +// SetNativeVirtualNetwork gets a reference to the given VirtualNetwork and assigns it to the NativeVirtualNetwork field. +func (o *Port) SetNativeVirtualNetwork(v VirtualNetwork) { + o.NativeVirtualNetwork = &v +} + +// GetVirtualNetworks returns the VirtualNetworks field value if set, zero value otherwise. +func (o *Port) GetVirtualNetworks() []Href { + if o == nil || IsNil(o.VirtualNetworks) { + var ret []Href + return ret + } + return o.VirtualNetworks +} + +// GetVirtualNetworksOk returns a tuple with the VirtualNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Port) GetVirtualNetworksOk() ([]Href, bool) { + if o == nil || IsNil(o.VirtualNetworks) { + return nil, false + } + return o.VirtualNetworks, true +} + +// HasVirtualNetworks returns a boolean if a field has been set. +func (o *Port) HasVirtualNetworks() bool { + if o != nil && !IsNil(o.VirtualNetworks) { + return true + } + + return false +} + +// SetVirtualNetworks gets a reference to the given []Href and assigns it to the VirtualNetworks field. +func (o *Port) SetVirtualNetworks(v []Href) { + o.VirtualNetworks = v +} + +func (o Port) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Port) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bond) { + toSerialize["bond"] = o.Bond + } + if !IsNil(o.Data) { + toSerialize["data"] = o.Data + } + if !IsNil(o.DisbondOperationSupported) { + toSerialize["disbond_operation_supported"] = o.DisbondOperationSupported + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.NetworkType) { + toSerialize["network_type"] = o.NetworkType + } + if !IsNil(o.NativeVirtualNetwork) { + toSerialize["native_virtual_network"] = o.NativeVirtualNetwork + } + if !IsNil(o.VirtualNetworks) { + toSerialize["virtual_networks"] = o.VirtualNetworks + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Port) UnmarshalJSON(bytes []byte) (err error) { + varPort := _Port{} + + err = json.Unmarshal(bytes, &varPort) + + if err != nil { + return err + } + + *o = Port(varPort) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bond") + delete(additionalProperties, "data") + delete(additionalProperties, "disbond_operation_supported") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "network_type") + delete(additionalProperties, "native_virtual_network") + delete(additionalProperties, "virtual_networks") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePort struct { + value *Port + isSet bool +} + +func (v NullablePort) Get() *Port { + return v.value +} + +func (v *NullablePort) Set(val *Port) { + v.value = val + v.isSet = true +} + +func (v NullablePort) IsSet() bool { + return v.isSet +} + +func (v *NullablePort) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePort(val *Port) *NullablePort { + return &NullablePort{value: val, isSet: true} +} + +func (v NullablePort) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePort) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_assign_input.go b/services/metalv1/model_port_assign_input.go new file mode 100644 index 00000000..dfc79ec7 --- /dev/null +++ b/services/metalv1/model_port_assign_input.go @@ -0,0 +1,155 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortAssignInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortAssignInput{} + +// PortAssignInput struct for PortAssignInput +type PortAssignInput struct { + // Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself. + Vnid *string `json:"vnid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortAssignInput PortAssignInput + +// NewPortAssignInput instantiates a new PortAssignInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortAssignInput() *PortAssignInput { + this := PortAssignInput{} + return &this +} + +// NewPortAssignInputWithDefaults instantiates a new PortAssignInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortAssignInputWithDefaults() *PortAssignInput { + this := PortAssignInput{} + return &this +} + +// GetVnid returns the Vnid field value if set, zero value otherwise. +func (o *PortAssignInput) GetVnid() string { + if o == nil || IsNil(o.Vnid) { + var ret string + return ret + } + return *o.Vnid +} + +// GetVnidOk returns a tuple with the Vnid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortAssignInput) GetVnidOk() (*string, bool) { + if o == nil || IsNil(o.Vnid) { + return nil, false + } + return o.Vnid, true +} + +// HasVnid returns a boolean if a field has been set. +func (o *PortAssignInput) HasVnid() bool { + if o != nil && !IsNil(o.Vnid) { + return true + } + + return false +} + +// SetVnid gets a reference to the given string and assigns it to the Vnid field. +func (o *PortAssignInput) SetVnid(v string) { + o.Vnid = &v +} + +func (o PortAssignInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortAssignInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Vnid) { + toSerialize["vnid"] = o.Vnid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortAssignInput) UnmarshalJSON(bytes []byte) (err error) { + varPortAssignInput := _PortAssignInput{} + + err = json.Unmarshal(bytes, &varPortAssignInput) + + if err != nil { + return err + } + + *o = PortAssignInput(varPortAssignInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "vnid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortAssignInput struct { + value *PortAssignInput + isSet bool +} + +func (v NullablePortAssignInput) Get() *PortAssignInput { + return v.value +} + +func (v *NullablePortAssignInput) Set(val *PortAssignInput) { + v.value = val + v.isSet = true +} + +func (v NullablePortAssignInput) IsSet() bool { + return v.isSet +} + +func (v *NullablePortAssignInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortAssignInput(val *PortAssignInput) *NullablePortAssignInput { + return &NullablePortAssignInput{value: val, isSet: true} +} + +func (v NullablePortAssignInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortAssignInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_convert_layer3_input.go b/services/metalv1/model_port_convert_layer3_input.go new file mode 100644 index 00000000..30cb1f51 --- /dev/null +++ b/services/metalv1/model_port_convert_layer3_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortConvertLayer3Input type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortConvertLayer3Input{} + +// PortConvertLayer3Input struct for PortConvertLayer3Input +type PortConvertLayer3Input struct { + RequestIps []PortConvertLayer3InputRequestIpsInner `json:"request_ips,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortConvertLayer3Input PortConvertLayer3Input + +// NewPortConvertLayer3Input instantiates a new PortConvertLayer3Input object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortConvertLayer3Input() *PortConvertLayer3Input { + this := PortConvertLayer3Input{} + return &this +} + +// NewPortConvertLayer3InputWithDefaults instantiates a new PortConvertLayer3Input object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortConvertLayer3InputWithDefaults() *PortConvertLayer3Input { + this := PortConvertLayer3Input{} + return &this +} + +// GetRequestIps returns the RequestIps field value if set, zero value otherwise. +func (o *PortConvertLayer3Input) GetRequestIps() []PortConvertLayer3InputRequestIpsInner { + if o == nil || IsNil(o.RequestIps) { + var ret []PortConvertLayer3InputRequestIpsInner + return ret + } + return o.RequestIps +} + +// GetRequestIpsOk returns a tuple with the RequestIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortConvertLayer3Input) GetRequestIpsOk() ([]PortConvertLayer3InputRequestIpsInner, bool) { + if o == nil || IsNil(o.RequestIps) { + return nil, false + } + return o.RequestIps, true +} + +// HasRequestIps returns a boolean if a field has been set. +func (o *PortConvertLayer3Input) HasRequestIps() bool { + if o != nil && !IsNil(o.RequestIps) { + return true + } + + return false +} + +// SetRequestIps gets a reference to the given []PortConvertLayer3InputRequestIpsInner and assigns it to the RequestIps field. +func (o *PortConvertLayer3Input) SetRequestIps(v []PortConvertLayer3InputRequestIpsInner) { + o.RequestIps = v +} + +func (o PortConvertLayer3Input) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortConvertLayer3Input) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RequestIps) { + toSerialize["request_ips"] = o.RequestIps + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortConvertLayer3Input) UnmarshalJSON(bytes []byte) (err error) { + varPortConvertLayer3Input := _PortConvertLayer3Input{} + + err = json.Unmarshal(bytes, &varPortConvertLayer3Input) + + if err != nil { + return err + } + + *o = PortConvertLayer3Input(varPortConvertLayer3Input) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "request_ips") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortConvertLayer3Input struct { + value *PortConvertLayer3Input + isSet bool +} + +func (v NullablePortConvertLayer3Input) Get() *PortConvertLayer3Input { + return v.value +} + +func (v *NullablePortConvertLayer3Input) Set(val *PortConvertLayer3Input) { + v.value = val + v.isSet = true +} + +func (v NullablePortConvertLayer3Input) IsSet() bool { + return v.isSet +} + +func (v *NullablePortConvertLayer3Input) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortConvertLayer3Input(val *PortConvertLayer3Input) *NullablePortConvertLayer3Input { + return &NullablePortConvertLayer3Input{value: val, isSet: true} +} + +func (v NullablePortConvertLayer3Input) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortConvertLayer3Input) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_convert_layer3_input_request_ips_inner.go b/services/metalv1/model_port_convert_layer3_input_request_ips_inner.go new file mode 100644 index 00000000..cf236e1a --- /dev/null +++ b/services/metalv1/model_port_convert_layer3_input_request_ips_inner.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortConvertLayer3InputRequestIpsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortConvertLayer3InputRequestIpsInner{} + +// PortConvertLayer3InputRequestIpsInner struct for PortConvertLayer3InputRequestIpsInner +type PortConvertLayer3InputRequestIpsInner struct { + AddressFamily *int32 `json:"address_family,omitempty"` + Public *bool `json:"public,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortConvertLayer3InputRequestIpsInner PortConvertLayer3InputRequestIpsInner + +// NewPortConvertLayer3InputRequestIpsInner instantiates a new PortConvertLayer3InputRequestIpsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortConvertLayer3InputRequestIpsInner() *PortConvertLayer3InputRequestIpsInner { + this := PortConvertLayer3InputRequestIpsInner{} + return &this +} + +// NewPortConvertLayer3InputRequestIpsInnerWithDefaults instantiates a new PortConvertLayer3InputRequestIpsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortConvertLayer3InputRequestIpsInnerWithDefaults() *PortConvertLayer3InputRequestIpsInner { + this := PortConvertLayer3InputRequestIpsInner{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *PortConvertLayer3InputRequestIpsInner) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortConvertLayer3InputRequestIpsInner) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *PortConvertLayer3InputRequestIpsInner) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *PortConvertLayer3InputRequestIpsInner) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *PortConvertLayer3InputRequestIpsInner) GetPublic() bool { + if o == nil || IsNil(o.Public) { + var ret bool + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortConvertLayer3InputRequestIpsInner) GetPublicOk() (*bool, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *PortConvertLayer3InputRequestIpsInner) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given bool and assigns it to the Public field. +func (o *PortConvertLayer3InputRequestIpsInner) SetPublic(v bool) { + o.Public = &v +} + +func (o PortConvertLayer3InputRequestIpsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortConvertLayer3InputRequestIpsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortConvertLayer3InputRequestIpsInner) UnmarshalJSON(bytes []byte) (err error) { + varPortConvertLayer3InputRequestIpsInner := _PortConvertLayer3InputRequestIpsInner{} + + err = json.Unmarshal(bytes, &varPortConvertLayer3InputRequestIpsInner) + + if err != nil { + return err + } + + *o = PortConvertLayer3InputRequestIpsInner(varPortConvertLayer3InputRequestIpsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "public") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortConvertLayer3InputRequestIpsInner struct { + value *PortConvertLayer3InputRequestIpsInner + isSet bool +} + +func (v NullablePortConvertLayer3InputRequestIpsInner) Get() *PortConvertLayer3InputRequestIpsInner { + return v.value +} + +func (v *NullablePortConvertLayer3InputRequestIpsInner) Set(val *PortConvertLayer3InputRequestIpsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePortConvertLayer3InputRequestIpsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePortConvertLayer3InputRequestIpsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortConvertLayer3InputRequestIpsInner(val *PortConvertLayer3InputRequestIpsInner) *NullablePortConvertLayer3InputRequestIpsInner { + return &NullablePortConvertLayer3InputRequestIpsInner{value: val, isSet: true} +} + +func (v NullablePortConvertLayer3InputRequestIpsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortConvertLayer3InputRequestIpsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_data.go b/services/metalv1/model_port_data.go new file mode 100644 index 00000000..a1000bc5 --- /dev/null +++ b/services/metalv1/model_port_data.go @@ -0,0 +1,193 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortData{} + +// PortData struct for PortData +type PortData struct { + // MAC address is set for NetworkPort ports + Mac *string `json:"mac,omitempty"` + // Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active + Bonded *bool `json:"bonded,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortData PortData + +// NewPortData instantiates a new PortData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortData() *PortData { + this := PortData{} + return &this +} + +// NewPortDataWithDefaults instantiates a new PortData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortDataWithDefaults() *PortData { + this := PortData{} + return &this +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *PortData) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortData) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *PortData) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *PortData) SetMac(v string) { + o.Mac = &v +} + +// GetBonded returns the Bonded field value if set, zero value otherwise. +func (o *PortData) GetBonded() bool { + if o == nil || IsNil(o.Bonded) { + var ret bool + return ret + } + return *o.Bonded +} + +// GetBondedOk returns a tuple with the Bonded field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortData) GetBondedOk() (*bool, bool) { + if o == nil || IsNil(o.Bonded) { + return nil, false + } + return o.Bonded, true +} + +// HasBonded returns a boolean if a field has been set. +func (o *PortData) HasBonded() bool { + if o != nil && !IsNil(o.Bonded) { + return true + } + + return false +} + +// SetBonded gets a reference to the given bool and assigns it to the Bonded field. +func (o *PortData) SetBonded(v bool) { + o.Bonded = &v +} + +func (o PortData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Bonded) { + toSerialize["bonded"] = o.Bonded + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortData) UnmarshalJSON(bytes []byte) (err error) { + varPortData := _PortData{} + + err = json.Unmarshal(bytes, &varPortData) + + if err != nil { + return err + } + + *o = PortData(varPortData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "mac") + delete(additionalProperties, "bonded") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortData struct { + value *PortData + isSet bool +} + +func (v NullablePortData) Get() *PortData { + return v.value +} + +func (v *NullablePortData) Set(val *PortData) { + v.value = val + v.isSet = true +} + +func (v NullablePortData) IsSet() bool { + return v.isSet +} + +func (v *NullablePortData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortData(val *PortData) *NullablePortData { + return &NullablePortData{value: val, isSet: true} +} + +func (v NullablePortData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_network_type.go b/services/metalv1/model_port_network_type.go new file mode 100644 index 00000000..d25fc772 --- /dev/null +++ b/services/metalv1/model_port_network_type.go @@ -0,0 +1,117 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PortNetworkType Composite network type of the bond +type PortNetworkType string + +// List of Port_network_type +const ( + PORTNETWORKTYPE_LAYER2_BONDED PortNetworkType = "layer2-bonded" + PORTNETWORKTYPE_LAYER2_INDIVIDUAL PortNetworkType = "layer2-individual" + PORTNETWORKTYPE_LAYER3 PortNetworkType = "layer3" + PORTNETWORKTYPE_HYBRID PortNetworkType = "hybrid" + PORTNETWORKTYPE_HYBRID_BONDED PortNetworkType = "hybrid-bonded" +) + +// All allowed values of PortNetworkType enum +var AllowedPortNetworkTypeEnumValues = []PortNetworkType{ + "layer2-bonded", + "layer2-individual", + "layer3", + "hybrid", + "hybrid-bonded", +} + +func (v *PortNetworkType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PortNetworkType(value) + for _, existing := range AllowedPortNetworkTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PortNetworkType", value) +} + +// NewPortNetworkTypeFromValue returns a pointer to a valid PortNetworkType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPortNetworkTypeFromValue(v string) (*PortNetworkType, error) { + ev := PortNetworkType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PortNetworkType: valid values are %v", v, AllowedPortNetworkTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PortNetworkType) IsValid() bool { + for _, existing := range AllowedPortNetworkTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Port_network_type value +func (v PortNetworkType) Ptr() *PortNetworkType { + return &v +} + +type NullablePortNetworkType struct { + value *PortNetworkType + isSet bool +} + +func (v NullablePortNetworkType) Get() *PortNetworkType { + return v.value +} + +func (v *NullablePortNetworkType) Set(val *PortNetworkType) { + v.value = val + v.isSet = true +} + +func (v NullablePortNetworkType) IsSet() bool { + return v.isSet +} + +func (v *NullablePortNetworkType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortNetworkType(val *PortNetworkType) *NullablePortNetworkType { + return &NullablePortNetworkType{value: val, isSet: true} +} + +func (v NullablePortNetworkType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortNetworkType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_type.go b/services/metalv1/model_port_type.go new file mode 100644 index 00000000..a383a46a --- /dev/null +++ b/services/metalv1/model_port_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PortType Type is either \"NetworkBondPort\" for bond ports or \"NetworkPort\" for bondable ethernet ports +type PortType string + +// List of Port_type +const ( + PORTTYPE_NETWORK_PORT PortType = "NetworkPort" + PORTTYPE_NETWORK_BOND_PORT PortType = "NetworkBondPort" +) + +// All allowed values of PortType enum +var AllowedPortTypeEnumValues = []PortType{ + "NetworkPort", + "NetworkBondPort", +} + +func (v *PortType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PortType(value) + for _, existing := range AllowedPortTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PortType", value) +} + +// NewPortTypeFromValue returns a pointer to a valid PortType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPortTypeFromValue(v string) (*PortType, error) { + ev := PortType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PortType: valid values are %v", v, AllowedPortTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PortType) IsValid() bool { + for _, existing := range AllowedPortTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Port_type value +func (v PortType) Ptr() *PortType { + return &v +} + +type NullablePortType struct { + value *PortType + isSet bool +} + +func (v NullablePortType) Get() *PortType { + return v.value +} + +func (v *NullablePortType) Set(val *PortType) { + v.value = val + v.isSet = true +} + +func (v NullablePortType) IsSet() bool { + return v.isSet +} + +func (v *NullablePortType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortType(val *PortType) *NullablePortType { + return &NullablePortType{value: val, isSet: true} +} + +func (v NullablePortType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment.go b/services/metalv1/model_port_vlan_assignment.go new file mode 100644 index 00000000..e42f2c4f --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment.go @@ -0,0 +1,414 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the PortVlanAssignment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignment{} + +// PortVlanAssignment struct for PortVlanAssignment +type PortVlanAssignment struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Native *bool `json:"native,omitempty"` + Port *Href `json:"port,omitempty"` + State *PortVlanAssignmentState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + VirtualNetwork *Href `json:"virtual_network,omitempty"` + Vlan *int32 `json:"vlan,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignment PortVlanAssignment + +// NewPortVlanAssignment instantiates a new PortVlanAssignment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignment() *PortVlanAssignment { + this := PortVlanAssignment{} + return &this +} + +// NewPortVlanAssignmentWithDefaults instantiates a new PortVlanAssignment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentWithDefaults() *PortVlanAssignment { + this := PortVlanAssignment{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *PortVlanAssignment) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PortVlanAssignment) SetId(v string) { + o.Id = &v +} + +// GetNative returns the Native field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetNative() bool { + if o == nil || IsNil(o.Native) { + var ret bool + return ret + } + return *o.Native +} + +// GetNativeOk returns a tuple with the Native field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetNativeOk() (*bool, bool) { + if o == nil || IsNil(o.Native) { + return nil, false + } + return o.Native, true +} + +// HasNative returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasNative() bool { + if o != nil && !IsNil(o.Native) { + return true + } + + return false +} + +// SetNative gets a reference to the given bool and assigns it to the Native field. +func (o *PortVlanAssignment) SetNative(v bool) { + o.Native = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetPort() Href { + if o == nil || IsNil(o.Port) { + var ret Href + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetPortOk() (*Href, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given Href and assigns it to the Port field. +func (o *PortVlanAssignment) SetPort(v Href) { + o.Port = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetState() PortVlanAssignmentState { + if o == nil || IsNil(o.State) { + var ret PortVlanAssignmentState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetStateOk() (*PortVlanAssignmentState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given PortVlanAssignmentState and assigns it to the State field. +func (o *PortVlanAssignment) SetState(v PortVlanAssignmentState) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *PortVlanAssignment) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVirtualNetwork returns the VirtualNetwork field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetVirtualNetwork() Href { + if o == nil || IsNil(o.VirtualNetwork) { + var ret Href + return ret + } + return *o.VirtualNetwork +} + +// GetVirtualNetworkOk returns a tuple with the VirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetVirtualNetworkOk() (*Href, bool) { + if o == nil || IsNil(o.VirtualNetwork) { + return nil, false + } + return o.VirtualNetwork, true +} + +// HasVirtualNetwork returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasVirtualNetwork() bool { + if o != nil && !IsNil(o.VirtualNetwork) { + return true + } + + return false +} + +// SetVirtualNetwork gets a reference to the given Href and assigns it to the VirtualNetwork field. +func (o *PortVlanAssignment) SetVirtualNetwork(v Href) { + o.VirtualNetwork = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise. +func (o *PortVlanAssignment) GetVlan() int32 { + if o == nil || IsNil(o.Vlan) { + var ret int32 + return ret + } + return *o.Vlan +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignment) GetVlanOk() (*int32, bool) { + if o == nil || IsNil(o.Vlan) { + return nil, false + } + return o.Vlan, true +} + +// HasVlan returns a boolean if a field has been set. +func (o *PortVlanAssignment) HasVlan() bool { + if o != nil && !IsNil(o.Vlan) { + return true + } + + return false +} + +// SetVlan gets a reference to the given int32 and assigns it to the Vlan field. +func (o *PortVlanAssignment) SetVlan(v int32) { + o.Vlan = &v +} + +func (o PortVlanAssignment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Native) { + toSerialize["native"] = o.Native + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.VirtualNetwork) { + toSerialize["virtual_network"] = o.VirtualNetwork + } + if !IsNil(o.Vlan) { + toSerialize["vlan"] = o.Vlan + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignment) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignment := _PortVlanAssignment{} + + err = json.Unmarshal(bytes, &varPortVlanAssignment) + + if err != nil { + return err + } + + *o = PortVlanAssignment(varPortVlanAssignment) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "id") + delete(additionalProperties, "native") + delete(additionalProperties, "port") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "virtual_network") + delete(additionalProperties, "vlan") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignment struct { + value *PortVlanAssignment + isSet bool +} + +func (v NullablePortVlanAssignment) Get() *PortVlanAssignment { + return v.value +} + +func (v *NullablePortVlanAssignment) Set(val *PortVlanAssignment) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignment) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignment(val *PortVlanAssignment) *NullablePortVlanAssignment { + return &NullablePortVlanAssignment{value: val, isSet: true} +} + +func (v NullablePortVlanAssignment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch.go b/services/metalv1/model_port_vlan_assignment_batch.go new file mode 100644 index 00000000..2ee5a13b --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch.go @@ -0,0 +1,451 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the PortVlanAssignmentBatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentBatch{} + +// PortVlanAssignmentBatch struct for PortVlanAssignmentBatch +type PortVlanAssignmentBatch struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + ErrorMessages []string `json:"error_messages,omitempty"` + Id *string `json:"id,omitempty"` + Port *Port `json:"port,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + State *PortVlanAssignmentBatchState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + VlanAssignments []PortVlanAssignmentBatchVlanAssignmentsInner `json:"vlan_assignments,omitempty"` + Project *Href `json:"project,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentBatch PortVlanAssignmentBatch + +// NewPortVlanAssignmentBatch instantiates a new PortVlanAssignmentBatch object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentBatch() *PortVlanAssignmentBatch { + this := PortVlanAssignmentBatch{} + return &this +} + +// NewPortVlanAssignmentBatchWithDefaults instantiates a new PortVlanAssignmentBatch object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentBatchWithDefaults() *PortVlanAssignmentBatch { + this := PortVlanAssignmentBatch{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *PortVlanAssignmentBatch) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessages returns the ErrorMessages field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetErrorMessages() []string { + if o == nil || IsNil(o.ErrorMessages) { + var ret []string + return ret + } + return o.ErrorMessages +} + +// GetErrorMessagesOk returns a tuple with the ErrorMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetErrorMessagesOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorMessages) { + return nil, false + } + return o.ErrorMessages, true +} + +// HasErrorMessages returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasErrorMessages() bool { + if o != nil && !IsNil(o.ErrorMessages) { + return true + } + + return false +} + +// SetErrorMessages gets a reference to the given []string and assigns it to the ErrorMessages field. +func (o *PortVlanAssignmentBatch) SetErrorMessages(v []string) { + o.ErrorMessages = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PortVlanAssignmentBatch) SetId(v string) { + o.Id = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetPort() Port { + if o == nil || IsNil(o.Port) { + var ret Port + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetPortOk() (*Port, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given Port and assigns it to the Port field. +func (o *PortVlanAssignmentBatch) SetPort(v Port) { + o.Port = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *PortVlanAssignmentBatch) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetState() PortVlanAssignmentBatchState { + if o == nil || IsNil(o.State) { + var ret PortVlanAssignmentBatchState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetStateOk() (*PortVlanAssignmentBatchState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given PortVlanAssignmentBatchState and assigns it to the State field. +func (o *PortVlanAssignmentBatch) SetState(v PortVlanAssignmentBatchState) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *PortVlanAssignmentBatch) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVlanAssignments returns the VlanAssignments field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetVlanAssignments() []PortVlanAssignmentBatchVlanAssignmentsInner { + if o == nil || IsNil(o.VlanAssignments) { + var ret []PortVlanAssignmentBatchVlanAssignmentsInner + return ret + } + return o.VlanAssignments +} + +// GetVlanAssignmentsOk returns a tuple with the VlanAssignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetVlanAssignmentsOk() ([]PortVlanAssignmentBatchVlanAssignmentsInner, bool) { + if o == nil || IsNil(o.VlanAssignments) { + return nil, false + } + return o.VlanAssignments, true +} + +// HasVlanAssignments returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasVlanAssignments() bool { + if o != nil && !IsNil(o.VlanAssignments) { + return true + } + + return false +} + +// SetVlanAssignments gets a reference to the given []PortVlanAssignmentBatchVlanAssignmentsInner and assigns it to the VlanAssignments field. +func (o *PortVlanAssignmentBatch) SetVlanAssignments(v []PortVlanAssignmentBatchVlanAssignmentsInner) { + o.VlanAssignments = v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatch) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatch) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatch) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *PortVlanAssignmentBatch) SetProject(v Href) { + o.Project = &v +} + +func (o PortVlanAssignmentBatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentBatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.ErrorMessages) { + toSerialize["error_messages"] = o.ErrorMessages + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.VlanAssignments) { + toSerialize["vlan_assignments"] = o.VlanAssignments + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentBatch) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentBatch := _PortVlanAssignmentBatch{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentBatch) + + if err != nil { + return err + } + + *o = PortVlanAssignmentBatch(varPortVlanAssignmentBatch) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "error_messages") + delete(additionalProperties, "id") + delete(additionalProperties, "port") + delete(additionalProperties, "quantity") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "vlan_assignments") + delete(additionalProperties, "project") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentBatch struct { + value *PortVlanAssignmentBatch + isSet bool +} + +func (v NullablePortVlanAssignmentBatch) Get() *PortVlanAssignmentBatch { + return v.value +} + +func (v *NullablePortVlanAssignmentBatch) Set(val *PortVlanAssignmentBatch) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatch) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatch(val *PortVlanAssignmentBatch) *NullablePortVlanAssignmentBatch { + return &NullablePortVlanAssignmentBatch{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_create_input.go b/services/metalv1/model_port_vlan_assignment_batch_create_input.go new file mode 100644 index 00000000..2c77e2b0 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_create_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortVlanAssignmentBatchCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentBatchCreateInput{} + +// PortVlanAssignmentBatchCreateInput struct for PortVlanAssignmentBatchCreateInput +type PortVlanAssignmentBatchCreateInput struct { + VlanAssignments []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner `json:"vlan_assignments,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentBatchCreateInput PortVlanAssignmentBatchCreateInput + +// NewPortVlanAssignmentBatchCreateInput instantiates a new PortVlanAssignmentBatchCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentBatchCreateInput() *PortVlanAssignmentBatchCreateInput { + this := PortVlanAssignmentBatchCreateInput{} + return &this +} + +// NewPortVlanAssignmentBatchCreateInputWithDefaults instantiates a new PortVlanAssignmentBatchCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentBatchCreateInputWithDefaults() *PortVlanAssignmentBatchCreateInput { + this := PortVlanAssignmentBatchCreateInput{} + return &this +} + +// GetVlanAssignments returns the VlanAssignments field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchCreateInput) GetVlanAssignments() []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner { + if o == nil || IsNil(o.VlanAssignments) { + var ret []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + return ret + } + return o.VlanAssignments +} + +// GetVlanAssignmentsOk returns a tuple with the VlanAssignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchCreateInput) GetVlanAssignmentsOk() ([]PortVlanAssignmentBatchCreateInputVlanAssignmentsInner, bool) { + if o == nil || IsNil(o.VlanAssignments) { + return nil, false + } + return o.VlanAssignments, true +} + +// HasVlanAssignments returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchCreateInput) HasVlanAssignments() bool { + if o != nil && !IsNil(o.VlanAssignments) { + return true + } + + return false +} + +// SetVlanAssignments gets a reference to the given []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner and assigns it to the VlanAssignments field. +func (o *PortVlanAssignmentBatchCreateInput) SetVlanAssignments(v []PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) { + o.VlanAssignments = v +} + +func (o PortVlanAssignmentBatchCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentBatchCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VlanAssignments) { + toSerialize["vlan_assignments"] = o.VlanAssignments + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentBatchCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentBatchCreateInput := _PortVlanAssignmentBatchCreateInput{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentBatchCreateInput) + + if err != nil { + return err + } + + *o = PortVlanAssignmentBatchCreateInput(varPortVlanAssignmentBatchCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "vlan_assignments") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentBatchCreateInput struct { + value *PortVlanAssignmentBatchCreateInput + isSet bool +} + +func (v NullablePortVlanAssignmentBatchCreateInput) Get() *PortVlanAssignmentBatchCreateInput { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchCreateInput) Set(val *PortVlanAssignmentBatchCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchCreateInput(val *PortVlanAssignmentBatchCreateInput) *NullablePortVlanAssignmentBatchCreateInput { + return &NullablePortVlanAssignmentBatchCreateInput{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_create_input_vlan_assignments_inner.go b/services/metalv1/model_port_vlan_assignment_batch_create_input_vlan_assignments_inner.go new file mode 100644 index 00000000..bf11ac08 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_create_input_vlan_assignments_inner.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortVlanAssignmentBatchCreateInputVlanAssignmentsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentBatchCreateInputVlanAssignmentsInner{} + +// PortVlanAssignmentBatchCreateInputVlanAssignmentsInner struct for PortVlanAssignmentBatchCreateInputVlanAssignmentsInner +type PortVlanAssignmentBatchCreateInputVlanAssignmentsInner struct { + Native *bool `json:"native,omitempty"` + State *PortVlanAssignmentBatchVlanAssignmentsInnerState `json:"state,omitempty"` + Vlan *string `json:"vlan,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentBatchCreateInputVlanAssignmentsInner PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + +// NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInner instantiates a new PortVlanAssignmentBatchCreateInputVlanAssignmentsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInner() *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner { + this := PortVlanAssignmentBatchCreateInputVlanAssignmentsInner{} + return &this +} + +// NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInnerWithDefaults instantiates a new PortVlanAssignmentBatchCreateInputVlanAssignmentsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentBatchCreateInputVlanAssignmentsInnerWithDefaults() *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner { + this := PortVlanAssignmentBatchCreateInputVlanAssignmentsInner{} + return &this +} + +// GetNative returns the Native field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetNative() bool { + if o == nil || IsNil(o.Native) { + var ret bool + return ret + } + return *o.Native +} + +// GetNativeOk returns a tuple with the Native field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetNativeOk() (*bool, bool) { + if o == nil || IsNil(o.Native) { + return nil, false + } + return o.Native, true +} + +// HasNative returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasNative() bool { + if o != nil && !IsNil(o.Native) { + return true + } + + return false +} + +// SetNative gets a reference to the given bool and assigns it to the Native field. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetNative(v bool) { + o.Native = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetState() PortVlanAssignmentBatchVlanAssignmentsInnerState { + if o == nil || IsNil(o.State) { + var ret PortVlanAssignmentBatchVlanAssignmentsInnerState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetStateOk() (*PortVlanAssignmentBatchVlanAssignmentsInnerState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given PortVlanAssignmentBatchVlanAssignmentsInnerState and assigns it to the State field. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetState(v PortVlanAssignmentBatchVlanAssignmentsInnerState) { + o.State = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetVlan() string { + if o == nil || IsNil(o.Vlan) { + var ret string + return ret + } + return *o.Vlan +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) GetVlanOk() (*string, bool) { + if o == nil || IsNil(o.Vlan) { + return nil, false + } + return o.Vlan, true +} + +// HasVlan returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) HasVlan() bool { + if o != nil && !IsNil(o.Vlan) { + return true + } + + return false +} + +// SetVlan gets a reference to the given string and assigns it to the Vlan field. +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) SetVlan(v string) { + o.Vlan = &v +} + +func (o PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Native) { + toSerialize["native"] = o.Native + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Vlan) { + toSerialize["vlan"] = o.Vlan + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentBatchCreateInputVlanAssignmentsInner := _PortVlanAssignmentBatchCreateInputVlanAssignmentsInner{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentBatchCreateInputVlanAssignmentsInner) + + if err != nil { + return err + } + + *o = PortVlanAssignmentBatchCreateInputVlanAssignmentsInner(varPortVlanAssignmentBatchCreateInputVlanAssignmentsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "native") + delete(additionalProperties, "state") + delete(additionalProperties, "vlan") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner struct { + value *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner + isSet bool +} + +func (v NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) Get() *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) Set(val *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner(val *PortVlanAssignmentBatchCreateInputVlanAssignmentsInner) *NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner { + return &NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchCreateInputVlanAssignmentsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_list.go b/services/metalv1/model_port_vlan_assignment_batch_list.go new file mode 100644 index 00000000..753c319f --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortVlanAssignmentBatchList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentBatchList{} + +// PortVlanAssignmentBatchList struct for PortVlanAssignmentBatchList +type PortVlanAssignmentBatchList struct { + Batches []PortVlanAssignmentBatch `json:"batches,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentBatchList PortVlanAssignmentBatchList + +// NewPortVlanAssignmentBatchList instantiates a new PortVlanAssignmentBatchList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentBatchList() *PortVlanAssignmentBatchList { + this := PortVlanAssignmentBatchList{} + return &this +} + +// NewPortVlanAssignmentBatchListWithDefaults instantiates a new PortVlanAssignmentBatchList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentBatchListWithDefaults() *PortVlanAssignmentBatchList { + this := PortVlanAssignmentBatchList{} + return &this +} + +// GetBatches returns the Batches field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchList) GetBatches() []PortVlanAssignmentBatch { + if o == nil || IsNil(o.Batches) { + var ret []PortVlanAssignmentBatch + return ret + } + return o.Batches +} + +// GetBatchesOk returns a tuple with the Batches field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchList) GetBatchesOk() ([]PortVlanAssignmentBatch, bool) { + if o == nil || IsNil(o.Batches) { + return nil, false + } + return o.Batches, true +} + +// HasBatches returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchList) HasBatches() bool { + if o != nil && !IsNil(o.Batches) { + return true + } + + return false +} + +// SetBatches gets a reference to the given []PortVlanAssignmentBatch and assigns it to the Batches field. +func (o *PortVlanAssignmentBatchList) SetBatches(v []PortVlanAssignmentBatch) { + o.Batches = v +} + +func (o PortVlanAssignmentBatchList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentBatchList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Batches) { + toSerialize["batches"] = o.Batches + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentBatchList) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentBatchList := _PortVlanAssignmentBatchList{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentBatchList) + + if err != nil { + return err + } + + *o = PortVlanAssignmentBatchList(varPortVlanAssignmentBatchList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "batches") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentBatchList struct { + value *PortVlanAssignmentBatchList + isSet bool +} + +func (v NullablePortVlanAssignmentBatchList) Get() *PortVlanAssignmentBatchList { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchList) Set(val *PortVlanAssignmentBatchList) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchList) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchList(val *PortVlanAssignmentBatchList) *NullablePortVlanAssignmentBatchList { + return &NullablePortVlanAssignmentBatchList{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_state.go b/services/metalv1/model_port_vlan_assignment_batch_state.go new file mode 100644 index 00000000..4f82ec14 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_state.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PortVlanAssignmentBatchState the model 'PortVlanAssignmentBatchState' +type PortVlanAssignmentBatchState string + +// List of PortVlanAssignmentBatch_state +const ( + PORTVLANASSIGNMENTBATCHSTATE_QUEUED PortVlanAssignmentBatchState = "queued" + PORTVLANASSIGNMENTBATCHSTATE_IN_PROGRESS PortVlanAssignmentBatchState = "in_progress" + PORTVLANASSIGNMENTBATCHSTATE_COMPLETED PortVlanAssignmentBatchState = "completed" + PORTVLANASSIGNMENTBATCHSTATE_FAILED PortVlanAssignmentBatchState = "failed" +) + +// All allowed values of PortVlanAssignmentBatchState enum +var AllowedPortVlanAssignmentBatchStateEnumValues = []PortVlanAssignmentBatchState{ + "queued", + "in_progress", + "completed", + "failed", +} + +func (v *PortVlanAssignmentBatchState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PortVlanAssignmentBatchState(value) + for _, existing := range AllowedPortVlanAssignmentBatchStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PortVlanAssignmentBatchState", value) +} + +// NewPortVlanAssignmentBatchStateFromValue returns a pointer to a valid PortVlanAssignmentBatchState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPortVlanAssignmentBatchStateFromValue(v string) (*PortVlanAssignmentBatchState, error) { + ev := PortVlanAssignmentBatchState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PortVlanAssignmentBatchState: valid values are %v", v, AllowedPortVlanAssignmentBatchStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PortVlanAssignmentBatchState) IsValid() bool { + for _, existing := range AllowedPortVlanAssignmentBatchStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PortVlanAssignmentBatch_state value +func (v PortVlanAssignmentBatchState) Ptr() *PortVlanAssignmentBatchState { + return &v +} + +type NullablePortVlanAssignmentBatchState struct { + value *PortVlanAssignmentBatchState + isSet bool +} + +func (v NullablePortVlanAssignmentBatchState) Get() *PortVlanAssignmentBatchState { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchState) Set(val *PortVlanAssignmentBatchState) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchState) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchState(val *PortVlanAssignmentBatchState) *NullablePortVlanAssignmentBatchState { + return &NullablePortVlanAssignmentBatchState{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner.go b/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner.go new file mode 100644 index 00000000..08c8d2f4 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortVlanAssignmentBatchVlanAssignmentsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentBatchVlanAssignmentsInner{} + +// PortVlanAssignmentBatchVlanAssignmentsInner struct for PortVlanAssignmentBatchVlanAssignmentsInner +type PortVlanAssignmentBatchVlanAssignmentsInner struct { + Id *string `json:"id,omitempty"` + Native *bool `json:"native,omitempty"` + State *PortVlanAssignmentBatchVlanAssignmentsInnerState `json:"state,omitempty"` + Vlan *int32 `json:"vlan,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentBatchVlanAssignmentsInner PortVlanAssignmentBatchVlanAssignmentsInner + +// NewPortVlanAssignmentBatchVlanAssignmentsInner instantiates a new PortVlanAssignmentBatchVlanAssignmentsInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentBatchVlanAssignmentsInner() *PortVlanAssignmentBatchVlanAssignmentsInner { + this := PortVlanAssignmentBatchVlanAssignmentsInner{} + return &this +} + +// NewPortVlanAssignmentBatchVlanAssignmentsInnerWithDefaults instantiates a new PortVlanAssignmentBatchVlanAssignmentsInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentBatchVlanAssignmentsInnerWithDefaults() *PortVlanAssignmentBatchVlanAssignmentsInner { + this := PortVlanAssignmentBatchVlanAssignmentsInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetId(v string) { + o.Id = &v +} + +// GetNative returns the Native field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetNative() bool { + if o == nil || IsNil(o.Native) { + var ret bool + return ret + } + return *o.Native +} + +// GetNativeOk returns a tuple with the Native field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetNativeOk() (*bool, bool) { + if o == nil || IsNil(o.Native) { + return nil, false + } + return o.Native, true +} + +// HasNative returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasNative() bool { + if o != nil && !IsNil(o.Native) { + return true + } + + return false +} + +// SetNative gets a reference to the given bool and assigns it to the Native field. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetNative(v bool) { + o.Native = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetState() PortVlanAssignmentBatchVlanAssignmentsInnerState { + if o == nil || IsNil(o.State) { + var ret PortVlanAssignmentBatchVlanAssignmentsInnerState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetStateOk() (*PortVlanAssignmentBatchVlanAssignmentsInnerState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given PortVlanAssignmentBatchVlanAssignmentsInnerState and assigns it to the State field. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetState(v PortVlanAssignmentBatchVlanAssignmentsInnerState) { + o.State = &v +} + +// GetVlan returns the Vlan field value if set, zero value otherwise. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetVlan() int32 { + if o == nil || IsNil(o.Vlan) { + var ret int32 + return ret + } + return *o.Vlan +} + +// GetVlanOk returns a tuple with the Vlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) GetVlanOk() (*int32, bool) { + if o == nil || IsNil(o.Vlan) { + return nil, false + } + return o.Vlan, true +} + +// HasVlan returns a boolean if a field has been set. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) HasVlan() bool { + if o != nil && !IsNil(o.Vlan) { + return true + } + + return false +} + +// SetVlan gets a reference to the given int32 and assigns it to the Vlan field. +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) SetVlan(v int32) { + o.Vlan = &v +} + +func (o PortVlanAssignmentBatchVlanAssignmentsInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentBatchVlanAssignmentsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Native) { + toSerialize["native"] = o.Native + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Vlan) { + toSerialize["vlan"] = o.Vlan + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentBatchVlanAssignmentsInner) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentBatchVlanAssignmentsInner := _PortVlanAssignmentBatchVlanAssignmentsInner{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentBatchVlanAssignmentsInner) + + if err != nil { + return err + } + + *o = PortVlanAssignmentBatchVlanAssignmentsInner(varPortVlanAssignmentBatchVlanAssignmentsInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "native") + delete(additionalProperties, "state") + delete(additionalProperties, "vlan") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentBatchVlanAssignmentsInner struct { + value *PortVlanAssignmentBatchVlanAssignmentsInner + isSet bool +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInner) Get() *PortVlanAssignmentBatchVlanAssignmentsInner { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInner) Set(val *PortVlanAssignmentBatchVlanAssignmentsInner) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInner) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchVlanAssignmentsInner(val *PortVlanAssignmentBatchVlanAssignmentsInner) *NullablePortVlanAssignmentBatchVlanAssignmentsInner { + return &NullablePortVlanAssignmentBatchVlanAssignmentsInner{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner_state.go b/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner_state.go new file mode 100644 index 00000000..dcb56557 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_batch_vlan_assignments_inner_state.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PortVlanAssignmentBatchVlanAssignmentsInnerState the model 'PortVlanAssignmentBatchVlanAssignmentsInnerState' +type PortVlanAssignmentBatchVlanAssignmentsInnerState string + +// List of PortVlanAssignmentBatch_vlan_assignments_inner_state +const ( + PORTVLANASSIGNMENTBATCHVLANASSIGNMENTSINNERSTATE_ASSIGNED PortVlanAssignmentBatchVlanAssignmentsInnerState = "assigned" + PORTVLANASSIGNMENTBATCHVLANASSIGNMENTSINNERSTATE_UNASSIGNED PortVlanAssignmentBatchVlanAssignmentsInnerState = "unassigned" +) + +// All allowed values of PortVlanAssignmentBatchVlanAssignmentsInnerState enum +var AllowedPortVlanAssignmentBatchVlanAssignmentsInnerStateEnumValues = []PortVlanAssignmentBatchVlanAssignmentsInnerState{ + "assigned", + "unassigned", +} + +func (v *PortVlanAssignmentBatchVlanAssignmentsInnerState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PortVlanAssignmentBatchVlanAssignmentsInnerState(value) + for _, existing := range AllowedPortVlanAssignmentBatchVlanAssignmentsInnerStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PortVlanAssignmentBatchVlanAssignmentsInnerState", value) +} + +// NewPortVlanAssignmentBatchVlanAssignmentsInnerStateFromValue returns a pointer to a valid PortVlanAssignmentBatchVlanAssignmentsInnerState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPortVlanAssignmentBatchVlanAssignmentsInnerStateFromValue(v string) (*PortVlanAssignmentBatchVlanAssignmentsInnerState, error) { + ev := PortVlanAssignmentBatchVlanAssignmentsInnerState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PortVlanAssignmentBatchVlanAssignmentsInnerState: valid values are %v", v, AllowedPortVlanAssignmentBatchVlanAssignmentsInnerStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PortVlanAssignmentBatchVlanAssignmentsInnerState) IsValid() bool { + for _, existing := range AllowedPortVlanAssignmentBatchVlanAssignmentsInnerStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PortVlanAssignmentBatch_vlan_assignments_inner_state value +func (v PortVlanAssignmentBatchVlanAssignmentsInnerState) Ptr() *PortVlanAssignmentBatchVlanAssignmentsInnerState { + return &v +} + +type NullablePortVlanAssignmentBatchVlanAssignmentsInnerState struct { + value *PortVlanAssignmentBatchVlanAssignmentsInnerState + isSet bool +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) Get() *PortVlanAssignmentBatchVlanAssignmentsInnerState { + return v.value +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) Set(val *PortVlanAssignmentBatchVlanAssignmentsInnerState) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentBatchVlanAssignmentsInnerState(val *PortVlanAssignmentBatchVlanAssignmentsInnerState) *NullablePortVlanAssignmentBatchVlanAssignmentsInnerState { + return &NullablePortVlanAssignmentBatchVlanAssignmentsInnerState{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentBatchVlanAssignmentsInnerState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_list.go b/services/metalv1/model_port_vlan_assignment_list.go new file mode 100644 index 00000000..afb7ea26 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the PortVlanAssignmentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortVlanAssignmentList{} + +// PortVlanAssignmentList struct for PortVlanAssignmentList +type PortVlanAssignmentList struct { + VlanAssignments []PortVlanAssignment `json:"vlan_assignments,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PortVlanAssignmentList PortVlanAssignmentList + +// NewPortVlanAssignmentList instantiates a new PortVlanAssignmentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortVlanAssignmentList() *PortVlanAssignmentList { + this := PortVlanAssignmentList{} + return &this +} + +// NewPortVlanAssignmentListWithDefaults instantiates a new PortVlanAssignmentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortVlanAssignmentListWithDefaults() *PortVlanAssignmentList { + this := PortVlanAssignmentList{} + return &this +} + +// GetVlanAssignments returns the VlanAssignments field value if set, zero value otherwise. +func (o *PortVlanAssignmentList) GetVlanAssignments() []PortVlanAssignment { + if o == nil || IsNil(o.VlanAssignments) { + var ret []PortVlanAssignment + return ret + } + return o.VlanAssignments +} + +// GetVlanAssignmentsOk returns a tuple with the VlanAssignments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PortVlanAssignmentList) GetVlanAssignmentsOk() ([]PortVlanAssignment, bool) { + if o == nil || IsNil(o.VlanAssignments) { + return nil, false + } + return o.VlanAssignments, true +} + +// HasVlanAssignments returns a boolean if a field has been set. +func (o *PortVlanAssignmentList) HasVlanAssignments() bool { + if o != nil && !IsNil(o.VlanAssignments) { + return true + } + + return false +} + +// SetVlanAssignments gets a reference to the given []PortVlanAssignment and assigns it to the VlanAssignments field. +func (o *PortVlanAssignmentList) SetVlanAssignments(v []PortVlanAssignment) { + o.VlanAssignments = v +} + +func (o PortVlanAssignmentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortVlanAssignmentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VlanAssignments) { + toSerialize["vlan_assignments"] = o.VlanAssignments + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PortVlanAssignmentList) UnmarshalJSON(bytes []byte) (err error) { + varPortVlanAssignmentList := _PortVlanAssignmentList{} + + err = json.Unmarshal(bytes, &varPortVlanAssignmentList) + + if err != nil { + return err + } + + *o = PortVlanAssignmentList(varPortVlanAssignmentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "vlan_assignments") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePortVlanAssignmentList struct { + value *PortVlanAssignmentList + isSet bool +} + +func (v NullablePortVlanAssignmentList) Get() *PortVlanAssignmentList { + return v.value +} + +func (v *NullablePortVlanAssignmentList) Set(val *PortVlanAssignmentList) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentList) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentList(val *PortVlanAssignmentList) *NullablePortVlanAssignmentList { + return &NullablePortVlanAssignmentList{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_port_vlan_assignment_state.go b/services/metalv1/model_port_vlan_assignment_state.go new file mode 100644 index 00000000..3497cb71 --- /dev/null +++ b/services/metalv1/model_port_vlan_assignment_state.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// PortVlanAssignmentState the model 'PortVlanAssignmentState' +type PortVlanAssignmentState string + +// List of PortVlanAssignment_state +const ( + PORTVLANASSIGNMENTSTATE_ASSIGNED PortVlanAssignmentState = "assigned" + PORTVLANASSIGNMENTSTATE_UNASSIGNING PortVlanAssignmentState = "unassigning" +) + +// All allowed values of PortVlanAssignmentState enum +var AllowedPortVlanAssignmentStateEnumValues = []PortVlanAssignmentState{ + "assigned", + "unassigning", +} + +func (v *PortVlanAssignmentState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PortVlanAssignmentState(value) + for _, existing := range AllowedPortVlanAssignmentStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PortVlanAssignmentState", value) +} + +// NewPortVlanAssignmentStateFromValue returns a pointer to a valid PortVlanAssignmentState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPortVlanAssignmentStateFromValue(v string) (*PortVlanAssignmentState, error) { + ev := PortVlanAssignmentState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PortVlanAssignmentState: valid values are %v", v, AllowedPortVlanAssignmentStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PortVlanAssignmentState) IsValid() bool { + for _, existing := range AllowedPortVlanAssignmentStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PortVlanAssignment_state value +func (v PortVlanAssignmentState) Ptr() *PortVlanAssignmentState { + return &v +} + +type NullablePortVlanAssignmentState struct { + value *PortVlanAssignmentState + isSet bool +} + +func (v NullablePortVlanAssignmentState) Get() *PortVlanAssignmentState { + return v.value +} + +func (v *NullablePortVlanAssignmentState) Set(val *PortVlanAssignmentState) { + v.value = val + v.isSet = true +} + +func (v NullablePortVlanAssignmentState) IsSet() bool { + return v.isSet +} + +func (v *NullablePortVlanAssignmentState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortVlanAssignmentState(val *PortVlanAssignmentState) *NullablePortVlanAssignmentState { + return &NullablePortVlanAssignmentState{value: val, isSet: true} +} + +func (v NullablePortVlanAssignmentState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortVlanAssignmentState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project.go b/services/metalv1/model_project.go new file mode 100644 index 00000000..fee479b6 --- /dev/null +++ b/services/metalv1/model_project.go @@ -0,0 +1,822 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Project type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Project{} + +// Project struct for Project +type Project struct { + BgpConfig *Href `json:"bgp_config,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Devices []Href `json:"devices,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Invitations []Href `json:"invitations,omitempty"` + MaxDevices map[string]interface{} `json:"max_devices,omitempty"` + Members []Href `json:"members,omitempty"` + Memberships []Href `json:"memberships,omitempty"` + // The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + Name *string `json:"name,omitempty"` + NetworkStatus map[string]interface{} `json:"network_status,omitempty"` + Organization *Organization `json:"organization,omitempty"` + PaymentMethod *Href `json:"payment_method,omitempty"` + SshKeys []Href `json:"ssh_keys,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Volumes []Href `json:"volumes,omitempty"` + Type *ProjectType `json:"type,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Project Project + +// NewProject instantiates a new Project object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProject() *Project { + this := Project{} + return &this +} + +// NewProjectWithDefaults instantiates a new Project object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectWithDefaults() *Project { + this := Project{} + return &this +} + +// GetBgpConfig returns the BgpConfig field value if set, zero value otherwise. +func (o *Project) GetBgpConfig() Href { + if o == nil || IsNil(o.BgpConfig) { + var ret Href + return ret + } + return *o.BgpConfig +} + +// GetBgpConfigOk returns a tuple with the BgpConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetBgpConfigOk() (*Href, bool) { + if o == nil || IsNil(o.BgpConfig) { + return nil, false + } + return o.BgpConfig, true +} + +// HasBgpConfig returns a boolean if a field has been set. +func (o *Project) HasBgpConfig() bool { + if o != nil && !IsNil(o.BgpConfig) { + return true + } + + return false +} + +// SetBgpConfig gets a reference to the given Href and assigns it to the BgpConfig field. +func (o *Project) SetBgpConfig(v Href) { + o.BgpConfig = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Project) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Project) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Project) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *Project) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *Project) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *Project) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDevices returns the Devices field value if set, zero value otherwise. +func (o *Project) GetDevices() []Href { + if o == nil || IsNil(o.Devices) { + var ret []Href + return ret + } + return o.Devices +} + +// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetDevicesOk() ([]Href, bool) { + if o == nil || IsNil(o.Devices) { + return nil, false + } + return o.Devices, true +} + +// HasDevices returns a boolean if a field has been set. +func (o *Project) HasDevices() bool { + if o != nil && !IsNil(o.Devices) { + return true + } + + return false +} + +// SetDevices gets a reference to the given []Href and assigns it to the Devices field. +func (o *Project) SetDevices(v []Href) { + o.Devices = v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Project) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Project) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Project) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Project) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Project) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Project) SetId(v string) { + o.Id = &v +} + +// GetInvitations returns the Invitations field value if set, zero value otherwise. +func (o *Project) GetInvitations() []Href { + if o == nil || IsNil(o.Invitations) { + var ret []Href + return ret + } + return o.Invitations +} + +// GetInvitationsOk returns a tuple with the Invitations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetInvitationsOk() ([]Href, bool) { + if o == nil || IsNil(o.Invitations) { + return nil, false + } + return o.Invitations, true +} + +// HasInvitations returns a boolean if a field has been set. +func (o *Project) HasInvitations() bool { + if o != nil && !IsNil(o.Invitations) { + return true + } + + return false +} + +// SetInvitations gets a reference to the given []Href and assigns it to the Invitations field. +func (o *Project) SetInvitations(v []Href) { + o.Invitations = v +} + +// GetMaxDevices returns the MaxDevices field value if set, zero value otherwise. +func (o *Project) GetMaxDevices() map[string]interface{} { + if o == nil || IsNil(o.MaxDevices) { + var ret map[string]interface{} + return ret + } + return o.MaxDevices +} + +// GetMaxDevicesOk returns a tuple with the MaxDevices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetMaxDevicesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.MaxDevices) { + return map[string]interface{}{}, false + } + return o.MaxDevices, true +} + +// HasMaxDevices returns a boolean if a field has been set. +func (o *Project) HasMaxDevices() bool { + if o != nil && !IsNil(o.MaxDevices) { + return true + } + + return false +} + +// SetMaxDevices gets a reference to the given map[string]interface{} and assigns it to the MaxDevices field. +func (o *Project) SetMaxDevices(v map[string]interface{}) { + o.MaxDevices = v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *Project) GetMembers() []Href { + if o == nil || IsNil(o.Members) { + var ret []Href + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetMembersOk() ([]Href, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *Project) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []Href and assigns it to the Members field. +func (o *Project) SetMembers(v []Href) { + o.Members = v +} + +// GetMemberships returns the Memberships field value if set, zero value otherwise. +func (o *Project) GetMemberships() []Href { + if o == nil || IsNil(o.Memberships) { + var ret []Href + return ret + } + return o.Memberships +} + +// GetMembershipsOk returns a tuple with the Memberships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetMembershipsOk() ([]Href, bool) { + if o == nil || IsNil(o.Memberships) { + return nil, false + } + return o.Memberships, true +} + +// HasMemberships returns a boolean if a field has been set. +func (o *Project) HasMemberships() bool { + if o != nil && !IsNil(o.Memberships) { + return true + } + + return false +} + +// SetMemberships gets a reference to the given []Href and assigns it to the Memberships field. +func (o *Project) SetMemberships(v []Href) { + o.Memberships = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Project) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Project) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Project) SetName(v string) { + o.Name = &v +} + +// GetNetworkStatus returns the NetworkStatus field value if set, zero value otherwise. +func (o *Project) GetNetworkStatus() map[string]interface{} { + if o == nil || IsNil(o.NetworkStatus) { + var ret map[string]interface{} + return ret + } + return o.NetworkStatus +} + +// GetNetworkStatusOk returns a tuple with the NetworkStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetNetworkStatusOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.NetworkStatus) { + return map[string]interface{}{}, false + } + return o.NetworkStatus, true +} + +// HasNetworkStatus returns a boolean if a field has been set. +func (o *Project) HasNetworkStatus() bool { + if o != nil && !IsNil(o.NetworkStatus) { + return true + } + + return false +} + +// SetNetworkStatus gets a reference to the given map[string]interface{} and assigns it to the NetworkStatus field. +func (o *Project) SetNetworkStatus(v map[string]interface{}) { + o.NetworkStatus = v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *Project) GetOrganization() Organization { + if o == nil || IsNil(o.Organization) { + var ret Organization + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetOrganizationOk() (*Organization, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *Project) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given Organization and assigns it to the Organization field. +func (o *Project) SetOrganization(v Organization) { + o.Organization = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *Project) GetPaymentMethod() Href { + if o == nil || IsNil(o.PaymentMethod) { + var ret Href + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetPaymentMethodOk() (*Href, bool) { + if o == nil || IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *Project) HasPaymentMethod() bool { + if o != nil && !IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given Href and assigns it to the PaymentMethod field. +func (o *Project) SetPaymentMethod(v Href) { + o.PaymentMethod = &v +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *Project) GetSshKeys() []Href { + if o == nil || IsNil(o.SshKeys) { + var ret []Href + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetSshKeysOk() ([]Href, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *Project) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []Href and assigns it to the SshKeys field. +func (o *Project) SetSshKeys(v []Href) { + o.SshKeys = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Project) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Project) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Project) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Project) GetVolumes() []Href { + if o == nil || IsNil(o.Volumes) { + var ret []Href + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetVolumesOk() ([]Href, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Project) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []Href and assigns it to the Volumes field. +func (o *Project) SetVolumes(v []Href) { + o.Volumes = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *Project) GetType() ProjectType { + if o == nil || IsNil(o.Type) { + var ret ProjectType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetTypeOk() (*ProjectType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *Project) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ProjectType and assigns it to the Type field. +func (o *Project) SetType(v ProjectType) { + o.Type = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Project) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Project) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Project) SetTags(v []string) { + o.Tags = v +} + +func (o Project) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Project) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpConfig) { + toSerialize["bgp_config"] = o.BgpConfig + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Devices) { + toSerialize["devices"] = o.Devices + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Invitations) { + toSerialize["invitations"] = o.Invitations + } + if !IsNil(o.MaxDevices) { + toSerialize["max_devices"] = o.MaxDevices + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + if !IsNil(o.Memberships) { + toSerialize["memberships"] = o.Memberships + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkStatus) { + toSerialize["network_status"] = o.NetworkStatus + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.PaymentMethod) { + toSerialize["payment_method"] = o.PaymentMethod + } + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Project) UnmarshalJSON(bytes []byte) (err error) { + varProject := _Project{} + + err = json.Unmarshal(bytes, &varProject) + + if err != nil { + return err + } + + *o = Project(varProject) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_config") + delete(additionalProperties, "created_at") + delete(additionalProperties, "customdata") + delete(additionalProperties, "devices") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "invitations") + delete(additionalProperties, "max_devices") + delete(additionalProperties, "members") + delete(additionalProperties, "memberships") + delete(additionalProperties, "name") + delete(additionalProperties, "network_status") + delete(additionalProperties, "organization") + delete(additionalProperties, "payment_method") + delete(additionalProperties, "ssh_keys") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "volumes") + delete(additionalProperties, "type") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProject struct { + value *Project + isSet bool +} + +func (v NullableProject) Get() *Project { + return v.value +} + +func (v *NullableProject) Set(val *Project) { + v.value = val + v.isSet = true +} + +func (v NullableProject) IsSet() bool { + return v.isSet +} + +func (v *NullableProject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProject(val *Project) *NullableProject { + return &NullableProject{value: val, isSet: true} +} + +func (v NullableProject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_create_from_root_input.go b/services/metalv1/model_project_create_from_root_input.go new file mode 100644 index 00000000..d46c81a7 --- /dev/null +++ b/services/metalv1/model_project_create_from_root_input.go @@ -0,0 +1,353 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectCreateFromRootInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectCreateFromRootInput{} + +// ProjectCreateFromRootInput struct for ProjectCreateFromRootInput +type ProjectCreateFromRootInput struct { + Customdata map[string]interface{} `json:"customdata,omitempty"` + // The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + Name string `json:"name"` + OrganizationId *string `json:"organization_id,omitempty"` + PaymentMethodId *string `json:"payment_method_id,omitempty"` + Type *ProjectCreateFromRootInputType `json:"type,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectCreateFromRootInput ProjectCreateFromRootInput + +// NewProjectCreateFromRootInput instantiates a new ProjectCreateFromRootInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectCreateFromRootInput(name string) *ProjectCreateFromRootInput { + this := ProjectCreateFromRootInput{} + this.Name = name + return &this +} + +// NewProjectCreateFromRootInputWithDefaults instantiates a new ProjectCreateFromRootInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectCreateFromRootInputWithDefaults() *ProjectCreateFromRootInput { + this := ProjectCreateFromRootInput{} + return &this +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *ProjectCreateFromRootInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *ProjectCreateFromRootInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *ProjectCreateFromRootInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetName returns the Name field value +func (o *ProjectCreateFromRootInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProjectCreateFromRootInput) SetName(v string) { + o.Name = v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *ProjectCreateFromRootInput) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *ProjectCreateFromRootInput) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *ProjectCreateFromRootInput) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetPaymentMethodId returns the PaymentMethodId field value if set, zero value otherwise. +func (o *ProjectCreateFromRootInput) GetPaymentMethodId() string { + if o == nil || IsNil(o.PaymentMethodId) { + var ret string + return ret + } + return *o.PaymentMethodId +} + +// GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetPaymentMethodIdOk() (*string, bool) { + if o == nil || IsNil(o.PaymentMethodId) { + return nil, false + } + return o.PaymentMethodId, true +} + +// HasPaymentMethodId returns a boolean if a field has been set. +func (o *ProjectCreateFromRootInput) HasPaymentMethodId() bool { + if o != nil && !IsNil(o.PaymentMethodId) { + return true + } + + return false +} + +// SetPaymentMethodId gets a reference to the given string and assigns it to the PaymentMethodId field. +func (o *ProjectCreateFromRootInput) SetPaymentMethodId(v string) { + o.PaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ProjectCreateFromRootInput) GetType() ProjectCreateFromRootInputType { + if o == nil || IsNil(o.Type) { + var ret ProjectCreateFromRootInputType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetTypeOk() (*ProjectCreateFromRootInputType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ProjectCreateFromRootInput) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ProjectCreateFromRootInputType and assigns it to the Type field. +func (o *ProjectCreateFromRootInput) SetType(v ProjectCreateFromRootInputType) { + o.Type = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProjectCreateFromRootInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateFromRootInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProjectCreateFromRootInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ProjectCreateFromRootInput) SetTags(v []string) { + o.Tags = v +} + +func (o ProjectCreateFromRootInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectCreateFromRootInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + toSerialize["name"] = o.Name + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.PaymentMethodId) { + toSerialize["payment_method_id"] = o.PaymentMethodId + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectCreateFromRootInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectCreateFromRootInput := _ProjectCreateFromRootInput{} + + err = json.Unmarshal(bytes, &varProjectCreateFromRootInput) + + if err != nil { + return err + } + + *o = ProjectCreateFromRootInput(varProjectCreateFromRootInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customdata") + delete(additionalProperties, "name") + delete(additionalProperties, "organization_id") + delete(additionalProperties, "payment_method_id") + delete(additionalProperties, "type") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectCreateFromRootInput struct { + value *ProjectCreateFromRootInput + isSet bool +} + +func (v NullableProjectCreateFromRootInput) Get() *ProjectCreateFromRootInput { + return v.value +} + +func (v *NullableProjectCreateFromRootInput) Set(val *ProjectCreateFromRootInput) { + v.value = val + v.isSet = true +} + +func (v NullableProjectCreateFromRootInput) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectCreateFromRootInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectCreateFromRootInput(val *ProjectCreateFromRootInput) *NullableProjectCreateFromRootInput { + return &NullableProjectCreateFromRootInput{value: val, isSet: true} +} + +func (v NullableProjectCreateFromRootInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectCreateFromRootInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_create_from_root_input_type.go b/services/metalv1/model_project_create_from_root_input_type.go new file mode 100644 index 00000000..a9fbbedd --- /dev/null +++ b/services/metalv1/model_project_create_from_root_input_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// ProjectCreateFromRootInputType The type of the project. If no type is specified the project type will automatically be `default` Projects of type 'vmce' are part of an in development feature and not available to all customers. +type ProjectCreateFromRootInputType string + +// List of ProjectCreateFromRootInput_type +const ( + PROJECTCREATEFROMROOTINPUTTYPE_DEFAULT ProjectCreateFromRootInputType = "default" + PROJECTCREATEFROMROOTINPUTTYPE_VMCE ProjectCreateFromRootInputType = "vmce" +) + +// All allowed values of ProjectCreateFromRootInputType enum +var AllowedProjectCreateFromRootInputTypeEnumValues = []ProjectCreateFromRootInputType{ + "default", + "vmce", +} + +func (v *ProjectCreateFromRootInputType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProjectCreateFromRootInputType(value) + for _, existing := range AllowedProjectCreateFromRootInputTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProjectCreateFromRootInputType", value) +} + +// NewProjectCreateFromRootInputTypeFromValue returns a pointer to a valid ProjectCreateFromRootInputType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProjectCreateFromRootInputTypeFromValue(v string) (*ProjectCreateFromRootInputType, error) { + ev := ProjectCreateFromRootInputType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProjectCreateFromRootInputType: valid values are %v", v, AllowedProjectCreateFromRootInputTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProjectCreateFromRootInputType) IsValid() bool { + for _, existing := range AllowedProjectCreateFromRootInputTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProjectCreateFromRootInput_type value +func (v ProjectCreateFromRootInputType) Ptr() *ProjectCreateFromRootInputType { + return &v +} + +type NullableProjectCreateFromRootInputType struct { + value *ProjectCreateFromRootInputType + isSet bool +} + +func (v NullableProjectCreateFromRootInputType) Get() *ProjectCreateFromRootInputType { + return v.value +} + +func (v *NullableProjectCreateFromRootInputType) Set(val *ProjectCreateFromRootInputType) { + v.value = val + v.isSet = true +} + +func (v NullableProjectCreateFromRootInputType) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectCreateFromRootInputType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectCreateFromRootInputType(val *ProjectCreateFromRootInputType) *NullableProjectCreateFromRootInputType { + return &NullableProjectCreateFromRootInputType{value: val, isSet: true} +} + +func (v NullableProjectCreateFromRootInputType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectCreateFromRootInputType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_create_input.go b/services/metalv1/model_project_create_input.go new file mode 100644 index 00000000..f7b1a3ca --- /dev/null +++ b/services/metalv1/model_project_create_input.go @@ -0,0 +1,316 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProjectCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectCreateInput{} + +// ProjectCreateInput struct for ProjectCreateInput +type ProjectCreateInput struct { + Customdata map[string]interface{} `json:"customdata,omitempty"` + // The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + Name string `json:"name"` + PaymentMethodId *string `json:"payment_method_id,omitempty"` + Type *ProjectCreateFromRootInputType `json:"type,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectCreateInput ProjectCreateInput + +// NewProjectCreateInput instantiates a new ProjectCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectCreateInput(name string) *ProjectCreateInput { + this := ProjectCreateInput{} + this.Name = name + return &this +} + +// NewProjectCreateInputWithDefaults instantiates a new ProjectCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectCreateInputWithDefaults() *ProjectCreateInput { + this := ProjectCreateInput{} + return &this +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *ProjectCreateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *ProjectCreateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *ProjectCreateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetName returns the Name field value +func (o *ProjectCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProjectCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProjectCreateInput) SetName(v string) { + o.Name = v +} + +// GetPaymentMethodId returns the PaymentMethodId field value if set, zero value otherwise. +func (o *ProjectCreateInput) GetPaymentMethodId() string { + if o == nil || IsNil(o.PaymentMethodId) { + var ret string + return ret + } + return *o.PaymentMethodId +} + +// GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateInput) GetPaymentMethodIdOk() (*string, bool) { + if o == nil || IsNil(o.PaymentMethodId) { + return nil, false + } + return o.PaymentMethodId, true +} + +// HasPaymentMethodId returns a boolean if a field has been set. +func (o *ProjectCreateInput) HasPaymentMethodId() bool { + if o != nil && !IsNil(o.PaymentMethodId) { + return true + } + + return false +} + +// SetPaymentMethodId gets a reference to the given string and assigns it to the PaymentMethodId field. +func (o *ProjectCreateInput) SetPaymentMethodId(v string) { + o.PaymentMethodId = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ProjectCreateInput) GetType() ProjectCreateFromRootInputType { + if o == nil || IsNil(o.Type) { + var ret ProjectCreateFromRootInputType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateInput) GetTypeOk() (*ProjectCreateFromRootInputType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ProjectCreateInput) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given ProjectCreateFromRootInputType and assigns it to the Type field. +func (o *ProjectCreateInput) SetType(v ProjectCreateFromRootInputType) { + o.Type = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProjectCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProjectCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ProjectCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o ProjectCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + toSerialize["name"] = o.Name + if !IsNil(o.PaymentMethodId) { + toSerialize["payment_method_id"] = o.PaymentMethodId + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectCreateInput := _ProjectCreateInput{} + + err = json.Unmarshal(bytes, &varProjectCreateInput) + + if err != nil { + return err + } + + *o = ProjectCreateInput(varProjectCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customdata") + delete(additionalProperties, "name") + delete(additionalProperties, "payment_method_id") + delete(additionalProperties, "type") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectCreateInput struct { + value *ProjectCreateInput + isSet bool +} + +func (v NullableProjectCreateInput) Get() *ProjectCreateInput { + return v.value +} + +func (v *NullableProjectCreateInput) Set(val *ProjectCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableProjectCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectCreateInput(val *ProjectCreateInput) *NullableProjectCreateInput { + return &NullableProjectCreateInput{value: val, isSet: true} +} + +func (v NullableProjectCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_id_name.go b/services/metalv1/model_project_id_name.go new file mode 100644 index 00000000..6a22d94b --- /dev/null +++ b/services/metalv1/model_project_id_name.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ProjectIdName type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectIdName{} + +// ProjectIdName struct for ProjectIdName +type ProjectIdName struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectIdName ProjectIdName + +// NewProjectIdName instantiates a new ProjectIdName object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectIdName() *ProjectIdName { + this := ProjectIdName{} + return &this +} + +// NewProjectIdNameWithDefaults instantiates a new ProjectIdName object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectIdNameWithDefaults() *ProjectIdName { + this := ProjectIdName{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ProjectIdName) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectIdName) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ProjectIdName) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ProjectIdName) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ProjectIdName) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectIdName) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ProjectIdName) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ProjectIdName) SetName(v string) { + o.Name = &v +} + +func (o ProjectIdName) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectIdName) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectIdName) UnmarshalJSON(bytes []byte) (err error) { + varProjectIdName := _ProjectIdName{} + + err = json.Unmarshal(bytes, &varProjectIdName) + + if err != nil { + return err + } + + *o = ProjectIdName(varProjectIdName) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectIdName struct { + value *ProjectIdName + isSet bool +} + +func (v NullableProjectIdName) Get() *ProjectIdName { + return v.value +} + +func (v *NullableProjectIdName) Set(val *ProjectIdName) { + v.value = val + v.isSet = true +} + +func (v NullableProjectIdName) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectIdName) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectIdName(val *ProjectIdName) *NullableProjectIdName { + return &NullableProjectIdName{value: val, isSet: true} +} + +func (v NullableProjectIdName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectIdName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_list.go b/services/metalv1/model_project_list.go new file mode 100644 index 00000000..c1703ac7 --- /dev/null +++ b/services/metalv1/model_project_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ProjectList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectList{} + +// ProjectList struct for ProjectList +type ProjectList struct { + Meta *Meta `json:"meta,omitempty"` + Projects []Project `json:"projects,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectList ProjectList + +// NewProjectList instantiates a new ProjectList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectList() *ProjectList { + this := ProjectList{} + return &this +} + +// NewProjectListWithDefaults instantiates a new ProjectList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectListWithDefaults() *ProjectList { + this := ProjectList{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ProjectList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ProjectList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *ProjectList) SetMeta(v Meta) { + o.Meta = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *ProjectList) GetProjects() []Project { + if o == nil || IsNil(o.Projects) { + var ret []Project + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectList) GetProjectsOk() ([]Project, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *ProjectList) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []Project and assigns it to the Projects field. +func (o *ProjectList) SetProjects(v []Project) { + o.Projects = v +} + +func (o ProjectList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectList) UnmarshalJSON(bytes []byte) (err error) { + varProjectList := _ProjectList{} + + err = json.Unmarshal(bytes, &varProjectList) + + if err != nil { + return err + } + + *o = ProjectList(varProjectList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "meta") + delete(additionalProperties, "projects") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectList struct { + value *ProjectList + isSet bool +} + +func (v NullableProjectList) Get() *ProjectList { + return v.value +} + +func (v *NullableProjectList) Set(val *ProjectList) { + v.value = val + v.isSet = true +} + +func (v NullableProjectList) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectList(val *ProjectList) *NullableProjectList { + return &NullableProjectList{value: val, isSet: true} +} + +func (v NullableProjectList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_type.go b/services/metalv1/model_project_type.go new file mode 100644 index 00000000..31b608d3 --- /dev/null +++ b/services/metalv1/model_project_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// ProjectType The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. +type ProjectType string + +// List of Project_type +const ( + PROJECTTYPE_DEFAULT ProjectType = "default" + PROJECTTYPE_VMCE ProjectType = "vmce" +) + +// All allowed values of ProjectType enum +var AllowedProjectTypeEnumValues = []ProjectType{ + "default", + "vmce", +} + +func (v *ProjectType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProjectType(value) + for _, existing := range AllowedProjectTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProjectType", value) +} + +// NewProjectTypeFromValue returns a pointer to a valid ProjectType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProjectTypeFromValue(v string) (*ProjectType, error) { + ev := ProjectType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProjectType: valid values are %v", v, AllowedProjectTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProjectType) IsValid() bool { + for _, existing := range AllowedProjectTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Project_type value +func (v ProjectType) Ptr() *ProjectType { + return &v +} + +type NullableProjectType struct { + value *ProjectType + isSet bool +} + +func (v NullableProjectType) Get() *ProjectType { + return v.value +} + +func (v *NullableProjectType) Set(val *ProjectType) { + v.value = val + v.isSet = true +} + +func (v NullableProjectType) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectType(val *ProjectType) *NullableProjectType { + return &NullableProjectType{value: val, isSet: true} +} + +func (v NullableProjectType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_update_input.go b/services/metalv1/model_project_update_input.go new file mode 100644 index 00000000..4f739525 --- /dev/null +++ b/services/metalv1/model_project_update_input.go @@ -0,0 +1,303 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ProjectUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectUpdateInput{} + +// ProjectUpdateInput struct for ProjectUpdateInput +type ProjectUpdateInput struct { + BackendTransferEnabled *bool `json:"backend_transfer_enabled,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + // The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + Name *string `json:"name,omitempty"` + PaymentMethodId *string `json:"payment_method_id,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectUpdateInput ProjectUpdateInput + +// NewProjectUpdateInput instantiates a new ProjectUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectUpdateInput() *ProjectUpdateInput { + this := ProjectUpdateInput{} + return &this +} + +// NewProjectUpdateInputWithDefaults instantiates a new ProjectUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectUpdateInputWithDefaults() *ProjectUpdateInput { + this := ProjectUpdateInput{} + return &this +} + +// GetBackendTransferEnabled returns the BackendTransferEnabled field value if set, zero value otherwise. +func (o *ProjectUpdateInput) GetBackendTransferEnabled() bool { + if o == nil || IsNil(o.BackendTransferEnabled) { + var ret bool + return ret + } + return *o.BackendTransferEnabled +} + +// GetBackendTransferEnabledOk returns a tuple with the BackendTransferEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUpdateInput) GetBackendTransferEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BackendTransferEnabled) { + return nil, false + } + return o.BackendTransferEnabled, true +} + +// HasBackendTransferEnabled returns a boolean if a field has been set. +func (o *ProjectUpdateInput) HasBackendTransferEnabled() bool { + if o != nil && !IsNil(o.BackendTransferEnabled) { + return true + } + + return false +} + +// SetBackendTransferEnabled gets a reference to the given bool and assigns it to the BackendTransferEnabled field. +func (o *ProjectUpdateInput) SetBackendTransferEnabled(v bool) { + o.BackendTransferEnabled = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *ProjectUpdateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUpdateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *ProjectUpdateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *ProjectUpdateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ProjectUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ProjectUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ProjectUpdateInput) SetName(v string) { + o.Name = &v +} + +// GetPaymentMethodId returns the PaymentMethodId field value if set, zero value otherwise. +func (o *ProjectUpdateInput) GetPaymentMethodId() string { + if o == nil || IsNil(o.PaymentMethodId) { + var ret string + return ret + } + return *o.PaymentMethodId +} + +// GetPaymentMethodIdOk returns a tuple with the PaymentMethodId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUpdateInput) GetPaymentMethodIdOk() (*string, bool) { + if o == nil || IsNil(o.PaymentMethodId) { + return nil, false + } + return o.PaymentMethodId, true +} + +// HasPaymentMethodId returns a boolean if a field has been set. +func (o *ProjectUpdateInput) HasPaymentMethodId() bool { + if o != nil && !IsNil(o.PaymentMethodId) { + return true + } + + return false +} + +// SetPaymentMethodId gets a reference to the given string and assigns it to the PaymentMethodId field. +func (o *ProjectUpdateInput) SetPaymentMethodId(v string) { + o.PaymentMethodId = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ProjectUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ProjectUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ProjectUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o ProjectUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackendTransferEnabled) { + toSerialize["backend_transfer_enabled"] = o.BackendTransferEnabled + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PaymentMethodId) { + toSerialize["payment_method_id"] = o.PaymentMethodId + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varProjectUpdateInput := _ProjectUpdateInput{} + + err = json.Unmarshal(bytes, &varProjectUpdateInput) + + if err != nil { + return err + } + + *o = ProjectUpdateInput(varProjectUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "backend_transfer_enabled") + delete(additionalProperties, "customdata") + delete(additionalProperties, "name") + delete(additionalProperties, "payment_method_id") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectUpdateInput struct { + value *ProjectUpdateInput + isSet bool +} + +func (v NullableProjectUpdateInput) Get() *ProjectUpdateInput { + return v.value +} + +func (v *NullableProjectUpdateInput) Set(val *ProjectUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableProjectUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectUpdateInput(val *ProjectUpdateInput) *NullableProjectUpdateInput { + return &NullableProjectUpdateInput{value: val, isSet: true} +} + +func (v NullableProjectUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_usage.go b/services/metalv1/model_project_usage.go new file mode 100644 index 00000000..5c6fc079 --- /dev/null +++ b/services/metalv1/model_project_usage.go @@ -0,0 +1,450 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ProjectUsage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectUsage{} + +// ProjectUsage struct for ProjectUsage +type ProjectUsage struct { + Facility *string `json:"facility,omitempty"` + Name *string `json:"name,omitempty"` + Plan *string `json:"plan,omitempty"` + PlanVersion *string `json:"plan_version,omitempty"` + Price *string `json:"price,omitempty"` + Quantity *string `json:"quantity,omitempty"` + Total *string `json:"total,omitempty"` + Type *string `json:"type,omitempty"` + Unit *string `json:"unit,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectUsage ProjectUsage + +// NewProjectUsage instantiates a new ProjectUsage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectUsage() *ProjectUsage { + this := ProjectUsage{} + return &this +} + +// NewProjectUsageWithDefaults instantiates a new ProjectUsage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectUsageWithDefaults() *ProjectUsage { + this := ProjectUsage{} + return &this +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *ProjectUsage) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *ProjectUsage) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +func (o *ProjectUsage) SetFacility(v string) { + o.Facility = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ProjectUsage) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ProjectUsage) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ProjectUsage) SetName(v string) { + o.Name = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *ProjectUsage) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *ProjectUsage) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *ProjectUsage) SetPlan(v string) { + o.Plan = &v +} + +// GetPlanVersion returns the PlanVersion field value if set, zero value otherwise. +func (o *ProjectUsage) GetPlanVersion() string { + if o == nil || IsNil(o.PlanVersion) { + var ret string + return ret + } + return *o.PlanVersion +} + +// GetPlanVersionOk returns a tuple with the PlanVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetPlanVersionOk() (*string, bool) { + if o == nil || IsNil(o.PlanVersion) { + return nil, false + } + return o.PlanVersion, true +} + +// HasPlanVersion returns a boolean if a field has been set. +func (o *ProjectUsage) HasPlanVersion() bool { + if o != nil && !IsNil(o.PlanVersion) { + return true + } + + return false +} + +// SetPlanVersion gets a reference to the given string and assigns it to the PlanVersion field. +func (o *ProjectUsage) SetPlanVersion(v string) { + o.PlanVersion = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *ProjectUsage) GetPrice() string { + if o == nil || IsNil(o.Price) { + var ret string + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetPriceOk() (*string, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *ProjectUsage) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given string and assigns it to the Price field. +func (o *ProjectUsage) SetPrice(v string) { + o.Price = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *ProjectUsage) GetQuantity() string { + if o == nil || IsNil(o.Quantity) { + var ret string + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetQuantityOk() (*string, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *ProjectUsage) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given string and assigns it to the Quantity field. +func (o *ProjectUsage) SetQuantity(v string) { + o.Quantity = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *ProjectUsage) GetTotal() string { + if o == nil || IsNil(o.Total) { + var ret string + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetTotalOk() (*string, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *ProjectUsage) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given string and assigns it to the Total field. +func (o *ProjectUsage) SetTotal(v string) { + o.Total = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ProjectUsage) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ProjectUsage) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ProjectUsage) SetType(v string) { + o.Type = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *ProjectUsage) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsage) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *ProjectUsage) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *ProjectUsage) SetUnit(v string) { + o.Unit = &v +} + +func (o ProjectUsage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectUsage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.PlanVersion) { + toSerialize["plan_version"] = o.PlanVersion + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectUsage) UnmarshalJSON(bytes []byte) (err error) { + varProjectUsage := _ProjectUsage{} + + err = json.Unmarshal(bytes, &varProjectUsage) + + if err != nil { + return err + } + + *o = ProjectUsage(varProjectUsage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "facility") + delete(additionalProperties, "name") + delete(additionalProperties, "plan") + delete(additionalProperties, "plan_version") + delete(additionalProperties, "price") + delete(additionalProperties, "quantity") + delete(additionalProperties, "total") + delete(additionalProperties, "type") + delete(additionalProperties, "unit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectUsage struct { + value *ProjectUsage + isSet bool +} + +func (v NullableProjectUsage) Get() *ProjectUsage { + return v.value +} + +func (v *NullableProjectUsage) Set(val *ProjectUsage) { + v.value = val + v.isSet = true +} + +func (v NullableProjectUsage) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectUsage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectUsage(val *ProjectUsage) *NullableProjectUsage { + return &NullableProjectUsage{value: val, isSet: true} +} + +func (v NullableProjectUsage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectUsage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_project_usage_list.go b/services/metalv1/model_project_usage_list.go new file mode 100644 index 00000000..35e4889d --- /dev/null +++ b/services/metalv1/model_project_usage_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ProjectUsageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectUsageList{} + +// ProjectUsageList struct for ProjectUsageList +type ProjectUsageList struct { + Usages []ProjectUsage `json:"usages,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProjectUsageList ProjectUsageList + +// NewProjectUsageList instantiates a new ProjectUsageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectUsageList() *ProjectUsageList { + this := ProjectUsageList{} + return &this +} + +// NewProjectUsageListWithDefaults instantiates a new ProjectUsageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectUsageListWithDefaults() *ProjectUsageList { + this := ProjectUsageList{} + return &this +} + +// GetUsages returns the Usages field value if set, zero value otherwise. +func (o *ProjectUsageList) GetUsages() []ProjectUsage { + if o == nil || IsNil(o.Usages) { + var ret []ProjectUsage + return ret + } + return o.Usages +} + +// GetUsagesOk returns a tuple with the Usages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProjectUsageList) GetUsagesOk() ([]ProjectUsage, bool) { + if o == nil || IsNil(o.Usages) { + return nil, false + } + return o.Usages, true +} + +// HasUsages returns a boolean if a field has been set. +func (o *ProjectUsageList) HasUsages() bool { + if o != nil && !IsNil(o.Usages) { + return true + } + + return false +} + +// SetUsages gets a reference to the given []ProjectUsage and assigns it to the Usages field. +func (o *ProjectUsageList) SetUsages(v []ProjectUsage) { + o.Usages = v +} + +func (o ProjectUsageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectUsageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Usages) { + toSerialize["usages"] = o.Usages + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProjectUsageList) UnmarshalJSON(bytes []byte) (err error) { + varProjectUsageList := _ProjectUsageList{} + + err = json.Unmarshal(bytes, &varProjectUsageList) + + if err != nil { + return err + } + + *o = ProjectUsageList(varProjectUsageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "usages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProjectUsageList struct { + value *ProjectUsageList + isSet bool +} + +func (v NullableProjectUsageList) Get() *ProjectUsageList { + return v.value +} + +func (v *NullableProjectUsageList) Set(val *ProjectUsageList) { + v.value = val + v.isSet = true +} + +func (v NullableProjectUsageList) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectUsageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectUsageList(val *ProjectUsageList) *NullableProjectUsageList { + return &NullableProjectUsageList{value: val, isSet: true} +} + +func (v NullableProjectUsageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectUsageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_raid.go b/services/metalv1/model_raid.go new file mode 100644 index 00000000..12a9ebf3 --- /dev/null +++ b/services/metalv1/model_raid.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Raid type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Raid{} + +// Raid struct for Raid +type Raid struct { + Devices []string `json:"devices,omitempty"` + Level *string `json:"level,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Raid Raid + +// NewRaid instantiates a new Raid object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRaid() *Raid { + this := Raid{} + return &this +} + +// NewRaidWithDefaults instantiates a new Raid object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRaidWithDefaults() *Raid { + this := Raid{} + return &this +} + +// GetDevices returns the Devices field value if set, zero value otherwise. +func (o *Raid) GetDevices() []string { + if o == nil || IsNil(o.Devices) { + var ret []string + return ret + } + return o.Devices +} + +// GetDevicesOk returns a tuple with the Devices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Raid) GetDevicesOk() ([]string, bool) { + if o == nil || IsNil(o.Devices) { + return nil, false + } + return o.Devices, true +} + +// HasDevices returns a boolean if a field has been set. +func (o *Raid) HasDevices() bool { + if o != nil && !IsNil(o.Devices) { + return true + } + + return false +} + +// SetDevices gets a reference to the given []string and assigns it to the Devices field. +func (o *Raid) SetDevices(v []string) { + o.Devices = v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *Raid) GetLevel() string { + if o == nil || IsNil(o.Level) { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Raid) GetLevelOk() (*string, bool) { + if o == nil || IsNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *Raid) HasLevel() bool { + if o != nil && !IsNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *Raid) SetLevel(v string) { + o.Level = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Raid) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Raid) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Raid) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Raid) SetName(v string) { + o.Name = &v +} + +func (o Raid) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Raid) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Devices) { + toSerialize["devices"] = o.Devices + } + if !IsNil(o.Level) { + toSerialize["level"] = o.Level + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Raid) UnmarshalJSON(bytes []byte) (err error) { + varRaid := _Raid{} + + err = json.Unmarshal(bytes, &varRaid) + + if err != nil { + return err + } + + *o = Raid(varRaid) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "devices") + delete(additionalProperties, "level") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRaid struct { + value *Raid + isSet bool +} + +func (v NullableRaid) Get() *Raid { + return v.value +} + +func (v *NullableRaid) Set(val *Raid) { + v.value = val + v.isSet = true +} + +func (v NullableRaid) IsSet() bool { + return v.isSet +} + +func (v *NullableRaid) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRaid(val *Raid) *NullableRaid { + return &NullableRaid{value: val, isSet: true} +} + +func (v NullableRaid) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRaid) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_recovery_code_list.go b/services/metalv1/model_recovery_code_list.go new file mode 100644 index 00000000..12b672d6 --- /dev/null +++ b/services/metalv1/model_recovery_code_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the RecoveryCodeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RecoveryCodeList{} + +// RecoveryCodeList struct for RecoveryCodeList +type RecoveryCodeList struct { + RecoveryCodes []string `json:"recovery_codes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RecoveryCodeList RecoveryCodeList + +// NewRecoveryCodeList instantiates a new RecoveryCodeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRecoveryCodeList() *RecoveryCodeList { + this := RecoveryCodeList{} + return &this +} + +// NewRecoveryCodeListWithDefaults instantiates a new RecoveryCodeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRecoveryCodeListWithDefaults() *RecoveryCodeList { + this := RecoveryCodeList{} + return &this +} + +// GetRecoveryCodes returns the RecoveryCodes field value if set, zero value otherwise. +func (o *RecoveryCodeList) GetRecoveryCodes() []string { + if o == nil || IsNil(o.RecoveryCodes) { + var ret []string + return ret + } + return o.RecoveryCodes +} + +// GetRecoveryCodesOk returns a tuple with the RecoveryCodes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RecoveryCodeList) GetRecoveryCodesOk() ([]string, bool) { + if o == nil || IsNil(o.RecoveryCodes) { + return nil, false + } + return o.RecoveryCodes, true +} + +// HasRecoveryCodes returns a boolean if a field has been set. +func (o *RecoveryCodeList) HasRecoveryCodes() bool { + if o != nil && !IsNil(o.RecoveryCodes) { + return true + } + + return false +} + +// SetRecoveryCodes gets a reference to the given []string and assigns it to the RecoveryCodes field. +func (o *RecoveryCodeList) SetRecoveryCodes(v []string) { + o.RecoveryCodes = v +} + +func (o RecoveryCodeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RecoveryCodeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RecoveryCodes) { + toSerialize["recovery_codes"] = o.RecoveryCodes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RecoveryCodeList) UnmarshalJSON(bytes []byte) (err error) { + varRecoveryCodeList := _RecoveryCodeList{} + + err = json.Unmarshal(bytes, &varRecoveryCodeList) + + if err != nil { + return err + } + + *o = RecoveryCodeList(varRecoveryCodeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "recovery_codes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRecoveryCodeList struct { + value *RecoveryCodeList + isSet bool +} + +func (v NullableRecoveryCodeList) Get() *RecoveryCodeList { + return v.value +} + +func (v *NullableRecoveryCodeList) Set(val *RecoveryCodeList) { + v.value = val + v.isSet = true +} + +func (v NullableRecoveryCodeList) IsSet() bool { + return v.isSet +} + +func (v *NullableRecoveryCodeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRecoveryCodeList(val *RecoveryCodeList) *NullableRecoveryCodeList { + return &NullableRecoveryCodeList{value: val, isSet: true} +} + +func (v NullableRecoveryCodeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRecoveryCodeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_request_ip_reservation_201_response.go b/services/metalv1/model_request_ip_reservation_201_response.go new file mode 100644 index 00000000..b47b2a0b --- /dev/null +++ b/services/metalv1/model_request_ip_reservation_201_response.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// RequestIPReservation201Response - struct for RequestIPReservation201Response +type RequestIPReservation201Response struct { + IPReservation *IPReservation + VrfIpReservation *VrfIpReservation +} + +// IPReservationAsRequestIPReservation201Response is a convenience function that returns IPReservation wrapped in RequestIPReservation201Response +func IPReservationAsRequestIPReservation201Response(v *IPReservation) RequestIPReservation201Response { + return RequestIPReservation201Response{ + IPReservation: v, + } +} + +// VrfIpReservationAsRequestIPReservation201Response is a convenience function that returns VrfIpReservation wrapped in RequestIPReservation201Response +func VrfIpReservationAsRequestIPReservation201Response(v *VrfIpReservation) RequestIPReservation201Response { + return RequestIPReservation201Response{ + VrfIpReservation: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RequestIPReservation201Response) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IPReservation + err = newStrictDecoder(data).Decode(&dst.IPReservation) + if err == nil { + jsonIPReservation, _ := json.Marshal(dst.IPReservation) + if string(jsonIPReservation) == "{}" { // empty struct + dst.IPReservation = nil + } else { + match++ + } + } else { + dst.IPReservation = nil + } + + // try to unmarshal data into VrfIpReservation + err = newStrictDecoder(data).Decode(&dst.VrfIpReservation) + if err == nil { + jsonVrfIpReservation, _ := json.Marshal(dst.VrfIpReservation) + if string(jsonVrfIpReservation) == "{}" { // empty struct + dst.VrfIpReservation = nil + } else { + match++ + } + } else { + dst.VrfIpReservation = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IPReservation = nil + dst.VrfIpReservation = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RequestIPReservation201Response)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RequestIPReservation201Response)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RequestIPReservation201Response) MarshalJSON() ([]byte, error) { + if src.IPReservation != nil { + return json.Marshal(&src.IPReservation) + } + + if src.VrfIpReservation != nil { + return json.Marshal(&src.VrfIpReservation) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RequestIPReservation201Response) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.IPReservation != nil { + return obj.IPReservation + } + + if obj.VrfIpReservation != nil { + return obj.VrfIpReservation + } + + // all schemas are nil + return nil +} + +type NullableRequestIPReservation201Response struct { + value *RequestIPReservation201Response + isSet bool +} + +func (v NullableRequestIPReservation201Response) Get() *RequestIPReservation201Response { + return v.value +} + +func (v *NullableRequestIPReservation201Response) Set(val *RequestIPReservation201Response) { + v.value = val + v.isSet = true +} + +func (v NullableRequestIPReservation201Response) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestIPReservation201Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestIPReservation201Response(val *RequestIPReservation201Response) *NullableRequestIPReservation201Response { + return &NullableRequestIPReservation201Response{value: val, isSet: true} +} + +func (v NullableRequestIPReservation201Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestIPReservation201Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_request_ip_reservation_request.go b/services/metalv1/model_request_ip_reservation_request.go new file mode 100644 index 00000000..4ed842d8 --- /dev/null +++ b/services/metalv1/model_request_ip_reservation_request.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// RequestIPReservationRequest - struct for RequestIPReservationRequest +type RequestIPReservationRequest struct { + IPReservationRequestInput *IPReservationRequestInput + VrfIpReservationCreateInput *VrfIpReservationCreateInput +} + +// IPReservationRequestInputAsRequestIPReservationRequest is a convenience function that returns IPReservationRequestInput wrapped in RequestIPReservationRequest +func IPReservationRequestInputAsRequestIPReservationRequest(v *IPReservationRequestInput) RequestIPReservationRequest { + return RequestIPReservationRequest{ + IPReservationRequestInput: v, + } +} + +// VrfIpReservationCreateInputAsRequestIPReservationRequest is a convenience function that returns VrfIpReservationCreateInput wrapped in RequestIPReservationRequest +func VrfIpReservationCreateInputAsRequestIPReservationRequest(v *VrfIpReservationCreateInput) RequestIPReservationRequest { + return RequestIPReservationRequest{ + VrfIpReservationCreateInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RequestIPReservationRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IPReservationRequestInput + err = newStrictDecoder(data).Decode(&dst.IPReservationRequestInput) + if err == nil { + jsonIPReservationRequestInput, _ := json.Marshal(dst.IPReservationRequestInput) + if string(jsonIPReservationRequestInput) == "{}" { // empty struct + dst.IPReservationRequestInput = nil + } else { + match++ + } + } else { + dst.IPReservationRequestInput = nil + } + + // try to unmarshal data into VrfIpReservationCreateInput + err = newStrictDecoder(data).Decode(&dst.VrfIpReservationCreateInput) + if err == nil { + jsonVrfIpReservationCreateInput, _ := json.Marshal(dst.VrfIpReservationCreateInput) + if string(jsonVrfIpReservationCreateInput) == "{}" { // empty struct + dst.VrfIpReservationCreateInput = nil + } else { + match++ + } + } else { + dst.VrfIpReservationCreateInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.IPReservationRequestInput = nil + dst.VrfIpReservationCreateInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(RequestIPReservationRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(RequestIPReservationRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RequestIPReservationRequest) MarshalJSON() ([]byte, error) { + if src.IPReservationRequestInput != nil { + return json.Marshal(&src.IPReservationRequestInput) + } + + if src.VrfIpReservationCreateInput != nil { + return json.Marshal(&src.VrfIpReservationCreateInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RequestIPReservationRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.IPReservationRequestInput != nil { + return obj.IPReservationRequestInput + } + + if obj.VrfIpReservationCreateInput != nil { + return obj.VrfIpReservationCreateInput + } + + // all schemas are nil + return nil +} + +type NullableRequestIPReservationRequest struct { + value *RequestIPReservationRequest + isSet bool +} + +func (v NullableRequestIPReservationRequest) Get() *RequestIPReservationRequest { + return v.value +} + +func (v *NullableRequestIPReservationRequest) Set(val *RequestIPReservationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRequestIPReservationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestIPReservationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestIPReservationRequest(val *RequestIPReservationRequest) *NullableRequestIPReservationRequest { + return &NullableRequestIPReservationRequest{value: val, isSet: true} +} + +func (v NullableRequestIPReservationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestIPReservationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_self_service_reservation_item_request.go b/services/metalv1/model_self_service_reservation_item_request.go new file mode 100644 index 00000000..a83a8580 --- /dev/null +++ b/services/metalv1/model_self_service_reservation_item_request.go @@ -0,0 +1,302 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SelfServiceReservationItemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SelfServiceReservationItemRequest{} + +// SelfServiceReservationItemRequest struct for SelfServiceReservationItemRequest +type SelfServiceReservationItemRequest struct { + Amount *float32 `json:"amount,omitempty"` + MetroId *string `json:"metro_id,omitempty"` + PlanId *string `json:"plan_id,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + Term *string `json:"term,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SelfServiceReservationItemRequest SelfServiceReservationItemRequest + +// NewSelfServiceReservationItemRequest instantiates a new SelfServiceReservationItemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSelfServiceReservationItemRequest() *SelfServiceReservationItemRequest { + this := SelfServiceReservationItemRequest{} + return &this +} + +// NewSelfServiceReservationItemRequestWithDefaults instantiates a new SelfServiceReservationItemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSelfServiceReservationItemRequestWithDefaults() *SelfServiceReservationItemRequest { + this := SelfServiceReservationItemRequest{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *SelfServiceReservationItemRequest) GetAmount() float32 { + if o == nil || IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemRequest) GetAmountOk() (*float32, bool) { + if o == nil || IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *SelfServiceReservationItemRequest) HasAmount() bool { + if o != nil && !IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *SelfServiceReservationItemRequest) SetAmount(v float32) { + o.Amount = &v +} + +// GetMetroId returns the MetroId field value if set, zero value otherwise. +func (o *SelfServiceReservationItemRequest) GetMetroId() string { + if o == nil || IsNil(o.MetroId) { + var ret string + return ret + } + return *o.MetroId +} + +// GetMetroIdOk returns a tuple with the MetroId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemRequest) GetMetroIdOk() (*string, bool) { + if o == nil || IsNil(o.MetroId) { + return nil, false + } + return o.MetroId, true +} + +// HasMetroId returns a boolean if a field has been set. +func (o *SelfServiceReservationItemRequest) HasMetroId() bool { + if o != nil && !IsNil(o.MetroId) { + return true + } + + return false +} + +// SetMetroId gets a reference to the given string and assigns it to the MetroId field. +func (o *SelfServiceReservationItemRequest) SetMetroId(v string) { + o.MetroId = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *SelfServiceReservationItemRequest) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemRequest) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *SelfServiceReservationItemRequest) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *SelfServiceReservationItemRequest) SetPlanId(v string) { + o.PlanId = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *SelfServiceReservationItemRequest) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemRequest) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *SelfServiceReservationItemRequest) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *SelfServiceReservationItemRequest) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetTerm returns the Term field value if set, zero value otherwise. +func (o *SelfServiceReservationItemRequest) GetTerm() string { + if o == nil || IsNil(o.Term) { + var ret string + return ret + } + return *o.Term +} + +// GetTermOk returns a tuple with the Term field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemRequest) GetTermOk() (*string, bool) { + if o == nil || IsNil(o.Term) { + return nil, false + } + return o.Term, true +} + +// HasTerm returns a boolean if a field has been set. +func (o *SelfServiceReservationItemRequest) HasTerm() bool { + if o != nil && !IsNil(o.Term) { + return true + } + + return false +} + +// SetTerm gets a reference to the given string and assigns it to the Term field. +func (o *SelfServiceReservationItemRequest) SetTerm(v string) { + o.Term = &v +} + +func (o SelfServiceReservationItemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SelfServiceReservationItemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !IsNil(o.MetroId) { + toSerialize["metro_id"] = o.MetroId + } + if !IsNil(o.PlanId) { + toSerialize["plan_id"] = o.PlanId + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.Term) { + toSerialize["term"] = o.Term + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SelfServiceReservationItemRequest) UnmarshalJSON(bytes []byte) (err error) { + varSelfServiceReservationItemRequest := _SelfServiceReservationItemRequest{} + + err = json.Unmarshal(bytes, &varSelfServiceReservationItemRequest) + + if err != nil { + return err + } + + *o = SelfServiceReservationItemRequest(varSelfServiceReservationItemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "metro_id") + delete(additionalProperties, "plan_id") + delete(additionalProperties, "quantity") + delete(additionalProperties, "term") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSelfServiceReservationItemRequest struct { + value *SelfServiceReservationItemRequest + isSet bool +} + +func (v NullableSelfServiceReservationItemRequest) Get() *SelfServiceReservationItemRequest { + return v.value +} + +func (v *NullableSelfServiceReservationItemRequest) Set(val *SelfServiceReservationItemRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSelfServiceReservationItemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSelfServiceReservationItemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSelfServiceReservationItemRequest(val *SelfServiceReservationItemRequest) *NullableSelfServiceReservationItemRequest { + return &NullableSelfServiceReservationItemRequest{value: val, isSet: true} +} + +func (v NullableSelfServiceReservationItemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSelfServiceReservationItemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_self_service_reservation_item_response.go b/services/metalv1/model_self_service_reservation_item_response.go new file mode 100644 index 00000000..2614c381 --- /dev/null +++ b/services/metalv1/model_self_service_reservation_item_response.go @@ -0,0 +1,524 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SelfServiceReservationItemResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SelfServiceReservationItemResponse{} + +// SelfServiceReservationItemResponse struct for SelfServiceReservationItemResponse +type SelfServiceReservationItemResponse struct { + Amount *float32 `json:"amount,omitempty"` + Id *string `json:"id,omitempty"` + MetroCode *string `json:"metro_code,omitempty"` + MetroId *string `json:"metro_id,omitempty"` + MetroName *string `json:"metro_name,omitempty"` + PlanId *string `json:"plan_id,omitempty"` + PlanName *string `json:"plan_name,omitempty"` + PlanSlug *string `json:"plan_slug,omitempty"` + PlanCategories []string `json:"plan_categories,omitempty"` + Quantity *int32 `json:"quantity,omitempty"` + Term *string `json:"term,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SelfServiceReservationItemResponse SelfServiceReservationItemResponse + +// NewSelfServiceReservationItemResponse instantiates a new SelfServiceReservationItemResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSelfServiceReservationItemResponse() *SelfServiceReservationItemResponse { + this := SelfServiceReservationItemResponse{} + return &this +} + +// NewSelfServiceReservationItemResponseWithDefaults instantiates a new SelfServiceReservationItemResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSelfServiceReservationItemResponseWithDefaults() *SelfServiceReservationItemResponse { + this := SelfServiceReservationItemResponse{} + return &this +} + +// GetAmount returns the Amount field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetAmount() float32 { + if o == nil || IsNil(o.Amount) { + var ret float32 + return ret + } + return *o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetAmountOk() (*float32, bool) { + if o == nil || IsNil(o.Amount) { + return nil, false + } + return o.Amount, true +} + +// HasAmount returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasAmount() bool { + if o != nil && !IsNil(o.Amount) { + return true + } + + return false +} + +// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +func (o *SelfServiceReservationItemResponse) SetAmount(v float32) { + o.Amount = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SelfServiceReservationItemResponse) SetId(v string) { + o.Id = &v +} + +// GetMetroCode returns the MetroCode field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetMetroCode() string { + if o == nil || IsNil(o.MetroCode) { + var ret string + return ret + } + return *o.MetroCode +} + +// GetMetroCodeOk returns a tuple with the MetroCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetMetroCodeOk() (*string, bool) { + if o == nil || IsNil(o.MetroCode) { + return nil, false + } + return o.MetroCode, true +} + +// HasMetroCode returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasMetroCode() bool { + if o != nil && !IsNil(o.MetroCode) { + return true + } + + return false +} + +// SetMetroCode gets a reference to the given string and assigns it to the MetroCode field. +func (o *SelfServiceReservationItemResponse) SetMetroCode(v string) { + o.MetroCode = &v +} + +// GetMetroId returns the MetroId field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetMetroId() string { + if o == nil || IsNil(o.MetroId) { + var ret string + return ret + } + return *o.MetroId +} + +// GetMetroIdOk returns a tuple with the MetroId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetMetroIdOk() (*string, bool) { + if o == nil || IsNil(o.MetroId) { + return nil, false + } + return o.MetroId, true +} + +// HasMetroId returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasMetroId() bool { + if o != nil && !IsNil(o.MetroId) { + return true + } + + return false +} + +// SetMetroId gets a reference to the given string and assigns it to the MetroId field. +func (o *SelfServiceReservationItemResponse) SetMetroId(v string) { + o.MetroId = &v +} + +// GetMetroName returns the MetroName field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetMetroName() string { + if o == nil || IsNil(o.MetroName) { + var ret string + return ret + } + return *o.MetroName +} + +// GetMetroNameOk returns a tuple with the MetroName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetMetroNameOk() (*string, bool) { + if o == nil || IsNil(o.MetroName) { + return nil, false + } + return o.MetroName, true +} + +// HasMetroName returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasMetroName() bool { + if o != nil && !IsNil(o.MetroName) { + return true + } + + return false +} + +// SetMetroName gets a reference to the given string and assigns it to the MetroName field. +func (o *SelfServiceReservationItemResponse) SetMetroName(v string) { + o.MetroName = &v +} + +// GetPlanId returns the PlanId field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetPlanId() string { + if o == nil || IsNil(o.PlanId) { + var ret string + return ret + } + return *o.PlanId +} + +// GetPlanIdOk returns a tuple with the PlanId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetPlanIdOk() (*string, bool) { + if o == nil || IsNil(o.PlanId) { + return nil, false + } + return o.PlanId, true +} + +// HasPlanId returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasPlanId() bool { + if o != nil && !IsNil(o.PlanId) { + return true + } + + return false +} + +// SetPlanId gets a reference to the given string and assigns it to the PlanId field. +func (o *SelfServiceReservationItemResponse) SetPlanId(v string) { + o.PlanId = &v +} + +// GetPlanName returns the PlanName field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetPlanName() string { + if o == nil || IsNil(o.PlanName) { + var ret string + return ret + } + return *o.PlanName +} + +// GetPlanNameOk returns a tuple with the PlanName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetPlanNameOk() (*string, bool) { + if o == nil || IsNil(o.PlanName) { + return nil, false + } + return o.PlanName, true +} + +// HasPlanName returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasPlanName() bool { + if o != nil && !IsNil(o.PlanName) { + return true + } + + return false +} + +// SetPlanName gets a reference to the given string and assigns it to the PlanName field. +func (o *SelfServiceReservationItemResponse) SetPlanName(v string) { + o.PlanName = &v +} + +// GetPlanSlug returns the PlanSlug field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetPlanSlug() string { + if o == nil || IsNil(o.PlanSlug) { + var ret string + return ret + } + return *o.PlanSlug +} + +// GetPlanSlugOk returns a tuple with the PlanSlug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetPlanSlugOk() (*string, bool) { + if o == nil || IsNil(o.PlanSlug) { + return nil, false + } + return o.PlanSlug, true +} + +// HasPlanSlug returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasPlanSlug() bool { + if o != nil && !IsNil(o.PlanSlug) { + return true + } + + return false +} + +// SetPlanSlug gets a reference to the given string and assigns it to the PlanSlug field. +func (o *SelfServiceReservationItemResponse) SetPlanSlug(v string) { + o.PlanSlug = &v +} + +// GetPlanCategories returns the PlanCategories field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetPlanCategories() []string { + if o == nil || IsNil(o.PlanCategories) { + var ret []string + return ret + } + return o.PlanCategories +} + +// GetPlanCategoriesOk returns a tuple with the PlanCategories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetPlanCategoriesOk() ([]string, bool) { + if o == nil || IsNil(o.PlanCategories) { + return nil, false + } + return o.PlanCategories, true +} + +// HasPlanCategories returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasPlanCategories() bool { + if o != nil && !IsNil(o.PlanCategories) { + return true + } + + return false +} + +// SetPlanCategories gets a reference to the given []string and assigns it to the PlanCategories field. +func (o *SelfServiceReservationItemResponse) SetPlanCategories(v []string) { + o.PlanCategories = v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *SelfServiceReservationItemResponse) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetTerm returns the Term field value if set, zero value otherwise. +func (o *SelfServiceReservationItemResponse) GetTerm() string { + if o == nil || IsNil(o.Term) { + var ret string + return ret + } + return *o.Term +} + +// GetTermOk returns a tuple with the Term field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationItemResponse) GetTermOk() (*string, bool) { + if o == nil || IsNil(o.Term) { + return nil, false + } + return o.Term, true +} + +// HasTerm returns a boolean if a field has been set. +func (o *SelfServiceReservationItemResponse) HasTerm() bool { + if o != nil && !IsNil(o.Term) { + return true + } + + return false +} + +// SetTerm gets a reference to the given string and assigns it to the Term field. +func (o *SelfServiceReservationItemResponse) SetTerm(v string) { + o.Term = &v +} + +func (o SelfServiceReservationItemResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SelfServiceReservationItemResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Amount) { + toSerialize["amount"] = o.Amount + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.MetroCode) { + toSerialize["metro_code"] = o.MetroCode + } + if !IsNil(o.MetroId) { + toSerialize["metro_id"] = o.MetroId + } + if !IsNil(o.MetroName) { + toSerialize["metro_name"] = o.MetroName + } + if !IsNil(o.PlanId) { + toSerialize["plan_id"] = o.PlanId + } + if !IsNil(o.PlanName) { + toSerialize["plan_name"] = o.PlanName + } + if !IsNil(o.PlanSlug) { + toSerialize["plan_slug"] = o.PlanSlug + } + if !IsNil(o.PlanCategories) { + toSerialize["plan_categories"] = o.PlanCategories + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.Term) { + toSerialize["term"] = o.Term + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SelfServiceReservationItemResponse) UnmarshalJSON(bytes []byte) (err error) { + varSelfServiceReservationItemResponse := _SelfServiceReservationItemResponse{} + + err = json.Unmarshal(bytes, &varSelfServiceReservationItemResponse) + + if err != nil { + return err + } + + *o = SelfServiceReservationItemResponse(varSelfServiceReservationItemResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "amount") + delete(additionalProperties, "id") + delete(additionalProperties, "metro_code") + delete(additionalProperties, "metro_id") + delete(additionalProperties, "metro_name") + delete(additionalProperties, "plan_id") + delete(additionalProperties, "plan_name") + delete(additionalProperties, "plan_slug") + delete(additionalProperties, "plan_categories") + delete(additionalProperties, "quantity") + delete(additionalProperties, "term") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSelfServiceReservationItemResponse struct { + value *SelfServiceReservationItemResponse + isSet bool +} + +func (v NullableSelfServiceReservationItemResponse) Get() *SelfServiceReservationItemResponse { + return v.value +} + +func (v *NullableSelfServiceReservationItemResponse) Set(val *SelfServiceReservationItemResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSelfServiceReservationItemResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSelfServiceReservationItemResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSelfServiceReservationItemResponse(val *SelfServiceReservationItemResponse) *NullableSelfServiceReservationItemResponse { + return &NullableSelfServiceReservationItemResponse{value: val, isSet: true} +} + +func (v NullableSelfServiceReservationItemResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSelfServiceReservationItemResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_self_service_reservation_list.go b/services/metalv1/model_self_service_reservation_list.go new file mode 100644 index 00000000..2c41cd97 --- /dev/null +++ b/services/metalv1/model_self_service_reservation_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SelfServiceReservationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SelfServiceReservationList{} + +// SelfServiceReservationList struct for SelfServiceReservationList +type SelfServiceReservationList struct { + Reservations []SelfServiceReservationResponse `json:"reservations,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SelfServiceReservationList SelfServiceReservationList + +// NewSelfServiceReservationList instantiates a new SelfServiceReservationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSelfServiceReservationList() *SelfServiceReservationList { + this := SelfServiceReservationList{} + return &this +} + +// NewSelfServiceReservationListWithDefaults instantiates a new SelfServiceReservationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSelfServiceReservationListWithDefaults() *SelfServiceReservationList { + this := SelfServiceReservationList{} + return &this +} + +// GetReservations returns the Reservations field value if set, zero value otherwise. +func (o *SelfServiceReservationList) GetReservations() []SelfServiceReservationResponse { + if o == nil || IsNil(o.Reservations) { + var ret []SelfServiceReservationResponse + return ret + } + return o.Reservations +} + +// GetReservationsOk returns a tuple with the Reservations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationList) GetReservationsOk() ([]SelfServiceReservationResponse, bool) { + if o == nil || IsNil(o.Reservations) { + return nil, false + } + return o.Reservations, true +} + +// HasReservations returns a boolean if a field has been set. +func (o *SelfServiceReservationList) HasReservations() bool { + if o != nil && !IsNil(o.Reservations) { + return true + } + + return false +} + +// SetReservations gets a reference to the given []SelfServiceReservationResponse and assigns it to the Reservations field. +func (o *SelfServiceReservationList) SetReservations(v []SelfServiceReservationResponse) { + o.Reservations = v +} + +func (o SelfServiceReservationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SelfServiceReservationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Reservations) { + toSerialize["reservations"] = o.Reservations + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SelfServiceReservationList) UnmarshalJSON(bytes []byte) (err error) { + varSelfServiceReservationList := _SelfServiceReservationList{} + + err = json.Unmarshal(bytes, &varSelfServiceReservationList) + + if err != nil { + return err + } + + *o = SelfServiceReservationList(varSelfServiceReservationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "reservations") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSelfServiceReservationList struct { + value *SelfServiceReservationList + isSet bool +} + +func (v NullableSelfServiceReservationList) Get() *SelfServiceReservationList { + return v.value +} + +func (v *NullableSelfServiceReservationList) Set(val *SelfServiceReservationList) { + v.value = val + v.isSet = true +} + +func (v NullableSelfServiceReservationList) IsSet() bool { + return v.isSet +} + +func (v *NullableSelfServiceReservationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSelfServiceReservationList(val *SelfServiceReservationList) *NullableSelfServiceReservationList { + return &NullableSelfServiceReservationList{value: val, isSet: true} +} + +func (v NullableSelfServiceReservationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSelfServiceReservationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_self_service_reservation_response.go b/services/metalv1/model_self_service_reservation_response.go new file mode 100644 index 00000000..6c491694 --- /dev/null +++ b/services/metalv1/model_self_service_reservation_response.go @@ -0,0 +1,525 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the SelfServiceReservationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SelfServiceReservationResponse{} + +// SelfServiceReservationResponse struct for SelfServiceReservationResponse +type SelfServiceReservationResponse struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Item []SelfServiceReservationItemResponse `json:"item,omitempty"` + Notes *string `json:"notes,omitempty"` + Organization *string `json:"organization,omitempty"` + OrganizationId *string `json:"organization_id,omitempty"` + Period *CreateSelfServiceReservationRequestPeriod `json:"period,omitempty"` + Project *string `json:"project,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + StartDate *time.Time `json:"start_date,omitempty"` + Status *string `json:"status,omitempty"` + TotalCost *int32 `json:"total_cost,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SelfServiceReservationResponse SelfServiceReservationResponse + +// NewSelfServiceReservationResponse instantiates a new SelfServiceReservationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSelfServiceReservationResponse() *SelfServiceReservationResponse { + this := SelfServiceReservationResponse{} + return &this +} + +// NewSelfServiceReservationResponseWithDefaults instantiates a new SelfServiceReservationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSelfServiceReservationResponseWithDefaults() *SelfServiceReservationResponse { + this := SelfServiceReservationResponse{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SelfServiceReservationResponse) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetItem returns the Item field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetItem() []SelfServiceReservationItemResponse { + if o == nil || IsNil(o.Item) { + var ret []SelfServiceReservationItemResponse + return ret + } + return o.Item +} + +// GetItemOk returns a tuple with the Item field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetItemOk() ([]SelfServiceReservationItemResponse, bool) { + if o == nil || IsNil(o.Item) { + return nil, false + } + return o.Item, true +} + +// HasItem returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasItem() bool { + if o != nil && !IsNil(o.Item) { + return true + } + + return false +} + +// SetItem gets a reference to the given []SelfServiceReservationItemResponse and assigns it to the Item field. +func (o *SelfServiceReservationResponse) SetItem(v []SelfServiceReservationItemResponse) { + o.Item = v +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetNotes() string { + if o == nil || IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetNotesOk() (*string, bool) { + if o == nil || IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasNotes() bool { + if o != nil && !IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *SelfServiceReservationResponse) SetNotes(v string) { + o.Notes = &v +} + +// GetOrganization returns the Organization field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetOrganization() string { + if o == nil || IsNil(o.Organization) { + var ret string + return ret + } + return *o.Organization +} + +// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetOrganizationOk() (*string, bool) { + if o == nil || IsNil(o.Organization) { + return nil, false + } + return o.Organization, true +} + +// HasOrganization returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasOrganization() bool { + if o != nil && !IsNil(o.Organization) { + return true + } + + return false +} + +// SetOrganization gets a reference to the given string and assigns it to the Organization field. +func (o *SelfServiceReservationResponse) SetOrganization(v string) { + o.Organization = &v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *SelfServiceReservationResponse) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetPeriod returns the Period field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetPeriod() CreateSelfServiceReservationRequestPeriod { + if o == nil || IsNil(o.Period) { + var ret CreateSelfServiceReservationRequestPeriod + return ret + } + return *o.Period +} + +// GetPeriodOk returns a tuple with the Period field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetPeriodOk() (*CreateSelfServiceReservationRequestPeriod, bool) { + if o == nil || IsNil(o.Period) { + return nil, false + } + return o.Period, true +} + +// HasPeriod returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasPeriod() bool { + if o != nil && !IsNil(o.Period) { + return true + } + + return false +} + +// SetPeriod gets a reference to the given CreateSelfServiceReservationRequestPeriod and assigns it to the Period field. +func (o *SelfServiceReservationResponse) SetPeriod(v CreateSelfServiceReservationRequestPeriod) { + o.Period = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetProject() string { + if o == nil || IsNil(o.Project) { + var ret string + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetProjectOk() (*string, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given string and assigns it to the Project field. +func (o *SelfServiceReservationResponse) SetProject(v string) { + o.Project = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *SelfServiceReservationResponse) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate) { + var ret time.Time + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetStartDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartDate) { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasStartDate() bool { + if o != nil && !IsNil(o.StartDate) { + return true + } + + return false +} + +// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field. +func (o *SelfServiceReservationResponse) SetStartDate(v time.Time) { + o.StartDate = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SelfServiceReservationResponse) SetStatus(v string) { + o.Status = &v +} + +// GetTotalCost returns the TotalCost field value if set, zero value otherwise. +func (o *SelfServiceReservationResponse) GetTotalCost() int32 { + if o == nil || IsNil(o.TotalCost) { + var ret int32 + return ret + } + return *o.TotalCost +} + +// GetTotalCostOk returns a tuple with the TotalCost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SelfServiceReservationResponse) GetTotalCostOk() (*int32, bool) { + if o == nil || IsNil(o.TotalCost) { + return nil, false + } + return o.TotalCost, true +} + +// HasTotalCost returns a boolean if a field has been set. +func (o *SelfServiceReservationResponse) HasTotalCost() bool { + if o != nil && !IsNil(o.TotalCost) { + return true + } + + return false +} + +// SetTotalCost gets a reference to the given int32 and assigns it to the TotalCost field. +func (o *SelfServiceReservationResponse) SetTotalCost(v int32) { + o.TotalCost = &v +} + +func (o SelfServiceReservationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SelfServiceReservationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Item) { + toSerialize["item"] = o.Item + } + if !IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + if !IsNil(o.Organization) { + toSerialize["organization"] = o.Organization + } + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.Period) { + toSerialize["period"] = o.Period + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + if !IsNil(o.StartDate) { + toSerialize["start_date"] = o.StartDate + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.TotalCost) { + toSerialize["total_cost"] = o.TotalCost + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SelfServiceReservationResponse) UnmarshalJSON(bytes []byte) (err error) { + varSelfServiceReservationResponse := _SelfServiceReservationResponse{} + + err = json.Unmarshal(bytes, &varSelfServiceReservationResponse) + + if err != nil { + return err + } + + *o = SelfServiceReservationResponse(varSelfServiceReservationResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "item") + delete(additionalProperties, "notes") + delete(additionalProperties, "organization") + delete(additionalProperties, "organization_id") + delete(additionalProperties, "period") + delete(additionalProperties, "project") + delete(additionalProperties, "project_id") + delete(additionalProperties, "start_date") + delete(additionalProperties, "status") + delete(additionalProperties, "total_cost") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSelfServiceReservationResponse struct { + value *SelfServiceReservationResponse + isSet bool +} + +func (v NullableSelfServiceReservationResponse) Get() *SelfServiceReservationResponse { + return v.value +} + +func (v *NullableSelfServiceReservationResponse) Set(val *SelfServiceReservationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSelfServiceReservationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSelfServiceReservationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSelfServiceReservationResponse(val *SelfServiceReservationResponse) *NullableSelfServiceReservationResponse { + return &NullableSelfServiceReservationResponse{value: val, isSet: true} +} + +func (v NullableSelfServiceReservationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSelfServiceReservationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_server_info.go b/services/metalv1/model_server_info.go new file mode 100644 index 00000000..5df5bf68 --- /dev/null +++ b/services/metalv1/model_server_info.go @@ -0,0 +1,272 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the ServerInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerInfo{} + +// ServerInfo struct for ServerInfo +type ServerInfo struct { + // Deprecated + Facility *string `json:"facility,omitempty"` + // The metro ID or code to check the capacity in. + Metro *string `json:"metro,omitempty"` + // The plan ID or slug to check the capacity of. + Plan *string `json:"plan,omitempty"` + // The number of servers to check the capacity of. + Quantity *string `json:"quantity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ServerInfo ServerInfo + +// NewServerInfo instantiates a new ServerInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerInfo() *ServerInfo { + this := ServerInfo{} + return &this +} + +// NewServerInfoWithDefaults instantiates a new ServerInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerInfoWithDefaults() *ServerInfo { + this := ServerInfo{} + return &this +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +// Deprecated +func (o *ServerInfo) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *ServerInfo) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *ServerInfo) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +// Deprecated +func (o *ServerInfo) SetFacility(v string) { + o.Facility = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *ServerInfo) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerInfo) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *ServerInfo) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *ServerInfo) SetMetro(v string) { + o.Metro = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *ServerInfo) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerInfo) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *ServerInfo) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *ServerInfo) SetPlan(v string) { + o.Plan = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *ServerInfo) GetQuantity() string { + if o == nil || IsNil(o.Quantity) { + var ret string + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerInfo) GetQuantityOk() (*string, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *ServerInfo) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given string and assigns it to the Quantity field. +func (o *ServerInfo) SetQuantity(v string) { + o.Quantity = &v +} + +func (o ServerInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServerInfo) UnmarshalJSON(bytes []byte) (err error) { + varServerInfo := _ServerInfo{} + + err = json.Unmarshal(bytes, &varServerInfo) + + if err != nil { + return err + } + + *o = ServerInfo(varServerInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "facility") + delete(additionalProperties, "metro") + delete(additionalProperties, "plan") + delete(additionalProperties, "quantity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServerInfo struct { + value *ServerInfo + isSet bool +} + +func (v NullableServerInfo) Get() *ServerInfo { + return v.value +} + +func (v *NullableServerInfo) Set(val *ServerInfo) { + v.value = val + v.isSet = true +} + +func (v NullableServerInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableServerInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerInfo(val *ServerInfo) *NullableServerInfo { + return &NullableServerInfo{value: val, isSet: true} +} + +func (v NullableServerInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_prices_list.go b/services/metalv1/model_spot_market_prices_list.go new file mode 100644 index 00000000..b89fe6ce --- /dev/null +++ b/services/metalv1/model_spot_market_prices_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotMarketPricesList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketPricesList{} + +// SpotMarketPricesList struct for SpotMarketPricesList +type SpotMarketPricesList struct { + SpotMarketPrices *SpotPricesReport `json:"spot_market_prices,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketPricesList SpotMarketPricesList + +// NewSpotMarketPricesList instantiates a new SpotMarketPricesList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketPricesList() *SpotMarketPricesList { + this := SpotMarketPricesList{} + return &this +} + +// NewSpotMarketPricesListWithDefaults instantiates a new SpotMarketPricesList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketPricesListWithDefaults() *SpotMarketPricesList { + this := SpotMarketPricesList{} + return &this +} + +// GetSpotMarketPrices returns the SpotMarketPrices field value if set, zero value otherwise. +func (o *SpotMarketPricesList) GetSpotMarketPrices() SpotPricesReport { + if o == nil || IsNil(o.SpotMarketPrices) { + var ret SpotPricesReport + return ret + } + return *o.SpotMarketPrices +} + +// GetSpotMarketPricesOk returns a tuple with the SpotMarketPrices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesList) GetSpotMarketPricesOk() (*SpotPricesReport, bool) { + if o == nil || IsNil(o.SpotMarketPrices) { + return nil, false + } + return o.SpotMarketPrices, true +} + +// HasSpotMarketPrices returns a boolean if a field has been set. +func (o *SpotMarketPricesList) HasSpotMarketPrices() bool { + if o != nil && !IsNil(o.SpotMarketPrices) { + return true + } + + return false +} + +// SetSpotMarketPrices gets a reference to the given SpotPricesReport and assigns it to the SpotMarketPrices field. +func (o *SpotMarketPricesList) SetSpotMarketPrices(v SpotPricesReport) { + o.SpotMarketPrices = &v +} + +func (o SpotMarketPricesList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketPricesList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SpotMarketPrices) { + toSerialize["spot_market_prices"] = o.SpotMarketPrices + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketPricesList) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketPricesList := _SpotMarketPricesList{} + + err = json.Unmarshal(bytes, &varSpotMarketPricesList) + + if err != nil { + return err + } + + *o = SpotMarketPricesList(varSpotMarketPricesList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "spot_market_prices") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketPricesList struct { + value *SpotMarketPricesList + isSet bool +} + +func (v NullableSpotMarketPricesList) Get() *SpotMarketPricesList { + return v.value +} + +func (v *NullableSpotMarketPricesList) Set(val *SpotMarketPricesList) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketPricesList) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketPricesList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketPricesList(val *SpotMarketPricesList) *NullableSpotMarketPricesList { + return &NullableSpotMarketPricesList{value: val, isSet: true} +} + +func (v NullableSpotMarketPricesList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketPricesList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_prices_per_metro_list.go b/services/metalv1/model_spot_market_prices_per_metro_list.go new file mode 100644 index 00000000..7a2fe3bd --- /dev/null +++ b/services/metalv1/model_spot_market_prices_per_metro_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotMarketPricesPerMetroList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketPricesPerMetroList{} + +// SpotMarketPricesPerMetroList struct for SpotMarketPricesPerMetroList +type SpotMarketPricesPerMetroList struct { + SpotMarketPrices *SpotMarketPricesPerMetroReport `json:"spot_market_prices,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketPricesPerMetroList SpotMarketPricesPerMetroList + +// NewSpotMarketPricesPerMetroList instantiates a new SpotMarketPricesPerMetroList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketPricesPerMetroList() *SpotMarketPricesPerMetroList { + this := SpotMarketPricesPerMetroList{} + return &this +} + +// NewSpotMarketPricesPerMetroListWithDefaults instantiates a new SpotMarketPricesPerMetroList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketPricesPerMetroListWithDefaults() *SpotMarketPricesPerMetroList { + this := SpotMarketPricesPerMetroList{} + return &this +} + +// GetSpotMarketPrices returns the SpotMarketPrices field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroList) GetSpotMarketPrices() SpotMarketPricesPerMetroReport { + if o == nil || IsNil(o.SpotMarketPrices) { + var ret SpotMarketPricesPerMetroReport + return ret + } + return *o.SpotMarketPrices +} + +// GetSpotMarketPricesOk returns a tuple with the SpotMarketPrices field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroList) GetSpotMarketPricesOk() (*SpotMarketPricesPerMetroReport, bool) { + if o == nil || IsNil(o.SpotMarketPrices) { + return nil, false + } + return o.SpotMarketPrices, true +} + +// HasSpotMarketPrices returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroList) HasSpotMarketPrices() bool { + if o != nil && !IsNil(o.SpotMarketPrices) { + return true + } + + return false +} + +// SetSpotMarketPrices gets a reference to the given SpotMarketPricesPerMetroReport and assigns it to the SpotMarketPrices field. +func (o *SpotMarketPricesPerMetroList) SetSpotMarketPrices(v SpotMarketPricesPerMetroReport) { + o.SpotMarketPrices = &v +} + +func (o SpotMarketPricesPerMetroList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketPricesPerMetroList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SpotMarketPrices) { + toSerialize["spot_market_prices"] = o.SpotMarketPrices + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketPricesPerMetroList) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketPricesPerMetroList := _SpotMarketPricesPerMetroList{} + + err = json.Unmarshal(bytes, &varSpotMarketPricesPerMetroList) + + if err != nil { + return err + } + + *o = SpotMarketPricesPerMetroList(varSpotMarketPricesPerMetroList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "spot_market_prices") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketPricesPerMetroList struct { + value *SpotMarketPricesPerMetroList + isSet bool +} + +func (v NullableSpotMarketPricesPerMetroList) Get() *SpotMarketPricesPerMetroList { + return v.value +} + +func (v *NullableSpotMarketPricesPerMetroList) Set(val *SpotMarketPricesPerMetroList) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketPricesPerMetroList) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketPricesPerMetroList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketPricesPerMetroList(val *SpotMarketPricesPerMetroList) *NullableSpotMarketPricesPerMetroList { + return &NullableSpotMarketPricesPerMetroList{value: val, isSet: true} +} + +func (v NullableSpotMarketPricesPerMetroList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketPricesPerMetroList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_prices_per_metro_report.go b/services/metalv1/model_spot_market_prices_per_metro_report.go new file mode 100644 index 00000000..61cf9da9 --- /dev/null +++ b/services/metalv1/model_spot_market_prices_per_metro_report.go @@ -0,0 +1,376 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotMarketPricesPerMetroReport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketPricesPerMetroReport{} + +// SpotMarketPricesPerMetroReport struct for SpotMarketPricesPerMetroReport +type SpotMarketPricesPerMetroReport struct { + Am *SpotPricesPerFacility `json:"am,omitempty"` + Ch *SpotPricesPerFacility `json:"ch,omitempty"` + Da *SpotPricesPerFacility `json:"da,omitempty"` + La *SpotPricesPerFacility `json:"la,omitempty"` + Ny *SpotPricesPerFacility `json:"ny,omitempty"` + Sg *SpotPricesPerFacility `json:"sg,omitempty"` + Sv *SpotPricesPerFacility `json:"sv,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketPricesPerMetroReport SpotMarketPricesPerMetroReport + +// NewSpotMarketPricesPerMetroReport instantiates a new SpotMarketPricesPerMetroReport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketPricesPerMetroReport() *SpotMarketPricesPerMetroReport { + this := SpotMarketPricesPerMetroReport{} + return &this +} + +// NewSpotMarketPricesPerMetroReportWithDefaults instantiates a new SpotMarketPricesPerMetroReport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketPricesPerMetroReportWithDefaults() *SpotMarketPricesPerMetroReport { + this := SpotMarketPricesPerMetroReport{} + return &this +} + +// GetAm returns the Am field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetAm() SpotPricesPerFacility { + if o == nil || IsNil(o.Am) { + var ret SpotPricesPerFacility + return ret + } + return *o.Am +} + +// GetAmOk returns a tuple with the Am field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetAmOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Am) { + return nil, false + } + return o.Am, true +} + +// HasAm returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasAm() bool { + if o != nil && !IsNil(o.Am) { + return true + } + + return false +} + +// SetAm gets a reference to the given SpotPricesPerFacility and assigns it to the Am field. +func (o *SpotMarketPricesPerMetroReport) SetAm(v SpotPricesPerFacility) { + o.Am = &v +} + +// GetCh returns the Ch field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetCh() SpotPricesPerFacility { + if o == nil || IsNil(o.Ch) { + var ret SpotPricesPerFacility + return ret + } + return *o.Ch +} + +// GetChOk returns a tuple with the Ch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetChOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Ch) { + return nil, false + } + return o.Ch, true +} + +// HasCh returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasCh() bool { + if o != nil && !IsNil(o.Ch) { + return true + } + + return false +} + +// SetCh gets a reference to the given SpotPricesPerFacility and assigns it to the Ch field. +func (o *SpotMarketPricesPerMetroReport) SetCh(v SpotPricesPerFacility) { + o.Ch = &v +} + +// GetDa returns the Da field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetDa() SpotPricesPerFacility { + if o == nil || IsNil(o.Da) { + var ret SpotPricesPerFacility + return ret + } + return *o.Da +} + +// GetDaOk returns a tuple with the Da field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetDaOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Da) { + return nil, false + } + return o.Da, true +} + +// HasDa returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasDa() bool { + if o != nil && !IsNil(o.Da) { + return true + } + + return false +} + +// SetDa gets a reference to the given SpotPricesPerFacility and assigns it to the Da field. +func (o *SpotMarketPricesPerMetroReport) SetDa(v SpotPricesPerFacility) { + o.Da = &v +} + +// GetLa returns the La field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetLa() SpotPricesPerFacility { + if o == nil || IsNil(o.La) { + var ret SpotPricesPerFacility + return ret + } + return *o.La +} + +// GetLaOk returns a tuple with the La field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetLaOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.La) { + return nil, false + } + return o.La, true +} + +// HasLa returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasLa() bool { + if o != nil && !IsNil(o.La) { + return true + } + + return false +} + +// SetLa gets a reference to the given SpotPricesPerFacility and assigns it to the La field. +func (o *SpotMarketPricesPerMetroReport) SetLa(v SpotPricesPerFacility) { + o.La = &v +} + +// GetNy returns the Ny field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetNy() SpotPricesPerFacility { + if o == nil || IsNil(o.Ny) { + var ret SpotPricesPerFacility + return ret + } + return *o.Ny +} + +// GetNyOk returns a tuple with the Ny field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetNyOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Ny) { + return nil, false + } + return o.Ny, true +} + +// HasNy returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasNy() bool { + if o != nil && !IsNil(o.Ny) { + return true + } + + return false +} + +// SetNy gets a reference to the given SpotPricesPerFacility and assigns it to the Ny field. +func (o *SpotMarketPricesPerMetroReport) SetNy(v SpotPricesPerFacility) { + o.Ny = &v +} + +// GetSg returns the Sg field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetSg() SpotPricesPerFacility { + if o == nil || IsNil(o.Sg) { + var ret SpotPricesPerFacility + return ret + } + return *o.Sg +} + +// GetSgOk returns a tuple with the Sg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetSgOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Sg) { + return nil, false + } + return o.Sg, true +} + +// HasSg returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasSg() bool { + if o != nil && !IsNil(o.Sg) { + return true + } + + return false +} + +// SetSg gets a reference to the given SpotPricesPerFacility and assigns it to the Sg field. +func (o *SpotMarketPricesPerMetroReport) SetSg(v SpotPricesPerFacility) { + o.Sg = &v +} + +// GetSv returns the Sv field value if set, zero value otherwise. +func (o *SpotMarketPricesPerMetroReport) GetSv() SpotPricesPerFacility { + if o == nil || IsNil(o.Sv) { + var ret SpotPricesPerFacility + return ret + } + return *o.Sv +} + +// GetSvOk returns a tuple with the Sv field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketPricesPerMetroReport) GetSvOk() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Sv) { + return nil, false + } + return o.Sv, true +} + +// HasSv returns a boolean if a field has been set. +func (o *SpotMarketPricesPerMetroReport) HasSv() bool { + if o != nil && !IsNil(o.Sv) { + return true + } + + return false +} + +// SetSv gets a reference to the given SpotPricesPerFacility and assigns it to the Sv field. +func (o *SpotMarketPricesPerMetroReport) SetSv(v SpotPricesPerFacility) { + o.Sv = &v +} + +func (o SpotMarketPricesPerMetroReport) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketPricesPerMetroReport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Am) { + toSerialize["am"] = o.Am + } + if !IsNil(o.Ch) { + toSerialize["ch"] = o.Ch + } + if !IsNil(o.Da) { + toSerialize["da"] = o.Da + } + if !IsNil(o.La) { + toSerialize["la"] = o.La + } + if !IsNil(o.Ny) { + toSerialize["ny"] = o.Ny + } + if !IsNil(o.Sg) { + toSerialize["sg"] = o.Sg + } + if !IsNil(o.Sv) { + toSerialize["sv"] = o.Sv + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketPricesPerMetroReport) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketPricesPerMetroReport := _SpotMarketPricesPerMetroReport{} + + err = json.Unmarshal(bytes, &varSpotMarketPricesPerMetroReport) + + if err != nil { + return err + } + + *o = SpotMarketPricesPerMetroReport(varSpotMarketPricesPerMetroReport) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "am") + delete(additionalProperties, "ch") + delete(additionalProperties, "da") + delete(additionalProperties, "la") + delete(additionalProperties, "ny") + delete(additionalProperties, "sg") + delete(additionalProperties, "sv") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketPricesPerMetroReport struct { + value *SpotMarketPricesPerMetroReport + isSet bool +} + +func (v NullableSpotMarketPricesPerMetroReport) Get() *SpotMarketPricesPerMetroReport { + return v.value +} + +func (v *NullableSpotMarketPricesPerMetroReport) Set(val *SpotMarketPricesPerMetroReport) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketPricesPerMetroReport) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketPricesPerMetroReport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketPricesPerMetroReport(val *SpotMarketPricesPerMetroReport) *NullableSpotMarketPricesPerMetroReport { + return &NullableSpotMarketPricesPerMetroReport{value: val, isSet: true} +} + +func (v NullableSpotMarketPricesPerMetroReport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketPricesPerMetroReport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_request.go b/services/metalv1/model_spot_market_request.go new file mode 100644 index 00000000..fe2b2115 --- /dev/null +++ b/services/metalv1/model_spot_market_request.go @@ -0,0 +1,525 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the SpotMarketRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketRequest{} + +// SpotMarketRequest struct for SpotMarketRequest +type SpotMarketRequest struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + DevicesMax *int32 `json:"devices_max,omitempty"` + DevicesMin *int32 `json:"devices_min,omitempty"` + EndAt *time.Time `json:"end_at,omitempty"` + Facilities *Href `json:"facilities,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Instances *Href `json:"instances,omitempty"` + MaxBidPrice *float32 `json:"max_bid_price,omitempty"` + Metro *SpotMarketRequestMetro `json:"metro,omitempty"` + Project *Href `json:"project,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketRequest SpotMarketRequest + +// NewSpotMarketRequest instantiates a new SpotMarketRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketRequest() *SpotMarketRequest { + this := SpotMarketRequest{} + return &this +} + +// NewSpotMarketRequestWithDefaults instantiates a new SpotMarketRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketRequestWithDefaults() *SpotMarketRequest { + this := SpotMarketRequest{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SpotMarketRequest) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDevicesMax returns the DevicesMax field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetDevicesMax() int32 { + if o == nil || IsNil(o.DevicesMax) { + var ret int32 + return ret + } + return *o.DevicesMax +} + +// GetDevicesMaxOk returns a tuple with the DevicesMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetDevicesMaxOk() (*int32, bool) { + if o == nil || IsNil(o.DevicesMax) { + return nil, false + } + return o.DevicesMax, true +} + +// HasDevicesMax returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasDevicesMax() bool { + if o != nil && !IsNil(o.DevicesMax) { + return true + } + + return false +} + +// SetDevicesMax gets a reference to the given int32 and assigns it to the DevicesMax field. +func (o *SpotMarketRequest) SetDevicesMax(v int32) { + o.DevicesMax = &v +} + +// GetDevicesMin returns the DevicesMin field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetDevicesMin() int32 { + if o == nil || IsNil(o.DevicesMin) { + var ret int32 + return ret + } + return *o.DevicesMin +} + +// GetDevicesMinOk returns a tuple with the DevicesMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetDevicesMinOk() (*int32, bool) { + if o == nil || IsNil(o.DevicesMin) { + return nil, false + } + return o.DevicesMin, true +} + +// HasDevicesMin returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasDevicesMin() bool { + if o != nil && !IsNil(o.DevicesMin) { + return true + } + + return false +} + +// SetDevicesMin gets a reference to the given int32 and assigns it to the DevicesMin field. +func (o *SpotMarketRequest) SetDevicesMin(v int32) { + o.DevicesMin = &v +} + +// GetEndAt returns the EndAt field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetEndAt() time.Time { + if o == nil || IsNil(o.EndAt) { + var ret time.Time + return ret + } + return *o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetEndAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.EndAt) { + return nil, false + } + return o.EndAt, true +} + +// HasEndAt returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasEndAt() bool { + if o != nil && !IsNil(o.EndAt) { + return true + } + + return false +} + +// SetEndAt gets a reference to the given time.Time and assigns it to the EndAt field. +func (o *SpotMarketRequest) SetEndAt(v time.Time) { + o.EndAt = &v +} + +// GetFacilities returns the Facilities field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetFacilities() Href { + if o == nil || IsNil(o.Facilities) { + var ret Href + return ret + } + return *o.Facilities +} + +// GetFacilitiesOk returns a tuple with the Facilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetFacilitiesOk() (*Href, bool) { + if o == nil || IsNil(o.Facilities) { + return nil, false + } + return o.Facilities, true +} + +// HasFacilities returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasFacilities() bool { + if o != nil && !IsNil(o.Facilities) { + return true + } + + return false +} + +// SetFacilities gets a reference to the given Href and assigns it to the Facilities field. +func (o *SpotMarketRequest) SetFacilities(v Href) { + o.Facilities = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *SpotMarketRequest) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SpotMarketRequest) SetId(v string) { + o.Id = &v +} + +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetInstances() Href { + if o == nil || IsNil(o.Instances) { + var ret Href + return ret + } + return *o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetInstancesOk() (*Href, bool) { + if o == nil || IsNil(o.Instances) { + return nil, false + } + return o.Instances, true +} + +// HasInstances returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasInstances() bool { + if o != nil && !IsNil(o.Instances) { + return true + } + + return false +} + +// SetInstances gets a reference to the given Href and assigns it to the Instances field. +func (o *SpotMarketRequest) SetInstances(v Href) { + o.Instances = &v +} + +// GetMaxBidPrice returns the MaxBidPrice field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetMaxBidPrice() float32 { + if o == nil || IsNil(o.MaxBidPrice) { + var ret float32 + return ret + } + return *o.MaxBidPrice +} + +// GetMaxBidPriceOk returns a tuple with the MaxBidPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetMaxBidPriceOk() (*float32, bool) { + if o == nil || IsNil(o.MaxBidPrice) { + return nil, false + } + return o.MaxBidPrice, true +} + +// HasMaxBidPrice returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasMaxBidPrice() bool { + if o != nil && !IsNil(o.MaxBidPrice) { + return true + } + + return false +} + +// SetMaxBidPrice gets a reference to the given float32 and assigns it to the MaxBidPrice field. +func (o *SpotMarketRequest) SetMaxBidPrice(v float32) { + o.MaxBidPrice = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetMetro() SpotMarketRequestMetro { + if o == nil || IsNil(o.Metro) { + var ret SpotMarketRequestMetro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetMetroOk() (*SpotMarketRequestMetro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given SpotMarketRequestMetro and assigns it to the Metro field. +func (o *SpotMarketRequest) SetMetro(v SpotMarketRequestMetro) { + o.Metro = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *SpotMarketRequest) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequest) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *SpotMarketRequest) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *SpotMarketRequest) SetProject(v Href) { + o.Project = &v +} + +func (o SpotMarketRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.DevicesMax) { + toSerialize["devices_max"] = o.DevicesMax + } + if !IsNil(o.DevicesMin) { + toSerialize["devices_min"] = o.DevicesMin + } + if !IsNil(o.EndAt) { + toSerialize["end_at"] = o.EndAt + } + if !IsNil(o.Facilities) { + toSerialize["facilities"] = o.Facilities + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Instances) { + toSerialize["instances"] = o.Instances + } + if !IsNil(o.MaxBidPrice) { + toSerialize["max_bid_price"] = o.MaxBidPrice + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketRequest) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketRequest := _SpotMarketRequest{} + + err = json.Unmarshal(bytes, &varSpotMarketRequest) + + if err != nil { + return err + } + + *o = SpotMarketRequest(varSpotMarketRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "devices_max") + delete(additionalProperties, "devices_min") + delete(additionalProperties, "end_at") + delete(additionalProperties, "facilities") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "instances") + delete(additionalProperties, "max_bid_price") + delete(additionalProperties, "metro") + delete(additionalProperties, "project") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketRequest struct { + value *SpotMarketRequest + isSet bool +} + +func (v NullableSpotMarketRequest) Get() *SpotMarketRequest { + return v.value +} + +func (v *NullableSpotMarketRequest) Set(val *SpotMarketRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketRequest(val *SpotMarketRequest) *NullableSpotMarketRequest { + return &NullableSpotMarketRequest{value: val, isSet: true} +} + +func (v NullableSpotMarketRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_request_create_input.go b/services/metalv1/model_spot_market_request_create_input.go new file mode 100644 index 00000000..9f002b37 --- /dev/null +++ b/services/metalv1/model_spot_market_request_create_input.go @@ -0,0 +1,382 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the SpotMarketRequestCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketRequestCreateInput{} + +// SpotMarketRequestCreateInput struct for SpotMarketRequestCreateInput +type SpotMarketRequestCreateInput struct { + DevicesMax *int32 `json:"devices_max,omitempty"` + DevicesMin *int32 `json:"devices_min,omitempty"` + EndAt *time.Time `json:"end_at,omitempty"` + // Deprecated + Facilities []string `json:"facilities,omitempty"` + InstanceParameters *SpotMarketRequestCreateInputInstanceParameters `json:"instance_parameters,omitempty"` + MaxBidPrice *float32 `json:"max_bid_price,omitempty"` + // The metro ID or code the spot market request will be created in. + Metro *string `json:"metro,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketRequestCreateInput SpotMarketRequestCreateInput + +// NewSpotMarketRequestCreateInput instantiates a new SpotMarketRequestCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketRequestCreateInput() *SpotMarketRequestCreateInput { + this := SpotMarketRequestCreateInput{} + return &this +} + +// NewSpotMarketRequestCreateInputWithDefaults instantiates a new SpotMarketRequestCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketRequestCreateInputWithDefaults() *SpotMarketRequestCreateInput { + this := SpotMarketRequestCreateInput{} + return &this +} + +// GetDevicesMax returns the DevicesMax field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetDevicesMax() int32 { + if o == nil || IsNil(o.DevicesMax) { + var ret int32 + return ret + } + return *o.DevicesMax +} + +// GetDevicesMaxOk returns a tuple with the DevicesMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetDevicesMaxOk() (*int32, bool) { + if o == nil || IsNil(o.DevicesMax) { + return nil, false + } + return o.DevicesMax, true +} + +// HasDevicesMax returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasDevicesMax() bool { + if o != nil && !IsNil(o.DevicesMax) { + return true + } + + return false +} + +// SetDevicesMax gets a reference to the given int32 and assigns it to the DevicesMax field. +func (o *SpotMarketRequestCreateInput) SetDevicesMax(v int32) { + o.DevicesMax = &v +} + +// GetDevicesMin returns the DevicesMin field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetDevicesMin() int32 { + if o == nil || IsNil(o.DevicesMin) { + var ret int32 + return ret + } + return *o.DevicesMin +} + +// GetDevicesMinOk returns a tuple with the DevicesMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetDevicesMinOk() (*int32, bool) { + if o == nil || IsNil(o.DevicesMin) { + return nil, false + } + return o.DevicesMin, true +} + +// HasDevicesMin returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasDevicesMin() bool { + if o != nil && !IsNil(o.DevicesMin) { + return true + } + + return false +} + +// SetDevicesMin gets a reference to the given int32 and assigns it to the DevicesMin field. +func (o *SpotMarketRequestCreateInput) SetDevicesMin(v int32) { + o.DevicesMin = &v +} + +// GetEndAt returns the EndAt field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetEndAt() time.Time { + if o == nil || IsNil(o.EndAt) { + var ret time.Time + return ret + } + return *o.EndAt +} + +// GetEndAtOk returns a tuple with the EndAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetEndAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.EndAt) { + return nil, false + } + return o.EndAt, true +} + +// HasEndAt returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasEndAt() bool { + if o != nil && !IsNil(o.EndAt) { + return true + } + + return false +} + +// SetEndAt gets a reference to the given time.Time and assigns it to the EndAt field. +func (o *SpotMarketRequestCreateInput) SetEndAt(v time.Time) { + o.EndAt = &v +} + +// GetFacilities returns the Facilities field value if set, zero value otherwise. +// Deprecated +func (o *SpotMarketRequestCreateInput) GetFacilities() []string { + if o == nil || IsNil(o.Facilities) { + var ret []string + return ret + } + return o.Facilities +} + +// GetFacilitiesOk returns a tuple with the Facilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *SpotMarketRequestCreateInput) GetFacilitiesOk() ([]string, bool) { + if o == nil || IsNil(o.Facilities) { + return nil, false + } + return o.Facilities, true +} + +// HasFacilities returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasFacilities() bool { + if o != nil && !IsNil(o.Facilities) { + return true + } + + return false +} + +// SetFacilities gets a reference to the given []string and assigns it to the Facilities field. +// Deprecated +func (o *SpotMarketRequestCreateInput) SetFacilities(v []string) { + o.Facilities = v +} + +// GetInstanceParameters returns the InstanceParameters field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetInstanceParameters() SpotMarketRequestCreateInputInstanceParameters { + if o == nil || IsNil(o.InstanceParameters) { + var ret SpotMarketRequestCreateInputInstanceParameters + return ret + } + return *o.InstanceParameters +} + +// GetInstanceParametersOk returns a tuple with the InstanceParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetInstanceParametersOk() (*SpotMarketRequestCreateInputInstanceParameters, bool) { + if o == nil || IsNil(o.InstanceParameters) { + return nil, false + } + return o.InstanceParameters, true +} + +// HasInstanceParameters returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasInstanceParameters() bool { + if o != nil && !IsNil(o.InstanceParameters) { + return true + } + + return false +} + +// SetInstanceParameters gets a reference to the given SpotMarketRequestCreateInputInstanceParameters and assigns it to the InstanceParameters field. +func (o *SpotMarketRequestCreateInput) SetInstanceParameters(v SpotMarketRequestCreateInputInstanceParameters) { + o.InstanceParameters = &v +} + +// GetMaxBidPrice returns the MaxBidPrice field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetMaxBidPrice() float32 { + if o == nil || IsNil(o.MaxBidPrice) { + var ret float32 + return ret + } + return *o.MaxBidPrice +} + +// GetMaxBidPriceOk returns a tuple with the MaxBidPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetMaxBidPriceOk() (*float32, bool) { + if o == nil || IsNil(o.MaxBidPrice) { + return nil, false + } + return o.MaxBidPrice, true +} + +// HasMaxBidPrice returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasMaxBidPrice() bool { + if o != nil && !IsNil(o.MaxBidPrice) { + return true + } + + return false +} + +// SetMaxBidPrice gets a reference to the given float32 and assigns it to the MaxBidPrice field. +func (o *SpotMarketRequestCreateInput) SetMaxBidPrice(v float32) { + o.MaxBidPrice = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInput) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInput) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInput) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *SpotMarketRequestCreateInput) SetMetro(v string) { + o.Metro = &v +} + +func (o SpotMarketRequestCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketRequestCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DevicesMax) { + toSerialize["devices_max"] = o.DevicesMax + } + if !IsNil(o.DevicesMin) { + toSerialize["devices_min"] = o.DevicesMin + } + if !IsNil(o.EndAt) { + toSerialize["end_at"] = o.EndAt + } + if !IsNil(o.Facilities) { + toSerialize["facilities"] = o.Facilities + } + if !IsNil(o.InstanceParameters) { + toSerialize["instance_parameters"] = o.InstanceParameters + } + if !IsNil(o.MaxBidPrice) { + toSerialize["max_bid_price"] = o.MaxBidPrice + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketRequestCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketRequestCreateInput := _SpotMarketRequestCreateInput{} + + err = json.Unmarshal(bytes, &varSpotMarketRequestCreateInput) + + if err != nil { + return err + } + + *o = SpotMarketRequestCreateInput(varSpotMarketRequestCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "devices_max") + delete(additionalProperties, "devices_min") + delete(additionalProperties, "end_at") + delete(additionalProperties, "facilities") + delete(additionalProperties, "instance_parameters") + delete(additionalProperties, "max_bid_price") + delete(additionalProperties, "metro") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketRequestCreateInput struct { + value *SpotMarketRequestCreateInput + isSet bool +} + +func (v NullableSpotMarketRequestCreateInput) Get() *SpotMarketRequestCreateInput { + return v.value +} + +func (v *NullableSpotMarketRequestCreateInput) Set(val *SpotMarketRequestCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketRequestCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketRequestCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketRequestCreateInput(val *SpotMarketRequestCreateInput) *NullableSpotMarketRequestCreateInput { + return &NullableSpotMarketRequestCreateInput{value: val, isSet: true} +} + +func (v NullableSpotMarketRequestCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketRequestCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_request_create_input_instance_parameters.go b/services/metalv1/model_spot_market_request_create_input_instance_parameters.go new file mode 100644 index 00000000..bcb92b8a --- /dev/null +++ b/services/metalv1/model_spot_market_request_create_input_instance_parameters.go @@ -0,0 +1,786 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the SpotMarketRequestCreateInputInstanceParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketRequestCreateInputInstanceParameters{} + +// SpotMarketRequestCreateInputInstanceParameters struct for SpotMarketRequestCreateInputInstanceParameters +type SpotMarketRequestCreateInputInstanceParameters struct { + AlwaysPxe *bool `json:"always_pxe,omitempty"` + BillingCycle *string `json:"billing_cycle,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Description *string `json:"description,omitempty"` + Features []string `json:"features,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Hostnames []string `json:"hostnames,omitempty"` + // Whether the device should be locked, preventing accidental deletion. + Locked *bool `json:"locked,omitempty"` + NoSshKeys *bool `json:"no_ssh_keys,omitempty"` + OperatingSystem *string `json:"operating_system,omitempty"` + Plan *string `json:"plan,omitempty"` + PrivateIpv4SubnetSize *int32 `json:"private_ipv4_subnet_size,omitempty"` + ProjectSshKeys []string `json:"project_ssh_keys,omitempty"` + PublicIpv4SubnetSize *int32 `json:"public_ipv4_subnet_size,omitempty"` + Tags []string `json:"tags,omitempty"` + TerminationTime *time.Time `json:"termination_time,omitempty"` + // The UUIDs of users whose SSH keys should be included on the provisioned device. + UserSshKeys []string `json:"user_ssh_keys,omitempty"` + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketRequestCreateInputInstanceParameters SpotMarketRequestCreateInputInstanceParameters + +// NewSpotMarketRequestCreateInputInstanceParameters instantiates a new SpotMarketRequestCreateInputInstanceParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketRequestCreateInputInstanceParameters() *SpotMarketRequestCreateInputInstanceParameters { + this := SpotMarketRequestCreateInputInstanceParameters{} + return &this +} + +// NewSpotMarketRequestCreateInputInstanceParametersWithDefaults instantiates a new SpotMarketRequestCreateInputInstanceParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketRequestCreateInputInstanceParametersWithDefaults() *SpotMarketRequestCreateInputInstanceParameters { + this := SpotMarketRequestCreateInputInstanceParameters{} + return &this +} + +// GetAlwaysPxe returns the AlwaysPxe field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetAlwaysPxe() bool { + if o == nil || IsNil(o.AlwaysPxe) { + var ret bool + return ret + } + return *o.AlwaysPxe +} + +// GetAlwaysPxeOk returns a tuple with the AlwaysPxe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetAlwaysPxeOk() (*bool, bool) { + if o == nil || IsNil(o.AlwaysPxe) { + return nil, false + } + return o.AlwaysPxe, true +} + +// HasAlwaysPxe returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasAlwaysPxe() bool { + if o != nil && !IsNil(o.AlwaysPxe) { + return true + } + + return false +} + +// SetAlwaysPxe gets a reference to the given bool and assigns it to the AlwaysPxe field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetAlwaysPxe(v bool) { + o.AlwaysPxe = &v +} + +// GetBillingCycle returns the BillingCycle field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetBillingCycle() string { + if o == nil || IsNil(o.BillingCycle) { + var ret string + return ret + } + return *o.BillingCycle +} + +// GetBillingCycleOk returns a tuple with the BillingCycle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetBillingCycleOk() (*string, bool) { + if o == nil || IsNil(o.BillingCycle) { + return nil, false + } + return o.BillingCycle, true +} + +// HasBillingCycle returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasBillingCycle() bool { + if o != nil && !IsNil(o.BillingCycle) { + return true + } + + return false +} + +// SetBillingCycle gets a reference to the given string and assigns it to the BillingCycle field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetBillingCycle(v string) { + o.BillingCycle = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetDescription(v string) { + o.Description = &v +} + +// GetFeatures returns the Features field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetFeatures() []string { + if o == nil || IsNil(o.Features) { + var ret []string + return ret + } + return o.Features +} + +// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetFeaturesOk() ([]string, bool) { + if o == nil || IsNil(o.Features) { + return nil, false + } + return o.Features, true +} + +// HasFeatures returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasFeatures() bool { + if o != nil && !IsNil(o.Features) { + return true + } + + return false +} + +// SetFeatures gets a reference to the given []string and assigns it to the Features field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetFeatures(v []string) { + o.Features = v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetHostname(v string) { + o.Hostname = &v +} + +// GetHostnames returns the Hostnames field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnames() []string { + if o == nil || IsNil(o.Hostnames) { + var ret []string + return ret + } + return o.Hostnames +} + +// GetHostnamesOk returns a tuple with the Hostnames field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetHostnamesOk() ([]string, bool) { + if o == nil || IsNil(o.Hostnames) { + return nil, false + } + return o.Hostnames, true +} + +// HasHostnames returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasHostnames() bool { + if o != nil && !IsNil(o.Hostnames) { + return true + } + + return false +} + +// SetHostnames gets a reference to the given []string and assigns it to the Hostnames field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetHostnames(v []string) { + o.Hostnames = v +} + +// GetLocked returns the Locked field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetLocked() bool { + if o == nil || IsNil(o.Locked) { + var ret bool + return ret + } + return *o.Locked +} + +// GetLockedOk returns a tuple with the Locked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetLockedOk() (*bool, bool) { + if o == nil || IsNil(o.Locked) { + return nil, false + } + return o.Locked, true +} + +// HasLocked returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasLocked() bool { + if o != nil && !IsNil(o.Locked) { + return true + } + + return false +} + +// SetLocked gets a reference to the given bool and assigns it to the Locked field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetLocked(v bool) { + o.Locked = &v +} + +// GetNoSshKeys returns the NoSshKeys field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetNoSshKeys() bool { + if o == nil || IsNil(o.NoSshKeys) { + var ret bool + return ret + } + return *o.NoSshKeys +} + +// GetNoSshKeysOk returns a tuple with the NoSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetNoSshKeysOk() (*bool, bool) { + if o == nil || IsNil(o.NoSshKeys) { + return nil, false + } + return o.NoSshKeys, true +} + +// HasNoSshKeys returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasNoSshKeys() bool { + if o != nil && !IsNil(o.NoSshKeys) { + return true + } + + return false +} + +// SetNoSshKeys gets a reference to the given bool and assigns it to the NoSshKeys field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetNoSshKeys(v bool) { + o.NoSshKeys = &v +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetOperatingSystem() string { + if o == nil || IsNil(o.OperatingSystem) { + var ret string + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetOperatingSystemOk() (*string, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetOperatingSystem(v string) { + o.OperatingSystem = &v +} + +// GetPlan returns the Plan field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPlan() string { + if o == nil || IsNil(o.Plan) { + var ret string + return ret + } + return *o.Plan +} + +// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPlanOk() (*string, bool) { + if o == nil || IsNil(o.Plan) { + return nil, false + } + return o.Plan, true +} + +// HasPlan returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasPlan() bool { + if o != nil && !IsNil(o.Plan) { + return true + } + + return false +} + +// SetPlan gets a reference to the given string and assigns it to the Plan field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetPlan(v string) { + o.Plan = &v +} + +// GetPrivateIpv4SubnetSize returns the PrivateIpv4SubnetSize field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPrivateIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PrivateIpv4SubnetSize +} + +// GetPrivateIpv4SubnetSizeOk returns a tuple with the PrivateIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPrivateIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PrivateIpv4SubnetSize) { + return nil, false + } + return o.PrivateIpv4SubnetSize, true +} + +// HasPrivateIpv4SubnetSize returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasPrivateIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PrivateIpv4SubnetSize) { + return true + } + + return false +} + +// SetPrivateIpv4SubnetSize gets a reference to the given int32 and assigns it to the PrivateIpv4SubnetSize field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetPrivateIpv4SubnetSize(v int32) { + o.PrivateIpv4SubnetSize = &v +} + +// GetProjectSshKeys returns the ProjectSshKeys field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetProjectSshKeys() []string { + if o == nil || IsNil(o.ProjectSshKeys) { + var ret []string + return ret + } + return o.ProjectSshKeys +} + +// GetProjectSshKeysOk returns a tuple with the ProjectSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetProjectSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.ProjectSshKeys) { + return nil, false + } + return o.ProjectSshKeys, true +} + +// HasProjectSshKeys returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasProjectSshKeys() bool { + if o != nil && !IsNil(o.ProjectSshKeys) { + return true + } + + return false +} + +// SetProjectSshKeys gets a reference to the given []string and assigns it to the ProjectSshKeys field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetProjectSshKeys(v []string) { + o.ProjectSshKeys = v +} + +// GetPublicIpv4SubnetSize returns the PublicIpv4SubnetSize field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPublicIpv4SubnetSize() int32 { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + var ret int32 + return ret + } + return *o.PublicIpv4SubnetSize +} + +// GetPublicIpv4SubnetSizeOk returns a tuple with the PublicIpv4SubnetSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetPublicIpv4SubnetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PublicIpv4SubnetSize) { + return nil, false + } + return o.PublicIpv4SubnetSize, true +} + +// HasPublicIpv4SubnetSize returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasPublicIpv4SubnetSize() bool { + if o != nil && !IsNil(o.PublicIpv4SubnetSize) { + return true + } + + return false +} + +// SetPublicIpv4SubnetSize gets a reference to the given int32 and assigns it to the PublicIpv4SubnetSize field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetPublicIpv4SubnetSize(v int32) { + o.PublicIpv4SubnetSize = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetTags(v []string) { + o.Tags = v +} + +// GetTerminationTime returns the TerminationTime field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetTerminationTime() time.Time { + if o == nil || IsNil(o.TerminationTime) { + var ret time.Time + return ret + } + return *o.TerminationTime +} + +// GetTerminationTimeOk returns a tuple with the TerminationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetTerminationTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.TerminationTime) { + return nil, false + } + return o.TerminationTime, true +} + +// HasTerminationTime returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasTerminationTime() bool { + if o != nil && !IsNil(o.TerminationTime) { + return true + } + + return false +} + +// SetTerminationTime gets a reference to the given time.Time and assigns it to the TerminationTime field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetTerminationTime(v time.Time) { + o.TerminationTime = &v +} + +// GetUserSshKeys returns the UserSshKeys field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserSshKeys() []string { + if o == nil || IsNil(o.UserSshKeys) { + var ret []string + return ret + } + return o.UserSshKeys +} + +// GetUserSshKeysOk returns a tuple with the UserSshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserSshKeysOk() ([]string, bool) { + if o == nil || IsNil(o.UserSshKeys) { + return nil, false + } + return o.UserSshKeys, true +} + +// HasUserSshKeys returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasUserSshKeys() bool { + if o != nil && !IsNil(o.UserSshKeys) { + return true + } + + return false +} + +// SetUserSshKeys gets a reference to the given []string and assigns it to the UserSshKeys field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetUserSshKeys(v []string) { + o.UserSshKeys = v +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *SpotMarketRequestCreateInputInstanceParameters) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *SpotMarketRequestCreateInputInstanceParameters) SetUserdata(v string) { + o.Userdata = &v +} + +func (o SpotMarketRequestCreateInputInstanceParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketRequestCreateInputInstanceParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AlwaysPxe) { + toSerialize["always_pxe"] = o.AlwaysPxe + } + if !IsNil(o.BillingCycle) { + toSerialize["billing_cycle"] = o.BillingCycle + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Features) { + toSerialize["features"] = o.Features + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.Hostnames) { + toSerialize["hostnames"] = o.Hostnames + } + if !IsNil(o.Locked) { + toSerialize["locked"] = o.Locked + } + if !IsNil(o.NoSshKeys) { + toSerialize["no_ssh_keys"] = o.NoSshKeys + } + if !IsNil(o.OperatingSystem) { + toSerialize["operating_system"] = o.OperatingSystem + } + if !IsNil(o.Plan) { + toSerialize["plan"] = o.Plan + } + if !IsNil(o.PrivateIpv4SubnetSize) { + toSerialize["private_ipv4_subnet_size"] = o.PrivateIpv4SubnetSize + } + if !IsNil(o.ProjectSshKeys) { + toSerialize["project_ssh_keys"] = o.ProjectSshKeys + } + if !IsNil(o.PublicIpv4SubnetSize) { + toSerialize["public_ipv4_subnet_size"] = o.PublicIpv4SubnetSize + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.TerminationTime) { + toSerialize["termination_time"] = o.TerminationTime + } + if !IsNil(o.UserSshKeys) { + toSerialize["user_ssh_keys"] = o.UserSshKeys + } + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketRequestCreateInputInstanceParameters) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketRequestCreateInputInstanceParameters := _SpotMarketRequestCreateInputInstanceParameters{} + + err = json.Unmarshal(bytes, &varSpotMarketRequestCreateInputInstanceParameters) + + if err != nil { + return err + } + + *o = SpotMarketRequestCreateInputInstanceParameters(varSpotMarketRequestCreateInputInstanceParameters) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "always_pxe") + delete(additionalProperties, "billing_cycle") + delete(additionalProperties, "customdata") + delete(additionalProperties, "description") + delete(additionalProperties, "features") + delete(additionalProperties, "hostname") + delete(additionalProperties, "hostnames") + delete(additionalProperties, "locked") + delete(additionalProperties, "no_ssh_keys") + delete(additionalProperties, "operating_system") + delete(additionalProperties, "plan") + delete(additionalProperties, "private_ipv4_subnet_size") + delete(additionalProperties, "project_ssh_keys") + delete(additionalProperties, "public_ipv4_subnet_size") + delete(additionalProperties, "tags") + delete(additionalProperties, "termination_time") + delete(additionalProperties, "user_ssh_keys") + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketRequestCreateInputInstanceParameters struct { + value *SpotMarketRequestCreateInputInstanceParameters + isSet bool +} + +func (v NullableSpotMarketRequestCreateInputInstanceParameters) Get() *SpotMarketRequestCreateInputInstanceParameters { + return v.value +} + +func (v *NullableSpotMarketRequestCreateInputInstanceParameters) Set(val *SpotMarketRequestCreateInputInstanceParameters) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketRequestCreateInputInstanceParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketRequestCreateInputInstanceParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketRequestCreateInputInstanceParameters(val *SpotMarketRequestCreateInputInstanceParameters) *NullableSpotMarketRequestCreateInputInstanceParameters { + return &NullableSpotMarketRequestCreateInputInstanceParameters{value: val, isSet: true} +} + +func (v NullableSpotMarketRequestCreateInputInstanceParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketRequestCreateInputInstanceParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_request_list.go b/services/metalv1/model_spot_market_request_list.go new file mode 100644 index 00000000..2d2cfa10 --- /dev/null +++ b/services/metalv1/model_spot_market_request_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotMarketRequestList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketRequestList{} + +// SpotMarketRequestList struct for SpotMarketRequestList +type SpotMarketRequestList struct { + SpotMarketRequests []SpotMarketRequest `json:"spot_market_requests,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketRequestList SpotMarketRequestList + +// NewSpotMarketRequestList instantiates a new SpotMarketRequestList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketRequestList() *SpotMarketRequestList { + this := SpotMarketRequestList{} + return &this +} + +// NewSpotMarketRequestListWithDefaults instantiates a new SpotMarketRequestList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketRequestListWithDefaults() *SpotMarketRequestList { + this := SpotMarketRequestList{} + return &this +} + +// GetSpotMarketRequests returns the SpotMarketRequests field value if set, zero value otherwise. +func (o *SpotMarketRequestList) GetSpotMarketRequests() []SpotMarketRequest { + if o == nil || IsNil(o.SpotMarketRequests) { + var ret []SpotMarketRequest + return ret + } + return o.SpotMarketRequests +} + +// GetSpotMarketRequestsOk returns a tuple with the SpotMarketRequests field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestList) GetSpotMarketRequestsOk() ([]SpotMarketRequest, bool) { + if o == nil || IsNil(o.SpotMarketRequests) { + return nil, false + } + return o.SpotMarketRequests, true +} + +// HasSpotMarketRequests returns a boolean if a field has been set. +func (o *SpotMarketRequestList) HasSpotMarketRequests() bool { + if o != nil && !IsNil(o.SpotMarketRequests) { + return true + } + + return false +} + +// SetSpotMarketRequests gets a reference to the given []SpotMarketRequest and assigns it to the SpotMarketRequests field. +func (o *SpotMarketRequestList) SetSpotMarketRequests(v []SpotMarketRequest) { + o.SpotMarketRequests = v +} + +func (o SpotMarketRequestList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketRequestList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SpotMarketRequests) { + toSerialize["spot_market_requests"] = o.SpotMarketRequests + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketRequestList) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketRequestList := _SpotMarketRequestList{} + + err = json.Unmarshal(bytes, &varSpotMarketRequestList) + + if err != nil { + return err + } + + *o = SpotMarketRequestList(varSpotMarketRequestList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "spot_market_requests") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketRequestList struct { + value *SpotMarketRequestList + isSet bool +} + +func (v NullableSpotMarketRequestList) Get() *SpotMarketRequestList { + return v.value +} + +func (v *NullableSpotMarketRequestList) Set(val *SpotMarketRequestList) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketRequestList) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketRequestList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketRequestList(val *SpotMarketRequestList) *NullableSpotMarketRequestList { + return &NullableSpotMarketRequestList{value: val, isSet: true} +} + +func (v NullableSpotMarketRequestList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketRequestList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_market_request_metro.go b/services/metalv1/model_spot_market_request_metro.go new file mode 100644 index 00000000..2ac85d88 --- /dev/null +++ b/services/metalv1/model_spot_market_request_metro.go @@ -0,0 +1,265 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotMarketRequestMetro type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotMarketRequestMetro{} + +// SpotMarketRequestMetro struct for SpotMarketRequestMetro +type SpotMarketRequestMetro struct { + Code *string `json:"code,omitempty"` + Country *string `json:"country,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotMarketRequestMetro SpotMarketRequestMetro + +// NewSpotMarketRequestMetro instantiates a new SpotMarketRequestMetro object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotMarketRequestMetro() *SpotMarketRequestMetro { + this := SpotMarketRequestMetro{} + return &this +} + +// NewSpotMarketRequestMetroWithDefaults instantiates a new SpotMarketRequestMetro object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotMarketRequestMetroWithDefaults() *SpotMarketRequestMetro { + this := SpotMarketRequestMetro{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *SpotMarketRequestMetro) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestMetro) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *SpotMarketRequestMetro) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *SpotMarketRequestMetro) SetCode(v string) { + o.Code = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *SpotMarketRequestMetro) GetCountry() string { + if o == nil || IsNil(o.Country) { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestMetro) GetCountryOk() (*string, bool) { + if o == nil || IsNil(o.Country) { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *SpotMarketRequestMetro) HasCountry() bool { + if o != nil && !IsNil(o.Country) { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *SpotMarketRequestMetro) SetCountry(v string) { + o.Country = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SpotMarketRequestMetro) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestMetro) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SpotMarketRequestMetro) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SpotMarketRequestMetro) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SpotMarketRequestMetro) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotMarketRequestMetro) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SpotMarketRequestMetro) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SpotMarketRequestMetro) SetName(v string) { + o.Name = &v +} + +func (o SpotMarketRequestMetro) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotMarketRequestMetro) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Country) { + toSerialize["country"] = o.Country + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotMarketRequestMetro) UnmarshalJSON(bytes []byte) (err error) { + varSpotMarketRequestMetro := _SpotMarketRequestMetro{} + + err = json.Unmarshal(bytes, &varSpotMarketRequestMetro) + + if err != nil { + return err + } + + *o = SpotMarketRequestMetro(varSpotMarketRequestMetro) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "country") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotMarketRequestMetro struct { + value *SpotMarketRequestMetro + isSet bool +} + +func (v NullableSpotMarketRequestMetro) Get() *SpotMarketRequestMetro { + return v.value +} + +func (v *NullableSpotMarketRequestMetro) Set(val *SpotMarketRequestMetro) { + v.value = val + v.isSet = true +} + +func (v NullableSpotMarketRequestMetro) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotMarketRequestMetro) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotMarketRequestMetro(val *SpotMarketRequestMetro) *NullableSpotMarketRequestMetro { + return &NullableSpotMarketRequestMetro{value: val, isSet: true} +} + +func (v NullableSpotMarketRequestMetro) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotMarketRequestMetro) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_datapoints.go b/services/metalv1/model_spot_prices_datapoints.go new file mode 100644 index 00000000..85f12460 --- /dev/null +++ b/services/metalv1/model_spot_prices_datapoints.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesDatapoints type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesDatapoints{} + +// SpotPricesDatapoints struct for SpotPricesDatapoints +type SpotPricesDatapoints struct { + Datapoints [][]float32 `json:"datapoints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesDatapoints SpotPricesDatapoints + +// NewSpotPricesDatapoints instantiates a new SpotPricesDatapoints object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesDatapoints() *SpotPricesDatapoints { + this := SpotPricesDatapoints{} + return &this +} + +// NewSpotPricesDatapointsWithDefaults instantiates a new SpotPricesDatapoints object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesDatapointsWithDefaults() *SpotPricesDatapoints { + this := SpotPricesDatapoints{} + return &this +} + +// GetDatapoints returns the Datapoints field value if set, zero value otherwise. +func (o *SpotPricesDatapoints) GetDatapoints() [][]float32 { + if o == nil || IsNil(o.Datapoints) { + var ret [][]float32 + return ret + } + return o.Datapoints +} + +// GetDatapointsOk returns a tuple with the Datapoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesDatapoints) GetDatapointsOk() ([][]float32, bool) { + if o == nil || IsNil(o.Datapoints) { + return nil, false + } + return o.Datapoints, true +} + +// HasDatapoints returns a boolean if a field has been set. +func (o *SpotPricesDatapoints) HasDatapoints() bool { + if o != nil && !IsNil(o.Datapoints) { + return true + } + + return false +} + +// SetDatapoints gets a reference to the given [][]float32 and assigns it to the Datapoints field. +func (o *SpotPricesDatapoints) SetDatapoints(v [][]float32) { + o.Datapoints = v +} + +func (o SpotPricesDatapoints) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesDatapoints) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Datapoints) { + toSerialize["datapoints"] = o.Datapoints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesDatapoints) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesDatapoints := _SpotPricesDatapoints{} + + err = json.Unmarshal(bytes, &varSpotPricesDatapoints) + + if err != nil { + return err + } + + *o = SpotPricesDatapoints(varSpotPricesDatapoints) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "datapoints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesDatapoints struct { + value *SpotPricesDatapoints + isSet bool +} + +func (v NullableSpotPricesDatapoints) Get() *SpotPricesDatapoints { + return v.value +} + +func (v *NullableSpotPricesDatapoints) Set(val *SpotPricesDatapoints) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesDatapoints) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesDatapoints) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesDatapoints(val *SpotPricesDatapoints) *NullableSpotPricesDatapoints { + return &NullableSpotPricesDatapoints{value: val, isSet: true} +} + +func (v NullableSpotPricesDatapoints) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesDatapoints) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_history_report.go b/services/metalv1/model_spot_prices_history_report.go new file mode 100644 index 00000000..356899b5 --- /dev/null +++ b/services/metalv1/model_spot_prices_history_report.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesHistoryReport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesHistoryReport{} + +// SpotPricesHistoryReport struct for SpotPricesHistoryReport +type SpotPricesHistoryReport struct { + PricesHistory *SpotPricesDatapoints `json:"prices_history,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesHistoryReport SpotPricesHistoryReport + +// NewSpotPricesHistoryReport instantiates a new SpotPricesHistoryReport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesHistoryReport() *SpotPricesHistoryReport { + this := SpotPricesHistoryReport{} + return &this +} + +// NewSpotPricesHistoryReportWithDefaults instantiates a new SpotPricesHistoryReport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesHistoryReportWithDefaults() *SpotPricesHistoryReport { + this := SpotPricesHistoryReport{} + return &this +} + +// GetPricesHistory returns the PricesHistory field value if set, zero value otherwise. +func (o *SpotPricesHistoryReport) GetPricesHistory() SpotPricesDatapoints { + if o == nil || IsNil(o.PricesHistory) { + var ret SpotPricesDatapoints + return ret + } + return *o.PricesHistory +} + +// GetPricesHistoryOk returns a tuple with the PricesHistory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesHistoryReport) GetPricesHistoryOk() (*SpotPricesDatapoints, bool) { + if o == nil || IsNil(o.PricesHistory) { + return nil, false + } + return o.PricesHistory, true +} + +// HasPricesHistory returns a boolean if a field has been set. +func (o *SpotPricesHistoryReport) HasPricesHistory() bool { + if o != nil && !IsNil(o.PricesHistory) { + return true + } + + return false +} + +// SetPricesHistory gets a reference to the given SpotPricesDatapoints and assigns it to the PricesHistory field. +func (o *SpotPricesHistoryReport) SetPricesHistory(v SpotPricesDatapoints) { + o.PricesHistory = &v +} + +func (o SpotPricesHistoryReport) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesHistoryReport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.PricesHistory) { + toSerialize["prices_history"] = o.PricesHistory + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesHistoryReport) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesHistoryReport := _SpotPricesHistoryReport{} + + err = json.Unmarshal(bytes, &varSpotPricesHistoryReport) + + if err != nil { + return err + } + + *o = SpotPricesHistoryReport(varSpotPricesHistoryReport) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "prices_history") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesHistoryReport struct { + value *SpotPricesHistoryReport + isSet bool +} + +func (v NullableSpotPricesHistoryReport) Get() *SpotPricesHistoryReport { + return v.value +} + +func (v *NullableSpotPricesHistoryReport) Set(val *SpotPricesHistoryReport) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesHistoryReport) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesHistoryReport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesHistoryReport(val *SpotPricesHistoryReport) *NullableSpotPricesHistoryReport { + return &NullableSpotPricesHistoryReport{value: val, isSet: true} +} + +func (v NullableSpotPricesHistoryReport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesHistoryReport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_per_baremetal.go b/services/metalv1/model_spot_prices_per_baremetal.go new file mode 100644 index 00000000..957ad39a --- /dev/null +++ b/services/metalv1/model_spot_prices_per_baremetal.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesPerBaremetal type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesPerBaremetal{} + +// SpotPricesPerBaremetal struct for SpotPricesPerBaremetal +type SpotPricesPerBaremetal struct { + Price *float32 `json:"price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesPerBaremetal SpotPricesPerBaremetal + +// NewSpotPricesPerBaremetal instantiates a new SpotPricesPerBaremetal object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesPerBaremetal() *SpotPricesPerBaremetal { + this := SpotPricesPerBaremetal{} + return &this +} + +// NewSpotPricesPerBaremetalWithDefaults instantiates a new SpotPricesPerBaremetal object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesPerBaremetalWithDefaults() *SpotPricesPerBaremetal { + this := SpotPricesPerBaremetal{} + return &this +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *SpotPricesPerBaremetal) GetPrice() float32 { + if o == nil || IsNil(o.Price) { + var ret float32 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerBaremetal) GetPriceOk() (*float32, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *SpotPricesPerBaremetal) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given float32 and assigns it to the Price field. +func (o *SpotPricesPerBaremetal) SetPrice(v float32) { + o.Price = &v +} + +func (o SpotPricesPerBaremetal) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesPerBaremetal) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesPerBaremetal) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesPerBaremetal := _SpotPricesPerBaremetal{} + + err = json.Unmarshal(bytes, &varSpotPricesPerBaremetal) + + if err != nil { + return err + } + + *o = SpotPricesPerBaremetal(varSpotPricesPerBaremetal) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesPerBaremetal struct { + value *SpotPricesPerBaremetal + isSet bool +} + +func (v NullableSpotPricesPerBaremetal) Get() *SpotPricesPerBaremetal { + return v.value +} + +func (v *NullableSpotPricesPerBaremetal) Set(val *SpotPricesPerBaremetal) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesPerBaremetal) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesPerBaremetal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesPerBaremetal(val *SpotPricesPerBaremetal) *NullableSpotPricesPerBaremetal { + return &NullableSpotPricesPerBaremetal{value: val, isSet: true} +} + +func (v NullableSpotPricesPerBaremetal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesPerBaremetal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_per_facility.go b/services/metalv1/model_spot_prices_per_facility.go new file mode 100644 index 00000000..8716b1a4 --- /dev/null +++ b/services/metalv1/model_spot_prices_per_facility.go @@ -0,0 +1,450 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesPerFacility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesPerFacility{} + +// SpotPricesPerFacility struct for SpotPricesPerFacility +type SpotPricesPerFacility struct { + Baremetal0 *SpotPricesPerBaremetal `json:"baremetal_0,omitempty"` + Baremetal1 *SpotPricesPerBaremetal `json:"baremetal_1,omitempty"` + Baremetal2 *SpotPricesPerBaremetal `json:"baremetal_2,omitempty"` + Baremetal2a *SpotPricesPerBaremetal `json:"baremetal_2a,omitempty"` + Baremetal2a2 *SpotPricesPerBaremetal `json:"baremetal_2a2,omitempty"` + Baremetal3 *SpotPricesPerBaremetal `json:"baremetal_3,omitempty"` + BaremetalS *SpotPricesPerBaremetal `json:"baremetal_s,omitempty"` + C2MediumX86 *SpotPricesPerBaremetal `json:"c2.medium.x86,omitempty"` + M2XlargeX86 *SpotPricesPerBaremetal `json:"m2.xlarge.x86,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesPerFacility SpotPricesPerFacility + +// NewSpotPricesPerFacility instantiates a new SpotPricesPerFacility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesPerFacility() *SpotPricesPerFacility { + this := SpotPricesPerFacility{} + return &this +} + +// NewSpotPricesPerFacilityWithDefaults instantiates a new SpotPricesPerFacility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesPerFacilityWithDefaults() *SpotPricesPerFacility { + this := SpotPricesPerFacility{} + return &this +} + +// GetBaremetal0 returns the Baremetal0 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal0() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal0) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal0 +} + +// GetBaremetal0Ok returns a tuple with the Baremetal0 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal0Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal0) { + return nil, false + } + return o.Baremetal0, true +} + +// HasBaremetal0 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal0() bool { + if o != nil && !IsNil(o.Baremetal0) { + return true + } + + return false +} + +// SetBaremetal0 gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal0 field. +func (o *SpotPricesPerFacility) SetBaremetal0(v SpotPricesPerBaremetal) { + o.Baremetal0 = &v +} + +// GetBaremetal1 returns the Baremetal1 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal1() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal1) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal1 +} + +// GetBaremetal1Ok returns a tuple with the Baremetal1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal1Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal1) { + return nil, false + } + return o.Baremetal1, true +} + +// HasBaremetal1 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal1() bool { + if o != nil && !IsNil(o.Baremetal1) { + return true + } + + return false +} + +// SetBaremetal1 gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal1 field. +func (o *SpotPricesPerFacility) SetBaremetal1(v SpotPricesPerBaremetal) { + o.Baremetal1 = &v +} + +// GetBaremetal2 returns the Baremetal2 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal2() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal2) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal2 +} + +// GetBaremetal2Ok returns a tuple with the Baremetal2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal2Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal2) { + return nil, false + } + return o.Baremetal2, true +} + +// HasBaremetal2 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal2() bool { + if o != nil && !IsNil(o.Baremetal2) { + return true + } + + return false +} + +// SetBaremetal2 gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal2 field. +func (o *SpotPricesPerFacility) SetBaremetal2(v SpotPricesPerBaremetal) { + o.Baremetal2 = &v +} + +// GetBaremetal2a returns the Baremetal2a field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal2a() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal2a) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal2a +} + +// GetBaremetal2aOk returns a tuple with the Baremetal2a field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal2aOk() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal2a) { + return nil, false + } + return o.Baremetal2a, true +} + +// HasBaremetal2a returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal2a() bool { + if o != nil && !IsNil(o.Baremetal2a) { + return true + } + + return false +} + +// SetBaremetal2a gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal2a field. +func (o *SpotPricesPerFacility) SetBaremetal2a(v SpotPricesPerBaremetal) { + o.Baremetal2a = &v +} + +// GetBaremetal2a2 returns the Baremetal2a2 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal2a2() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal2a2) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal2a2 +} + +// GetBaremetal2a2Ok returns a tuple with the Baremetal2a2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal2a2Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal2a2) { + return nil, false + } + return o.Baremetal2a2, true +} + +// HasBaremetal2a2 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal2a2() bool { + if o != nil && !IsNil(o.Baremetal2a2) { + return true + } + + return false +} + +// SetBaremetal2a2 gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal2a2 field. +func (o *SpotPricesPerFacility) SetBaremetal2a2(v SpotPricesPerBaremetal) { + o.Baremetal2a2 = &v +} + +// GetBaremetal3 returns the Baremetal3 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetal3() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal3) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal3 +} + +// GetBaremetal3Ok returns a tuple with the Baremetal3 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetal3Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal3) { + return nil, false + } + return o.Baremetal3, true +} + +// HasBaremetal3 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetal3() bool { + if o != nil && !IsNil(o.Baremetal3) { + return true + } + + return false +} + +// SetBaremetal3 gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal3 field. +func (o *SpotPricesPerFacility) SetBaremetal3(v SpotPricesPerBaremetal) { + o.Baremetal3 = &v +} + +// GetBaremetalS returns the BaremetalS field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetBaremetalS() SpotPricesPerBaremetal { + if o == nil || IsNil(o.BaremetalS) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.BaremetalS +} + +// GetBaremetalSOk returns a tuple with the BaremetalS field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetBaremetalSOk() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.BaremetalS) { + return nil, false + } + return o.BaremetalS, true +} + +// HasBaremetalS returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasBaremetalS() bool { + if o != nil && !IsNil(o.BaremetalS) { + return true + } + + return false +} + +// SetBaremetalS gets a reference to the given SpotPricesPerBaremetal and assigns it to the BaremetalS field. +func (o *SpotPricesPerFacility) SetBaremetalS(v SpotPricesPerBaremetal) { + o.BaremetalS = &v +} + +// GetC2MediumX86 returns the C2MediumX86 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetC2MediumX86() SpotPricesPerBaremetal { + if o == nil || IsNil(o.C2MediumX86) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.C2MediumX86 +} + +// GetC2MediumX86Ok returns a tuple with the C2MediumX86 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetC2MediumX86Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.C2MediumX86) { + return nil, false + } + return o.C2MediumX86, true +} + +// HasC2MediumX86 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasC2MediumX86() bool { + if o != nil && !IsNil(o.C2MediumX86) { + return true + } + + return false +} + +// SetC2MediumX86 gets a reference to the given SpotPricesPerBaremetal and assigns it to the C2MediumX86 field. +func (o *SpotPricesPerFacility) SetC2MediumX86(v SpotPricesPerBaremetal) { + o.C2MediumX86 = &v +} + +// GetM2XlargeX86 returns the M2XlargeX86 field value if set, zero value otherwise. +func (o *SpotPricesPerFacility) GetM2XlargeX86() SpotPricesPerBaremetal { + if o == nil || IsNil(o.M2XlargeX86) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.M2XlargeX86 +} + +// GetM2XlargeX86Ok returns a tuple with the M2XlargeX86 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerFacility) GetM2XlargeX86Ok() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.M2XlargeX86) { + return nil, false + } + return o.M2XlargeX86, true +} + +// HasM2XlargeX86 returns a boolean if a field has been set. +func (o *SpotPricesPerFacility) HasM2XlargeX86() bool { + if o != nil && !IsNil(o.M2XlargeX86) { + return true + } + + return false +} + +// SetM2XlargeX86 gets a reference to the given SpotPricesPerBaremetal and assigns it to the M2XlargeX86 field. +func (o *SpotPricesPerFacility) SetM2XlargeX86(v SpotPricesPerBaremetal) { + o.M2XlargeX86 = &v +} + +func (o SpotPricesPerFacility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesPerFacility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Baremetal0) { + toSerialize["baremetal_0"] = o.Baremetal0 + } + if !IsNil(o.Baremetal1) { + toSerialize["baremetal_1"] = o.Baremetal1 + } + if !IsNil(o.Baremetal2) { + toSerialize["baremetal_2"] = o.Baremetal2 + } + if !IsNil(o.Baremetal2a) { + toSerialize["baremetal_2a"] = o.Baremetal2a + } + if !IsNil(o.Baremetal2a2) { + toSerialize["baremetal_2a2"] = o.Baremetal2a2 + } + if !IsNil(o.Baremetal3) { + toSerialize["baremetal_3"] = o.Baremetal3 + } + if !IsNil(o.BaremetalS) { + toSerialize["baremetal_s"] = o.BaremetalS + } + if !IsNil(o.C2MediumX86) { + toSerialize["c2.medium.x86"] = o.C2MediumX86 + } + if !IsNil(o.M2XlargeX86) { + toSerialize["m2.xlarge.x86"] = o.M2XlargeX86 + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesPerFacility) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesPerFacility := _SpotPricesPerFacility{} + + err = json.Unmarshal(bytes, &varSpotPricesPerFacility) + + if err != nil { + return err + } + + *o = SpotPricesPerFacility(varSpotPricesPerFacility) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "baremetal_0") + delete(additionalProperties, "baremetal_1") + delete(additionalProperties, "baremetal_2") + delete(additionalProperties, "baremetal_2a") + delete(additionalProperties, "baremetal_2a2") + delete(additionalProperties, "baremetal_3") + delete(additionalProperties, "baremetal_s") + delete(additionalProperties, "c2.medium.x86") + delete(additionalProperties, "m2.xlarge.x86") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesPerFacility struct { + value *SpotPricesPerFacility + isSet bool +} + +func (v NullableSpotPricesPerFacility) Get() *SpotPricesPerFacility { + return v.value +} + +func (v *NullableSpotPricesPerFacility) Set(val *SpotPricesPerFacility) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesPerFacility) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesPerFacility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesPerFacility(val *SpotPricesPerFacility) *NullableSpotPricesPerFacility { + return &NullableSpotPricesPerFacility{value: val, isSet: true} +} + +func (v NullableSpotPricesPerFacility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesPerFacility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_per_new_facility.go b/services/metalv1/model_spot_prices_per_new_facility.go new file mode 100644 index 00000000..1a7c99cd --- /dev/null +++ b/services/metalv1/model_spot_prices_per_new_facility.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesPerNewFacility type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesPerNewFacility{} + +// SpotPricesPerNewFacility struct for SpotPricesPerNewFacility +type SpotPricesPerNewFacility struct { + Baremetal1e *SpotPricesPerBaremetal `json:"baremetal_1e,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesPerNewFacility SpotPricesPerNewFacility + +// NewSpotPricesPerNewFacility instantiates a new SpotPricesPerNewFacility object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesPerNewFacility() *SpotPricesPerNewFacility { + this := SpotPricesPerNewFacility{} + return &this +} + +// NewSpotPricesPerNewFacilityWithDefaults instantiates a new SpotPricesPerNewFacility object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesPerNewFacilityWithDefaults() *SpotPricesPerNewFacility { + this := SpotPricesPerNewFacility{} + return &this +} + +// GetBaremetal1e returns the Baremetal1e field value if set, zero value otherwise. +func (o *SpotPricesPerNewFacility) GetBaremetal1e() SpotPricesPerBaremetal { + if o == nil || IsNil(o.Baremetal1e) { + var ret SpotPricesPerBaremetal + return ret + } + return *o.Baremetal1e +} + +// GetBaremetal1eOk returns a tuple with the Baremetal1e field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesPerNewFacility) GetBaremetal1eOk() (*SpotPricesPerBaremetal, bool) { + if o == nil || IsNil(o.Baremetal1e) { + return nil, false + } + return o.Baremetal1e, true +} + +// HasBaremetal1e returns a boolean if a field has been set. +func (o *SpotPricesPerNewFacility) HasBaremetal1e() bool { + if o != nil && !IsNil(o.Baremetal1e) { + return true + } + + return false +} + +// SetBaremetal1e gets a reference to the given SpotPricesPerBaremetal and assigns it to the Baremetal1e field. +func (o *SpotPricesPerNewFacility) SetBaremetal1e(v SpotPricesPerBaremetal) { + o.Baremetal1e = &v +} + +func (o SpotPricesPerNewFacility) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesPerNewFacility) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Baremetal1e) { + toSerialize["baremetal_1e"] = o.Baremetal1e + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesPerNewFacility) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesPerNewFacility := _SpotPricesPerNewFacility{} + + err = json.Unmarshal(bytes, &varSpotPricesPerNewFacility) + + if err != nil { + return err + } + + *o = SpotPricesPerNewFacility(varSpotPricesPerNewFacility) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "baremetal_1e") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesPerNewFacility struct { + value *SpotPricesPerNewFacility + isSet bool +} + +func (v NullableSpotPricesPerNewFacility) Get() *SpotPricesPerNewFacility { + return v.value +} + +func (v *NullableSpotPricesPerNewFacility) Set(val *SpotPricesPerNewFacility) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesPerNewFacility) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesPerNewFacility) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesPerNewFacility(val *SpotPricesPerNewFacility) *NullableSpotPricesPerNewFacility { + return &NullableSpotPricesPerNewFacility{value: val, isSet: true} +} + +func (v NullableSpotPricesPerNewFacility) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesPerNewFacility) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_spot_prices_report.go b/services/metalv1/model_spot_prices_report.go new file mode 100644 index 00000000..7ca31860 --- /dev/null +++ b/services/metalv1/model_spot_prices_report.go @@ -0,0 +1,635 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SpotPricesReport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpotPricesReport{} + +// SpotPricesReport struct for SpotPricesReport +type SpotPricesReport struct { + Ams1 *SpotPricesPerFacility `json:"ams1,omitempty"` + Atl1 *SpotPricesPerNewFacility `json:"atl1,omitempty"` + Dfw1 *SpotPricesPerNewFacility `json:"dfw1,omitempty"` + Ewr1 *SpotPricesPerFacility `json:"ewr1,omitempty"` + Fra1 *SpotPricesPerNewFacility `json:"fra1,omitempty"` + Iad1 *SpotPricesPerNewFacility `json:"iad1,omitempty"` + Lax1 *SpotPricesPerNewFacility `json:"lax1,omitempty"` + Nrt1 *SpotPricesPerFacility `json:"nrt1,omitempty"` + Ord1 *SpotPricesPerNewFacility `json:"ord1,omitempty"` + Sea1 *SpotPricesPerNewFacility `json:"sea1,omitempty"` + Sin1 *SpotPricesPerNewFacility `json:"sin1,omitempty"` + Sjc1 *SpotPricesPerFacility `json:"sjc1,omitempty"` + Syd1 *SpotPricesPerNewFacility `json:"syd1,omitempty"` + Yyz1 *SpotPricesPerNewFacility `json:"yyz1,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpotPricesReport SpotPricesReport + +// NewSpotPricesReport instantiates a new SpotPricesReport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpotPricesReport() *SpotPricesReport { + this := SpotPricesReport{} + return &this +} + +// NewSpotPricesReportWithDefaults instantiates a new SpotPricesReport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpotPricesReportWithDefaults() *SpotPricesReport { + this := SpotPricesReport{} + return &this +} + +// GetAms1 returns the Ams1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetAms1() SpotPricesPerFacility { + if o == nil || IsNil(o.Ams1) { + var ret SpotPricesPerFacility + return ret + } + return *o.Ams1 +} + +// GetAms1Ok returns a tuple with the Ams1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetAms1Ok() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Ams1) { + return nil, false + } + return o.Ams1, true +} + +// HasAms1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasAms1() bool { + if o != nil && !IsNil(o.Ams1) { + return true + } + + return false +} + +// SetAms1 gets a reference to the given SpotPricesPerFacility and assigns it to the Ams1 field. +func (o *SpotPricesReport) SetAms1(v SpotPricesPerFacility) { + o.Ams1 = &v +} + +// GetAtl1 returns the Atl1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetAtl1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Atl1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Atl1 +} + +// GetAtl1Ok returns a tuple with the Atl1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetAtl1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Atl1) { + return nil, false + } + return o.Atl1, true +} + +// HasAtl1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasAtl1() bool { + if o != nil && !IsNil(o.Atl1) { + return true + } + + return false +} + +// SetAtl1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Atl1 field. +func (o *SpotPricesReport) SetAtl1(v SpotPricesPerNewFacility) { + o.Atl1 = &v +} + +// GetDfw1 returns the Dfw1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetDfw1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Dfw1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Dfw1 +} + +// GetDfw1Ok returns a tuple with the Dfw1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetDfw1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Dfw1) { + return nil, false + } + return o.Dfw1, true +} + +// HasDfw1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasDfw1() bool { + if o != nil && !IsNil(o.Dfw1) { + return true + } + + return false +} + +// SetDfw1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Dfw1 field. +func (o *SpotPricesReport) SetDfw1(v SpotPricesPerNewFacility) { + o.Dfw1 = &v +} + +// GetEwr1 returns the Ewr1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetEwr1() SpotPricesPerFacility { + if o == nil || IsNil(o.Ewr1) { + var ret SpotPricesPerFacility + return ret + } + return *o.Ewr1 +} + +// GetEwr1Ok returns a tuple with the Ewr1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetEwr1Ok() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Ewr1) { + return nil, false + } + return o.Ewr1, true +} + +// HasEwr1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasEwr1() bool { + if o != nil && !IsNil(o.Ewr1) { + return true + } + + return false +} + +// SetEwr1 gets a reference to the given SpotPricesPerFacility and assigns it to the Ewr1 field. +func (o *SpotPricesReport) SetEwr1(v SpotPricesPerFacility) { + o.Ewr1 = &v +} + +// GetFra1 returns the Fra1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetFra1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Fra1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Fra1 +} + +// GetFra1Ok returns a tuple with the Fra1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetFra1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Fra1) { + return nil, false + } + return o.Fra1, true +} + +// HasFra1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasFra1() bool { + if o != nil && !IsNil(o.Fra1) { + return true + } + + return false +} + +// SetFra1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Fra1 field. +func (o *SpotPricesReport) SetFra1(v SpotPricesPerNewFacility) { + o.Fra1 = &v +} + +// GetIad1 returns the Iad1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetIad1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Iad1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Iad1 +} + +// GetIad1Ok returns a tuple with the Iad1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetIad1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Iad1) { + return nil, false + } + return o.Iad1, true +} + +// HasIad1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasIad1() bool { + if o != nil && !IsNil(o.Iad1) { + return true + } + + return false +} + +// SetIad1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Iad1 field. +func (o *SpotPricesReport) SetIad1(v SpotPricesPerNewFacility) { + o.Iad1 = &v +} + +// GetLax1 returns the Lax1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetLax1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Lax1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Lax1 +} + +// GetLax1Ok returns a tuple with the Lax1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetLax1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Lax1) { + return nil, false + } + return o.Lax1, true +} + +// HasLax1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasLax1() bool { + if o != nil && !IsNil(o.Lax1) { + return true + } + + return false +} + +// SetLax1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Lax1 field. +func (o *SpotPricesReport) SetLax1(v SpotPricesPerNewFacility) { + o.Lax1 = &v +} + +// GetNrt1 returns the Nrt1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetNrt1() SpotPricesPerFacility { + if o == nil || IsNil(o.Nrt1) { + var ret SpotPricesPerFacility + return ret + } + return *o.Nrt1 +} + +// GetNrt1Ok returns a tuple with the Nrt1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetNrt1Ok() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Nrt1) { + return nil, false + } + return o.Nrt1, true +} + +// HasNrt1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasNrt1() bool { + if o != nil && !IsNil(o.Nrt1) { + return true + } + + return false +} + +// SetNrt1 gets a reference to the given SpotPricesPerFacility and assigns it to the Nrt1 field. +func (o *SpotPricesReport) SetNrt1(v SpotPricesPerFacility) { + o.Nrt1 = &v +} + +// GetOrd1 returns the Ord1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetOrd1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Ord1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Ord1 +} + +// GetOrd1Ok returns a tuple with the Ord1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetOrd1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Ord1) { + return nil, false + } + return o.Ord1, true +} + +// HasOrd1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasOrd1() bool { + if o != nil && !IsNil(o.Ord1) { + return true + } + + return false +} + +// SetOrd1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Ord1 field. +func (o *SpotPricesReport) SetOrd1(v SpotPricesPerNewFacility) { + o.Ord1 = &v +} + +// GetSea1 returns the Sea1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetSea1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Sea1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Sea1 +} + +// GetSea1Ok returns a tuple with the Sea1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetSea1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Sea1) { + return nil, false + } + return o.Sea1, true +} + +// HasSea1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasSea1() bool { + if o != nil && !IsNil(o.Sea1) { + return true + } + + return false +} + +// SetSea1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Sea1 field. +func (o *SpotPricesReport) SetSea1(v SpotPricesPerNewFacility) { + o.Sea1 = &v +} + +// GetSin1 returns the Sin1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetSin1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Sin1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Sin1 +} + +// GetSin1Ok returns a tuple with the Sin1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetSin1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Sin1) { + return nil, false + } + return o.Sin1, true +} + +// HasSin1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasSin1() bool { + if o != nil && !IsNil(o.Sin1) { + return true + } + + return false +} + +// SetSin1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Sin1 field. +func (o *SpotPricesReport) SetSin1(v SpotPricesPerNewFacility) { + o.Sin1 = &v +} + +// GetSjc1 returns the Sjc1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetSjc1() SpotPricesPerFacility { + if o == nil || IsNil(o.Sjc1) { + var ret SpotPricesPerFacility + return ret + } + return *o.Sjc1 +} + +// GetSjc1Ok returns a tuple with the Sjc1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetSjc1Ok() (*SpotPricesPerFacility, bool) { + if o == nil || IsNil(o.Sjc1) { + return nil, false + } + return o.Sjc1, true +} + +// HasSjc1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasSjc1() bool { + if o != nil && !IsNil(o.Sjc1) { + return true + } + + return false +} + +// SetSjc1 gets a reference to the given SpotPricesPerFacility and assigns it to the Sjc1 field. +func (o *SpotPricesReport) SetSjc1(v SpotPricesPerFacility) { + o.Sjc1 = &v +} + +// GetSyd1 returns the Syd1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetSyd1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Syd1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Syd1 +} + +// GetSyd1Ok returns a tuple with the Syd1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetSyd1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Syd1) { + return nil, false + } + return o.Syd1, true +} + +// HasSyd1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasSyd1() bool { + if o != nil && !IsNil(o.Syd1) { + return true + } + + return false +} + +// SetSyd1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Syd1 field. +func (o *SpotPricesReport) SetSyd1(v SpotPricesPerNewFacility) { + o.Syd1 = &v +} + +// GetYyz1 returns the Yyz1 field value if set, zero value otherwise. +func (o *SpotPricesReport) GetYyz1() SpotPricesPerNewFacility { + if o == nil || IsNil(o.Yyz1) { + var ret SpotPricesPerNewFacility + return ret + } + return *o.Yyz1 +} + +// GetYyz1Ok returns a tuple with the Yyz1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpotPricesReport) GetYyz1Ok() (*SpotPricesPerNewFacility, bool) { + if o == nil || IsNil(o.Yyz1) { + return nil, false + } + return o.Yyz1, true +} + +// HasYyz1 returns a boolean if a field has been set. +func (o *SpotPricesReport) HasYyz1() bool { + if o != nil && !IsNil(o.Yyz1) { + return true + } + + return false +} + +// SetYyz1 gets a reference to the given SpotPricesPerNewFacility and assigns it to the Yyz1 field. +func (o *SpotPricesReport) SetYyz1(v SpotPricesPerNewFacility) { + o.Yyz1 = &v +} + +func (o SpotPricesReport) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpotPricesReport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ams1) { + toSerialize["ams1"] = o.Ams1 + } + if !IsNil(o.Atl1) { + toSerialize["atl1"] = o.Atl1 + } + if !IsNil(o.Dfw1) { + toSerialize["dfw1"] = o.Dfw1 + } + if !IsNil(o.Ewr1) { + toSerialize["ewr1"] = o.Ewr1 + } + if !IsNil(o.Fra1) { + toSerialize["fra1"] = o.Fra1 + } + if !IsNil(o.Iad1) { + toSerialize["iad1"] = o.Iad1 + } + if !IsNil(o.Lax1) { + toSerialize["lax1"] = o.Lax1 + } + if !IsNil(o.Nrt1) { + toSerialize["nrt1"] = o.Nrt1 + } + if !IsNil(o.Ord1) { + toSerialize["ord1"] = o.Ord1 + } + if !IsNil(o.Sea1) { + toSerialize["sea1"] = o.Sea1 + } + if !IsNil(o.Sin1) { + toSerialize["sin1"] = o.Sin1 + } + if !IsNil(o.Sjc1) { + toSerialize["sjc1"] = o.Sjc1 + } + if !IsNil(o.Syd1) { + toSerialize["syd1"] = o.Syd1 + } + if !IsNil(o.Yyz1) { + toSerialize["yyz1"] = o.Yyz1 + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpotPricesReport) UnmarshalJSON(bytes []byte) (err error) { + varSpotPricesReport := _SpotPricesReport{} + + err = json.Unmarshal(bytes, &varSpotPricesReport) + + if err != nil { + return err + } + + *o = SpotPricesReport(varSpotPricesReport) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ams1") + delete(additionalProperties, "atl1") + delete(additionalProperties, "dfw1") + delete(additionalProperties, "ewr1") + delete(additionalProperties, "fra1") + delete(additionalProperties, "iad1") + delete(additionalProperties, "lax1") + delete(additionalProperties, "nrt1") + delete(additionalProperties, "ord1") + delete(additionalProperties, "sea1") + delete(additionalProperties, "sin1") + delete(additionalProperties, "sjc1") + delete(additionalProperties, "syd1") + delete(additionalProperties, "yyz1") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpotPricesReport struct { + value *SpotPricesReport + isSet bool +} + +func (v NullableSpotPricesReport) Get() *SpotPricesReport { + return v.value +} + +func (v *NullableSpotPricesReport) Set(val *SpotPricesReport) { + v.value = val + v.isSet = true +} + +func (v NullableSpotPricesReport) IsSet() bool { + return v.isSet +} + +func (v *NullableSpotPricesReport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpotPricesReport(val *SpotPricesReport) *NullableSpotPricesReport { + return &NullableSpotPricesReport{value: val, isSet: true} +} + +func (v NullableSpotPricesReport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpotPricesReport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ssh_key.go b/services/metalv1/model_ssh_key.go new file mode 100644 index 00000000..d16c9ae2 --- /dev/null +++ b/services/metalv1/model_ssh_key.go @@ -0,0 +1,451 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the SSHKey type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKey{} + +// SSHKey struct for SSHKey +type SSHKey struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Entity *Href `json:"entity,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Label *string `json:"label,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKey SSHKey + +// NewSSHKey instantiates a new SSHKey object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSHKey() *SSHKey { + this := SSHKey{} + return &this +} + +// NewSSHKeyWithDefaults instantiates a new SSHKey object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHKeyWithDefaults() *SSHKey { + this := SSHKey{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SSHKey) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SSHKey) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SSHKey) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEntity returns the Entity field value if set, zero value otherwise. +func (o *SSHKey) GetEntity() Href { + if o == nil || IsNil(o.Entity) { + var ret Href + return ret + } + return *o.Entity +} + +// GetEntityOk returns a tuple with the Entity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetEntityOk() (*Href, bool) { + if o == nil || IsNil(o.Entity) { + return nil, false + } + return o.Entity, true +} + +// HasEntity returns a boolean if a field has been set. +func (o *SSHKey) HasEntity() bool { + if o != nil && !IsNil(o.Entity) { + return true + } + + return false +} + +// SetEntity gets a reference to the given Href and assigns it to the Entity field. +func (o *SSHKey) SetEntity(v Href) { + o.Entity = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *SSHKey) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *SSHKey) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *SSHKey) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *SSHKey) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *SSHKey) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *SSHKey) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SSHKey) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SSHKey) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SSHKey) SetId(v string) { + o.Id = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *SSHKey) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *SSHKey) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *SSHKey) SetKey(v string) { + o.Key = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *SSHKey) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *SSHKey) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *SSHKey) SetLabel(v string) { + o.Label = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SSHKey) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SSHKey) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SSHKey) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SSHKey) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKey) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SSHKey) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SSHKey) SetTags(v []string) { + o.Tags = v +} + +func (o SSHKey) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKey) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Entity) { + toSerialize["entity"] = o.Entity + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKey) UnmarshalJSON(bytes []byte) (err error) { + varSSHKey := _SSHKey{} + + err = json.Unmarshal(bytes, &varSSHKey) + + if err != nil { + return err + } + + *o = SSHKey(varSSHKey) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "entity") + delete(additionalProperties, "fingerprint") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "key") + delete(additionalProperties, "label") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKey struct { + value *SSHKey + isSet bool +} + +func (v NullableSSHKey) Get() *SSHKey { + return v.value +} + +func (v *NullableSSHKey) Set(val *SSHKey) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKey) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKey) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKey(val *SSHKey) *NullableSSHKey { + return &NullableSSHKey{value: val, isSet: true} +} + +func (v NullableSSHKey) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ssh_key_create_input.go b/services/metalv1/model_ssh_key_create_input.go new file mode 100644 index 00000000..b798f233 --- /dev/null +++ b/services/metalv1/model_ssh_key_create_input.go @@ -0,0 +1,266 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SSHKeyCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKeyCreateInput{} + +// SSHKeyCreateInput struct for SSHKeyCreateInput +type SSHKeyCreateInput struct { + // List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging to entity will be included + InstancesIds []string `json:"instances_ids,omitempty"` + Key *string `json:"key,omitempty"` + Label *string `json:"label,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKeyCreateInput SSHKeyCreateInput + +// NewSSHKeyCreateInput instantiates a new SSHKeyCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSHKeyCreateInput() *SSHKeyCreateInput { + this := SSHKeyCreateInput{} + return &this +} + +// NewSSHKeyCreateInputWithDefaults instantiates a new SSHKeyCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHKeyCreateInputWithDefaults() *SSHKeyCreateInput { + this := SSHKeyCreateInput{} + return &this +} + +// GetInstancesIds returns the InstancesIds field value if set, zero value otherwise. +func (o *SSHKeyCreateInput) GetInstancesIds() []string { + if o == nil || IsNil(o.InstancesIds) { + var ret []string + return ret + } + return o.InstancesIds +} + +// GetInstancesIdsOk returns a tuple with the InstancesIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyCreateInput) GetInstancesIdsOk() ([]string, bool) { + if o == nil || IsNil(o.InstancesIds) { + return nil, false + } + return o.InstancesIds, true +} + +// HasInstancesIds returns a boolean if a field has been set. +func (o *SSHKeyCreateInput) HasInstancesIds() bool { + if o != nil && !IsNil(o.InstancesIds) { + return true + } + + return false +} + +// SetInstancesIds gets a reference to the given []string and assigns it to the InstancesIds field. +func (o *SSHKeyCreateInput) SetInstancesIds(v []string) { + o.InstancesIds = v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *SSHKeyCreateInput) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyCreateInput) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *SSHKeyCreateInput) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *SSHKeyCreateInput) SetKey(v string) { + o.Key = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *SSHKeyCreateInput) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyCreateInput) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *SSHKeyCreateInput) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *SSHKeyCreateInput) SetLabel(v string) { + o.Label = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SSHKeyCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SSHKeyCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SSHKeyCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o SSHKeyCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKeyCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.InstancesIds) { + toSerialize["instances_ids"] = o.InstancesIds + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKeyCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varSSHKeyCreateInput := _SSHKeyCreateInput{} + + err = json.Unmarshal(bytes, &varSSHKeyCreateInput) + + if err != nil { + return err + } + + *o = SSHKeyCreateInput(varSSHKeyCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "instances_ids") + delete(additionalProperties, "key") + delete(additionalProperties, "label") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKeyCreateInput struct { + value *SSHKeyCreateInput + isSet bool +} + +func (v NullableSSHKeyCreateInput) Get() *SSHKeyCreateInput { + return v.value +} + +func (v *NullableSSHKeyCreateInput) Set(val *SSHKeyCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKeyCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKeyCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKeyCreateInput(val *SSHKeyCreateInput) *NullableSSHKeyCreateInput { + return &NullableSSHKeyCreateInput{value: val, isSet: true} +} + +func (v NullableSSHKeyCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKeyCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ssh_key_input.go b/services/metalv1/model_ssh_key_input.go new file mode 100644 index 00000000..6c406740 --- /dev/null +++ b/services/metalv1/model_ssh_key_input.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SSHKeyInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKeyInput{} + +// SSHKeyInput struct for SSHKeyInput +type SSHKeyInput struct { + Key *string `json:"key,omitempty"` + Label *string `json:"label,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKeyInput SSHKeyInput + +// NewSSHKeyInput instantiates a new SSHKeyInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSHKeyInput() *SSHKeyInput { + this := SSHKeyInput{} + return &this +} + +// NewSSHKeyInputWithDefaults instantiates a new SSHKeyInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHKeyInputWithDefaults() *SSHKeyInput { + this := SSHKeyInput{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *SSHKeyInput) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyInput) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *SSHKeyInput) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *SSHKeyInput) SetKey(v string) { + o.Key = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *SSHKeyInput) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyInput) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *SSHKeyInput) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *SSHKeyInput) SetLabel(v string) { + o.Label = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SSHKeyInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SSHKeyInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SSHKeyInput) SetTags(v []string) { + o.Tags = v +} + +func (o SSHKeyInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKeyInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKeyInput) UnmarshalJSON(bytes []byte) (err error) { + varSSHKeyInput := _SSHKeyInput{} + + err = json.Unmarshal(bytes, &varSSHKeyInput) + + if err != nil { + return err + } + + *o = SSHKeyInput(varSSHKeyInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "label") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKeyInput struct { + value *SSHKeyInput + isSet bool +} + +func (v NullableSSHKeyInput) Get() *SSHKeyInput { + return v.value +} + +func (v *NullableSSHKeyInput) Set(val *SSHKeyInput) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKeyInput) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKeyInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKeyInput(val *SSHKeyInput) *NullableSSHKeyInput { + return &NullableSSHKeyInput{value: val, isSet: true} +} + +func (v NullableSSHKeyInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKeyInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_ssh_key_list.go b/services/metalv1/model_ssh_key_list.go new file mode 100644 index 00000000..23d6aaaf --- /dev/null +++ b/services/metalv1/model_ssh_key_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the SSHKeyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSHKeyList{} + +// SSHKeyList struct for SSHKeyList +type SSHKeyList struct { + SshKeys []SSHKey `json:"ssh_keys,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSHKeyList SSHKeyList + +// NewSSHKeyList instantiates a new SSHKeyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSHKeyList() *SSHKeyList { + this := SSHKeyList{} + return &this +} + +// NewSSHKeyListWithDefaults instantiates a new SSHKeyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSHKeyListWithDefaults() *SSHKeyList { + this := SSHKeyList{} + return &this +} + +// GetSshKeys returns the SshKeys field value if set, zero value otherwise. +func (o *SSHKeyList) GetSshKeys() []SSHKey { + if o == nil || IsNil(o.SshKeys) { + var ret []SSHKey + return ret + } + return o.SshKeys +} + +// GetSshKeysOk returns a tuple with the SshKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSHKeyList) GetSshKeysOk() ([]SSHKey, bool) { + if o == nil || IsNil(o.SshKeys) { + return nil, false + } + return o.SshKeys, true +} + +// HasSshKeys returns a boolean if a field has been set. +func (o *SSHKeyList) HasSshKeys() bool { + if o != nil && !IsNil(o.SshKeys) { + return true + } + + return false +} + +// SetSshKeys gets a reference to the given []SSHKey and assigns it to the SshKeys field. +func (o *SSHKeyList) SetSshKeys(v []SSHKey) { + o.SshKeys = v +} + +func (o SSHKeyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSHKeyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SshKeys) { + toSerialize["ssh_keys"] = o.SshKeys + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSHKeyList) UnmarshalJSON(bytes []byte) (err error) { + varSSHKeyList := _SSHKeyList{} + + err = json.Unmarshal(bytes, &varSSHKeyList) + + if err != nil { + return err + } + + *o = SSHKeyList(varSSHKeyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ssh_keys") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSHKeyList struct { + value *SSHKeyList + isSet bool +} + +func (v NullableSSHKeyList) Get() *SSHKeyList { + return v.value +} + +func (v *NullableSSHKeyList) Set(val *SSHKeyList) { + v.value = val + v.isSet = true +} + +func (v NullableSSHKeyList) IsSet() bool { + return v.isSet +} + +func (v *NullableSSHKeyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSHKeyList(val *SSHKeyList) *NullableSSHKeyList { + return &NullableSSHKeyList{value: val, isSet: true} +} + +func (v NullableSSHKeyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSHKeyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_storage.go b/services/metalv1/model_storage.go new file mode 100644 index 00000000..e267c1f4 --- /dev/null +++ b/services/metalv1/model_storage.go @@ -0,0 +1,228 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Storage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Storage{} + +// Storage struct for Storage +type Storage struct { + Disks []Disk `json:"disks,omitempty"` + Raid []Raid `json:"raid,omitempty"` + Filesystems []Filesystem `json:"filesystems,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Storage Storage + +// NewStorage instantiates a new Storage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStorage() *Storage { + this := Storage{} + return &this +} + +// NewStorageWithDefaults instantiates a new Storage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStorageWithDefaults() *Storage { + this := Storage{} + return &this +} + +// GetDisks returns the Disks field value if set, zero value otherwise. +func (o *Storage) GetDisks() []Disk { + if o == nil || IsNil(o.Disks) { + var ret []Disk + return ret + } + return o.Disks +} + +// GetDisksOk returns a tuple with the Disks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetDisksOk() ([]Disk, bool) { + if o == nil || IsNil(o.Disks) { + return nil, false + } + return o.Disks, true +} + +// HasDisks returns a boolean if a field has been set. +func (o *Storage) HasDisks() bool { + if o != nil && !IsNil(o.Disks) { + return true + } + + return false +} + +// SetDisks gets a reference to the given []Disk and assigns it to the Disks field. +func (o *Storage) SetDisks(v []Disk) { + o.Disks = v +} + +// GetRaid returns the Raid field value if set, zero value otherwise. +func (o *Storage) GetRaid() []Raid { + if o == nil || IsNil(o.Raid) { + var ret []Raid + return ret + } + return o.Raid +} + +// GetRaidOk returns a tuple with the Raid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetRaidOk() ([]Raid, bool) { + if o == nil || IsNil(o.Raid) { + return nil, false + } + return o.Raid, true +} + +// HasRaid returns a boolean if a field has been set. +func (o *Storage) HasRaid() bool { + if o != nil && !IsNil(o.Raid) { + return true + } + + return false +} + +// SetRaid gets a reference to the given []Raid and assigns it to the Raid field. +func (o *Storage) SetRaid(v []Raid) { + o.Raid = v +} + +// GetFilesystems returns the Filesystems field value if set, zero value otherwise. +func (o *Storage) GetFilesystems() []Filesystem { + if o == nil || IsNil(o.Filesystems) { + var ret []Filesystem + return ret + } + return o.Filesystems +} + +// GetFilesystemsOk returns a tuple with the Filesystems field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Storage) GetFilesystemsOk() ([]Filesystem, bool) { + if o == nil || IsNil(o.Filesystems) { + return nil, false + } + return o.Filesystems, true +} + +// HasFilesystems returns a boolean if a field has been set. +func (o *Storage) HasFilesystems() bool { + if o != nil && !IsNil(o.Filesystems) { + return true + } + + return false +} + +// SetFilesystems gets a reference to the given []Filesystem and assigns it to the Filesystems field. +func (o *Storage) SetFilesystems(v []Filesystem) { + o.Filesystems = v +} + +func (o Storage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Storage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Disks) { + toSerialize["disks"] = o.Disks + } + if !IsNil(o.Raid) { + toSerialize["raid"] = o.Raid + } + if !IsNil(o.Filesystems) { + toSerialize["filesystems"] = o.Filesystems + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Storage) UnmarshalJSON(bytes []byte) (err error) { + varStorage := _Storage{} + + err = json.Unmarshal(bytes, &varStorage) + + if err != nil { + return err + } + + *o = Storage(varStorage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "disks") + delete(additionalProperties, "raid") + delete(additionalProperties, "filesystems") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStorage struct { + value *Storage + isSet bool +} + +func (v NullableStorage) Get() *Storage { + return v.value +} + +func (v *NullableStorage) Set(val *Storage) { + v.value = val + v.isSet = true +} + +func (v NullableStorage) IsSet() bool { + return v.isSet +} + +func (v *NullableStorage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStorage(val *Storage) *NullableStorage { + return &NullableStorage{value: val, isSet: true} +} + +func (v NullableStorage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStorage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_support_request_input.go b/services/metalv1/model_support_request_input.go new file mode 100644 index 00000000..6a5fd950 --- /dev/null +++ b/services/metalv1/model_support_request_input.go @@ -0,0 +1,307 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the SupportRequestInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SupportRequestInput{} + +// SupportRequestInput struct for SupportRequestInput +type SupportRequestInput struct { + DeviceId *string `json:"device_id,omitempty"` + Message string `json:"message"` + Priority *SupportRequestInputPriority `json:"priority,omitempty"` + ProjectId *string `json:"project_id,omitempty"` + Subject string `json:"subject"` + AdditionalProperties map[string]interface{} +} + +type _SupportRequestInput SupportRequestInput + +// NewSupportRequestInput instantiates a new SupportRequestInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSupportRequestInput(message string, subject string) *SupportRequestInput { + this := SupportRequestInput{} + this.Message = message + this.Subject = subject + return &this +} + +// NewSupportRequestInputWithDefaults instantiates a new SupportRequestInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSupportRequestInputWithDefaults() *SupportRequestInput { + this := SupportRequestInput{} + return &this +} + +// GetDeviceId returns the DeviceId field value if set, zero value otherwise. +func (o *SupportRequestInput) GetDeviceId() string { + if o == nil || IsNil(o.DeviceId) { + var ret string + return ret + } + return *o.DeviceId +} + +// GetDeviceIdOk returns a tuple with the DeviceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SupportRequestInput) GetDeviceIdOk() (*string, bool) { + if o == nil || IsNil(o.DeviceId) { + return nil, false + } + return o.DeviceId, true +} + +// HasDeviceId returns a boolean if a field has been set. +func (o *SupportRequestInput) HasDeviceId() bool { + if o != nil && !IsNil(o.DeviceId) { + return true + } + + return false +} + +// SetDeviceId gets a reference to the given string and assigns it to the DeviceId field. +func (o *SupportRequestInput) SetDeviceId(v string) { + o.DeviceId = &v +} + +// GetMessage returns the Message field value +func (o *SupportRequestInput) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *SupportRequestInput) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *SupportRequestInput) SetMessage(v string) { + o.Message = v +} + +// GetPriority returns the Priority field value if set, zero value otherwise. +func (o *SupportRequestInput) GetPriority() SupportRequestInputPriority { + if o == nil || IsNil(o.Priority) { + var ret SupportRequestInputPriority + return ret + } + return *o.Priority +} + +// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SupportRequestInput) GetPriorityOk() (*SupportRequestInputPriority, bool) { + if o == nil || IsNil(o.Priority) { + return nil, false + } + return o.Priority, true +} + +// HasPriority returns a boolean if a field has been set. +func (o *SupportRequestInput) HasPriority() bool { + if o != nil && !IsNil(o.Priority) { + return true + } + + return false +} + +// SetPriority gets a reference to the given SupportRequestInputPriority and assigns it to the Priority field. +func (o *SupportRequestInput) SetPriority(v SupportRequestInputPriority) { + o.Priority = &v +} + +// GetProjectId returns the ProjectId field value if set, zero value otherwise. +func (o *SupportRequestInput) GetProjectId() string { + if o == nil || IsNil(o.ProjectId) { + var ret string + return ret + } + return *o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SupportRequestInput) GetProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ProjectId) { + return nil, false + } + return o.ProjectId, true +} + +// HasProjectId returns a boolean if a field has been set. +func (o *SupportRequestInput) HasProjectId() bool { + if o != nil && !IsNil(o.ProjectId) { + return true + } + + return false +} + +// SetProjectId gets a reference to the given string and assigns it to the ProjectId field. +func (o *SupportRequestInput) SetProjectId(v string) { + o.ProjectId = &v +} + +// GetSubject returns the Subject field value +func (o *SupportRequestInput) GetSubject() string { + if o == nil { + var ret string + return ret + } + + return o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value +// and a boolean to check if the value has been set. +func (o *SupportRequestInput) GetSubjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Subject, true +} + +// SetSubject sets field value +func (o *SupportRequestInput) SetSubject(v string) { + o.Subject = v +} + +func (o SupportRequestInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SupportRequestInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceId) { + toSerialize["device_id"] = o.DeviceId + } + toSerialize["message"] = o.Message + if !IsNil(o.Priority) { + toSerialize["priority"] = o.Priority + } + if !IsNil(o.ProjectId) { + toSerialize["project_id"] = o.ProjectId + } + toSerialize["subject"] = o.Subject + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SupportRequestInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + "subject", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSupportRequestInput := _SupportRequestInput{} + + err = json.Unmarshal(bytes, &varSupportRequestInput) + + if err != nil { + return err + } + + *o = SupportRequestInput(varSupportRequestInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "device_id") + delete(additionalProperties, "message") + delete(additionalProperties, "priority") + delete(additionalProperties, "project_id") + delete(additionalProperties, "subject") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSupportRequestInput struct { + value *SupportRequestInput + isSet bool +} + +func (v NullableSupportRequestInput) Get() *SupportRequestInput { + return v.value +} + +func (v *NullableSupportRequestInput) Set(val *SupportRequestInput) { + v.value = val + v.isSet = true +} + +func (v NullableSupportRequestInput) IsSet() bool { + return v.isSet +} + +func (v *NullableSupportRequestInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSupportRequestInput(val *SupportRequestInput) *NullableSupportRequestInput { + return &NullableSupportRequestInput{value: val, isSet: true} +} + +func (v NullableSupportRequestInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSupportRequestInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_support_request_input_priority.go b/services/metalv1/model_support_request_input_priority.go new file mode 100644 index 00000000..4ff33dfd --- /dev/null +++ b/services/metalv1/model_support_request_input_priority.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// SupportRequestInputPriority the model 'SupportRequestInputPriority' +type SupportRequestInputPriority string + +// List of SupportRequestInput_priority +const ( + SUPPORTREQUESTINPUTPRIORITY_URGENT SupportRequestInputPriority = "urgent" + SUPPORTREQUESTINPUTPRIORITY_HIGH SupportRequestInputPriority = "high" + SUPPORTREQUESTINPUTPRIORITY_MEDIUM SupportRequestInputPriority = "medium" + SUPPORTREQUESTINPUTPRIORITY_LOW SupportRequestInputPriority = "low" +) + +// All allowed values of SupportRequestInputPriority enum +var AllowedSupportRequestInputPriorityEnumValues = []SupportRequestInputPriority{ + "urgent", + "high", + "medium", + "low", +} + +func (v *SupportRequestInputPriority) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SupportRequestInputPriority(value) + for _, existing := range AllowedSupportRequestInputPriorityEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SupportRequestInputPriority", value) +} + +// NewSupportRequestInputPriorityFromValue returns a pointer to a valid SupportRequestInputPriority +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSupportRequestInputPriorityFromValue(v string) (*SupportRequestInputPriority, error) { + ev := SupportRequestInputPriority(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SupportRequestInputPriority: valid values are %v", v, AllowedSupportRequestInputPriorityEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SupportRequestInputPriority) IsValid() bool { + for _, existing := range AllowedSupportRequestInputPriorityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SupportRequestInput_priority value +func (v SupportRequestInputPriority) Ptr() *SupportRequestInputPriority { + return &v +} + +type NullableSupportRequestInputPriority struct { + value *SupportRequestInputPriority + isSet bool +} + +func (v NullableSupportRequestInputPriority) Get() *SupportRequestInputPriority { + return v.value +} + +func (v *NullableSupportRequestInputPriority) Set(val *SupportRequestInputPriority) { + v.value = val + v.isSet = true +} + +func (v NullableSupportRequestInputPriority) IsSet() bool { + return v.isSet +} + +func (v *NullableSupportRequestInputPriority) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSupportRequestInputPriority(val *SupportRequestInputPriority) *NullableSupportRequestInputPriority { + return &NullableSupportRequestInputPriority{value: val, isSet: true} +} + +func (v NullableSupportRequestInputPriority) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSupportRequestInputPriority) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_transfer_request.go b/services/metalv1/model_transfer_request.go new file mode 100644 index 00000000..ab771dac --- /dev/null +++ b/services/metalv1/model_transfer_request.go @@ -0,0 +1,340 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the TransferRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferRequest{} + +// TransferRequest struct for TransferRequest +type TransferRequest struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + Project *Href `json:"project,omitempty"` + TargetOrganization *Href `json:"target_organization,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransferRequest TransferRequest + +// NewTransferRequest instantiates a new TransferRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRequest() *TransferRequest { + this := TransferRequest{} + return &this +} + +// NewTransferRequestWithDefaults instantiates a new TransferRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRequestWithDefaults() *TransferRequest { + this := TransferRequest{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *TransferRequest) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *TransferRequest) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *TransferRequest) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *TransferRequest) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *TransferRequest) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *TransferRequest) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *TransferRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *TransferRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *TransferRequest) SetId(v string) { + o.Id = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *TransferRequest) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *TransferRequest) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *TransferRequest) SetProject(v Href) { + o.Project = &v +} + +// GetTargetOrganization returns the TargetOrganization field value if set, zero value otherwise. +func (o *TransferRequest) GetTargetOrganization() Href { + if o == nil || IsNil(o.TargetOrganization) { + var ret Href + return ret + } + return *o.TargetOrganization +} + +// GetTargetOrganizationOk returns a tuple with the TargetOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetTargetOrganizationOk() (*Href, bool) { + if o == nil || IsNil(o.TargetOrganization) { + return nil, false + } + return o.TargetOrganization, true +} + +// HasTargetOrganization returns a boolean if a field has been set. +func (o *TransferRequest) HasTargetOrganization() bool { + if o != nil && !IsNil(o.TargetOrganization) { + return true + } + + return false +} + +// SetTargetOrganization gets a reference to the given Href and assigns it to the TargetOrganization field. +func (o *TransferRequest) SetTargetOrganization(v Href) { + o.TargetOrganization = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *TransferRequest) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequest) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *TransferRequest) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *TransferRequest) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o TransferRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.TargetOrganization) { + toSerialize["target_organization"] = o.TargetOrganization + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransferRequest) UnmarshalJSON(bytes []byte) (err error) { + varTransferRequest := _TransferRequest{} + + err = json.Unmarshal(bytes, &varTransferRequest) + + if err != nil { + return err + } + + *o = TransferRequest(varTransferRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "project") + delete(additionalProperties, "target_organization") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransferRequest struct { + value *TransferRequest + isSet bool +} + +func (v NullableTransferRequest) Get() *TransferRequest { + return v.value +} + +func (v *NullableTransferRequest) Set(val *TransferRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRequest(val *TransferRequest) *NullableTransferRequest { + return &NullableTransferRequest{value: val, isSet: true} +} + +func (v NullableTransferRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_transfer_request_input.go b/services/metalv1/model_transfer_request_input.go new file mode 100644 index 00000000..0802ac75 --- /dev/null +++ b/services/metalv1/model_transfer_request_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the TransferRequestInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferRequestInput{} + +// TransferRequestInput struct for TransferRequestInput +type TransferRequestInput struct { + TargetOrganizationId *string `json:"target_organization_id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransferRequestInput TransferRequestInput + +// NewTransferRequestInput instantiates a new TransferRequestInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRequestInput() *TransferRequestInput { + this := TransferRequestInput{} + return &this +} + +// NewTransferRequestInputWithDefaults instantiates a new TransferRequestInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRequestInputWithDefaults() *TransferRequestInput { + this := TransferRequestInput{} + return &this +} + +// GetTargetOrganizationId returns the TargetOrganizationId field value if set, zero value otherwise. +func (o *TransferRequestInput) GetTargetOrganizationId() string { + if o == nil || IsNil(o.TargetOrganizationId) { + var ret string + return ret + } + return *o.TargetOrganizationId +} + +// GetTargetOrganizationIdOk returns a tuple with the TargetOrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequestInput) GetTargetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.TargetOrganizationId) { + return nil, false + } + return o.TargetOrganizationId, true +} + +// HasTargetOrganizationId returns a boolean if a field has been set. +func (o *TransferRequestInput) HasTargetOrganizationId() bool { + if o != nil && !IsNil(o.TargetOrganizationId) { + return true + } + + return false +} + +// SetTargetOrganizationId gets a reference to the given string and assigns it to the TargetOrganizationId field. +func (o *TransferRequestInput) SetTargetOrganizationId(v string) { + o.TargetOrganizationId = &v +} + +func (o TransferRequestInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRequestInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TargetOrganizationId) { + toSerialize["target_organization_id"] = o.TargetOrganizationId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransferRequestInput) UnmarshalJSON(bytes []byte) (err error) { + varTransferRequestInput := _TransferRequestInput{} + + err = json.Unmarshal(bytes, &varTransferRequestInput) + + if err != nil { + return err + } + + *o = TransferRequestInput(varTransferRequestInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "target_organization_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransferRequestInput struct { + value *TransferRequestInput + isSet bool +} + +func (v NullableTransferRequestInput) Get() *TransferRequestInput { + return v.value +} + +func (v *NullableTransferRequestInput) Set(val *TransferRequestInput) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRequestInput) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRequestInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRequestInput(val *TransferRequestInput) *NullableTransferRequestInput { + return &NullableTransferRequestInput{value: val, isSet: true} +} + +func (v NullableTransferRequestInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRequestInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_transfer_request_list.go b/services/metalv1/model_transfer_request_list.go new file mode 100644 index 00000000..de77e8f5 --- /dev/null +++ b/services/metalv1/model_transfer_request_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the TransferRequestList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransferRequestList{} + +// TransferRequestList struct for TransferRequestList +type TransferRequestList struct { + Transfers []TransferRequest `json:"transfers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransferRequestList TransferRequestList + +// NewTransferRequestList instantiates a new TransferRequestList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransferRequestList() *TransferRequestList { + this := TransferRequestList{} + return &this +} + +// NewTransferRequestListWithDefaults instantiates a new TransferRequestList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransferRequestListWithDefaults() *TransferRequestList { + this := TransferRequestList{} + return &this +} + +// GetTransfers returns the Transfers field value if set, zero value otherwise. +func (o *TransferRequestList) GetTransfers() []TransferRequest { + if o == nil || IsNil(o.Transfers) { + var ret []TransferRequest + return ret + } + return o.Transfers +} + +// GetTransfersOk returns a tuple with the Transfers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransferRequestList) GetTransfersOk() ([]TransferRequest, bool) { + if o == nil || IsNil(o.Transfers) { + return nil, false + } + return o.Transfers, true +} + +// HasTransfers returns a boolean if a field has been set. +func (o *TransferRequestList) HasTransfers() bool { + if o != nil && !IsNil(o.Transfers) { + return true + } + + return false +} + +// SetTransfers gets a reference to the given []TransferRequest and assigns it to the Transfers field. +func (o *TransferRequestList) SetTransfers(v []TransferRequest) { + o.Transfers = v +} + +func (o TransferRequestList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransferRequestList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Transfers) { + toSerialize["transfers"] = o.Transfers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransferRequestList) UnmarshalJSON(bytes []byte) (err error) { + varTransferRequestList := _TransferRequestList{} + + err = json.Unmarshal(bytes, &varTransferRequestList) + + if err != nil { + return err + } + + *o = TransferRequestList(varTransferRequestList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "transfers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransferRequestList struct { + value *TransferRequestList + isSet bool +} + +func (v NullableTransferRequestList) Get() *TransferRequestList { + return v.value +} + +func (v *NullableTransferRequestList) Set(val *TransferRequestList) { + v.value = val + v.isSet = true +} + +func (v NullableTransferRequestList) IsSet() bool { + return v.isSet +} + +func (v *NullableTransferRequestList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransferRequestList(val *TransferRequestList) *NullableTransferRequestList { + return &NullableTransferRequestList{value: val, isSet: true} +} + +func (v NullableTransferRequestList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransferRequestList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_update_email_input.go b/services/metalv1/model_update_email_input.go new file mode 100644 index 00000000..c8b35398 --- /dev/null +++ b/services/metalv1/model_update_email_input.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the UpdateEmailInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateEmailInput{} + +// UpdateEmailInput struct for UpdateEmailInput +type UpdateEmailInput struct { + Default *bool `json:"default,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateEmailInput UpdateEmailInput + +// NewUpdateEmailInput instantiates a new UpdateEmailInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateEmailInput() *UpdateEmailInput { + this := UpdateEmailInput{} + return &this +} + +// NewUpdateEmailInputWithDefaults instantiates a new UpdateEmailInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateEmailInputWithDefaults() *UpdateEmailInput { + this := UpdateEmailInput{} + return &this +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *UpdateEmailInput) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateEmailInput) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *UpdateEmailInput) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *UpdateEmailInput) SetDefault(v bool) { + o.Default = &v +} + +func (o UpdateEmailInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateEmailInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateEmailInput) UnmarshalJSON(bytes []byte) (err error) { + varUpdateEmailInput := _UpdateEmailInput{} + + err = json.Unmarshal(bytes, &varUpdateEmailInput) + + if err != nil { + return err + } + + *o = UpdateEmailInput(varUpdateEmailInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "default") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateEmailInput struct { + value *UpdateEmailInput + isSet bool +} + +func (v NullableUpdateEmailInput) Get() *UpdateEmailInput { + return v.value +} + +func (v *NullableUpdateEmailInput) Set(val *UpdateEmailInput) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateEmailInput) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateEmailInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateEmailInput(val *UpdateEmailInput) *NullableUpdateEmailInput { + return &NullableUpdateEmailInput{value: val, isSet: true} +} + +func (v NullableUpdateEmailInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateEmailInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user.go b/services/metalv1/model_user.go new file mode 100644 index 00000000..a7442081 --- /dev/null +++ b/services/metalv1/model_user.go @@ -0,0 +1,932 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User struct for User +type User struct { + AvatarThumbUrl *string `json:"avatar_thumb_url,omitempty"` + AvatarUrl *string `json:"avatar_url,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + DefaultOrganizationId *string `json:"default_organization_id,omitempty"` + DefaultProjectId *string `json:"default_project_id,omitempty"` + Email *string `json:"email,omitempty"` + Emails []Href `json:"emails,omitempty"` + FirstName *string `json:"first_name,omitempty"` + FraudScore *string `json:"fraud_score,omitempty"` + FullName *string `json:"full_name,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + LastLoginAt *time.Time `json:"last_login_at,omitempty"` + LastName *string `json:"last_name,omitempty"` + MaxOrganizations *int32 `json:"max_organizations,omitempty"` + MaxProjects *int32 `json:"max_projects,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + ShortId *string `json:"short_id,omitempty"` + Timezone *string `json:"timezone,omitempty"` + TwoFactorAuth *string `json:"two_factor_auth,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetAvatarThumbUrl returns the AvatarThumbUrl field value if set, zero value otherwise. +func (o *User) GetAvatarThumbUrl() string { + if o == nil || IsNil(o.AvatarThumbUrl) { + var ret string + return ret + } + return *o.AvatarThumbUrl +} + +// GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetAvatarThumbUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarThumbUrl) { + return nil, false + } + return o.AvatarThumbUrl, true +} + +// HasAvatarThumbUrl returns a boolean if a field has been set. +func (o *User) HasAvatarThumbUrl() bool { + if o != nil && !IsNil(o.AvatarThumbUrl) { + return true + } + + return false +} + +// SetAvatarThumbUrl gets a reference to the given string and assigns it to the AvatarThumbUrl field. +func (o *User) SetAvatarThumbUrl(v string) { + o.AvatarThumbUrl = &v +} + +// GetAvatarUrl returns the AvatarUrl field value if set, zero value otherwise. +func (o *User) GetAvatarUrl() string { + if o == nil || IsNil(o.AvatarUrl) { + var ret string + return ret + } + return *o.AvatarUrl +} + +// GetAvatarUrlOk returns a tuple with the AvatarUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetAvatarUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarUrl) { + return nil, false + } + return o.AvatarUrl, true +} + +// HasAvatarUrl returns a boolean if a field has been set. +func (o *User) HasAvatarUrl() bool { + if o != nil && !IsNil(o.AvatarUrl) { + return true + } + + return false +} + +// SetAvatarUrl gets a reference to the given string and assigns it to the AvatarUrl field. +func (o *User) SetAvatarUrl(v string) { + o.AvatarUrl = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *User) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *User) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *User) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *User) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *User) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *User) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDefaultOrganizationId returns the DefaultOrganizationId field value if set, zero value otherwise. +func (o *User) GetDefaultOrganizationId() string { + if o == nil || IsNil(o.DefaultOrganizationId) { + var ret string + return ret + } + return *o.DefaultOrganizationId +} + +// GetDefaultOrganizationIdOk returns a tuple with the DefaultOrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetDefaultOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.DefaultOrganizationId) { + return nil, false + } + return o.DefaultOrganizationId, true +} + +// HasDefaultOrganizationId returns a boolean if a field has been set. +func (o *User) HasDefaultOrganizationId() bool { + if o != nil && !IsNil(o.DefaultOrganizationId) { + return true + } + + return false +} + +// SetDefaultOrganizationId gets a reference to the given string and assigns it to the DefaultOrganizationId field. +func (o *User) SetDefaultOrganizationId(v string) { + o.DefaultOrganizationId = &v +} + +// GetDefaultProjectId returns the DefaultProjectId field value if set, zero value otherwise. +func (o *User) GetDefaultProjectId() string { + if o == nil || IsNil(o.DefaultProjectId) { + var ret string + return ret + } + return *o.DefaultProjectId +} + +// GetDefaultProjectIdOk returns a tuple with the DefaultProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetDefaultProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.DefaultProjectId) { + return nil, false + } + return o.DefaultProjectId, true +} + +// HasDefaultProjectId returns a boolean if a field has been set. +func (o *User) HasDefaultProjectId() bool { + if o != nil && !IsNil(o.DefaultProjectId) { + return true + } + + return false +} + +// SetDefaultProjectId gets a reference to the given string and assigns it to the DefaultProjectId field. +func (o *User) SetDefaultProjectId(v string) { + o.DefaultProjectId = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetEmails returns the Emails field value if set, zero value otherwise. +func (o *User) GetEmails() []Href { + if o == nil || IsNil(o.Emails) { + var ret []Href + return ret + } + return o.Emails +} + +// GetEmailsOk returns a tuple with the Emails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailsOk() ([]Href, bool) { + if o == nil || IsNil(o.Emails) { + return nil, false + } + return o.Emails, true +} + +// HasEmails returns a boolean if a field has been set. +func (o *User) HasEmails() bool { + if o != nil && !IsNil(o.Emails) { + return true + } + + return false +} + +// SetEmails gets a reference to the given []Href and assigns it to the Emails field. +func (o *User) SetEmails(v []Href) { + o.Emails = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetFraudScore returns the FraudScore field value if set, zero value otherwise. +func (o *User) GetFraudScore() string { + if o == nil || IsNil(o.FraudScore) { + var ret string + return ret + } + return *o.FraudScore +} + +// GetFraudScoreOk returns a tuple with the FraudScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFraudScoreOk() (*string, bool) { + if o == nil || IsNil(o.FraudScore) { + return nil, false + } + return o.FraudScore, true +} + +// HasFraudScore returns a boolean if a field has been set. +func (o *User) HasFraudScore() bool { + if o != nil && !IsNil(o.FraudScore) { + return true + } + + return false +} + +// SetFraudScore gets a reference to the given string and assigns it to the FraudScore field. +func (o *User) SetFraudScore(v string) { + o.FraudScore = &v +} + +// GetFullName returns the FullName field value if set, zero value otherwise. +func (o *User) GetFullName() string { + if o == nil || IsNil(o.FullName) { + var ret string + return ret + } + return *o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFullNameOk() (*string, bool) { + if o == nil || IsNil(o.FullName) { + return nil, false + } + return o.FullName, true +} + +// HasFullName returns a boolean if a field has been set. +func (o *User) HasFullName() bool { + if o != nil && !IsNil(o.FullName) { + return true + } + + return false +} + +// SetFullName gets a reference to the given string and assigns it to the FullName field. +func (o *User) SetFullName(v string) { + o.FullName = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *User) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *User) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *User) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *User) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *User) SetId(v string) { + o.Id = &v +} + +// GetLastLoginAt returns the LastLoginAt field value if set, zero value otherwise. +func (o *User) GetLastLoginAt() time.Time { + if o == nil || IsNil(o.LastLoginAt) { + var ret time.Time + return ret + } + return *o.LastLoginAt +} + +// GetLastLoginAtOk returns a tuple with the LastLoginAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastLoginAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastLoginAt) { + return nil, false + } + return o.LastLoginAt, true +} + +// HasLastLoginAt returns a boolean if a field has been set. +func (o *User) HasLastLoginAt() bool { + if o != nil && !IsNil(o.LastLoginAt) { + return true + } + + return false +} + +// SetLastLoginAt gets a reference to the given time.Time and assigns it to the LastLoginAt field. +func (o *User) SetLastLoginAt(v time.Time) { + o.LastLoginAt = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetMaxOrganizations returns the MaxOrganizations field value if set, zero value otherwise. +func (o *User) GetMaxOrganizations() int32 { + if o == nil || IsNil(o.MaxOrganizations) { + var ret int32 + return ret + } + return *o.MaxOrganizations +} + +// GetMaxOrganizationsOk returns a tuple with the MaxOrganizations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetMaxOrganizationsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxOrganizations) { + return nil, false + } + return o.MaxOrganizations, true +} + +// HasMaxOrganizations returns a boolean if a field has been set. +func (o *User) HasMaxOrganizations() bool { + if o != nil && !IsNil(o.MaxOrganizations) { + return true + } + + return false +} + +// SetMaxOrganizations gets a reference to the given int32 and assigns it to the MaxOrganizations field. +func (o *User) SetMaxOrganizations(v int32) { + o.MaxOrganizations = &v +} + +// GetMaxProjects returns the MaxProjects field value if set, zero value otherwise. +func (o *User) GetMaxProjects() int32 { + if o == nil || IsNil(o.MaxProjects) { + var ret int32 + return ret + } + return *o.MaxProjects +} + +// GetMaxProjectsOk returns a tuple with the MaxProjects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetMaxProjectsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxProjects) { + return nil, false + } + return o.MaxProjects, true +} + +// HasMaxProjects returns a boolean if a field has been set. +func (o *User) HasMaxProjects() bool { + if o != nil && !IsNil(o.MaxProjects) { + return true + } + + return false +} + +// SetMaxProjects gets a reference to the given int32 and assigns it to the MaxProjects field. +func (o *User) SetMaxProjects(v int32) { + o.MaxProjects = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *User) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *User) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *User) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetShortId returns the ShortId field value if set, zero value otherwise. +func (o *User) GetShortId() string { + if o == nil || IsNil(o.ShortId) { + var ret string + return ret + } + return *o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetShortIdOk() (*string, bool) { + if o == nil || IsNil(o.ShortId) { + return nil, false + } + return o.ShortId, true +} + +// HasShortId returns a boolean if a field has been set. +func (o *User) HasShortId() bool { + if o != nil && !IsNil(o.ShortId) { + return true + } + + return false +} + +// SetShortId gets a reference to the given string and assigns it to the ShortId field. +func (o *User) SetShortId(v string) { + o.ShortId = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *User) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *User) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *User) SetTimezone(v string) { + o.Timezone = &v +} + +// GetTwoFactorAuth returns the TwoFactorAuth field value if set, zero value otherwise. +func (o *User) GetTwoFactorAuth() string { + if o == nil || IsNil(o.TwoFactorAuth) { + var ret string + return ret + } + return *o.TwoFactorAuth +} + +// GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetTwoFactorAuthOk() (*string, bool) { + if o == nil || IsNil(o.TwoFactorAuth) { + return nil, false + } + return o.TwoFactorAuth, true +} + +// HasTwoFactorAuth returns a boolean if a field has been set. +func (o *User) HasTwoFactorAuth() bool { + if o != nil && !IsNil(o.TwoFactorAuth) { + return true + } + + return false +} + +// SetTwoFactorAuth gets a reference to the given string and assigns it to the TwoFactorAuth field. +func (o *User) SetTwoFactorAuth(v string) { + o.TwoFactorAuth = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *User) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *User) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *User) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvatarThumbUrl) { + toSerialize["avatar_thumb_url"] = o.AvatarThumbUrl + } + if !IsNil(o.AvatarUrl) { + toSerialize["avatar_url"] = o.AvatarUrl + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.DefaultOrganizationId) { + toSerialize["default_organization_id"] = o.DefaultOrganizationId + } + if !IsNil(o.DefaultProjectId) { + toSerialize["default_project_id"] = o.DefaultProjectId + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Emails) { + toSerialize["emails"] = o.Emails + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.FraudScore) { + toSerialize["fraud_score"] = o.FraudScore + } + if !IsNil(o.FullName) { + toSerialize["full_name"] = o.FullName + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.LastLoginAt) { + toSerialize["last_login_at"] = o.LastLoginAt + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.MaxOrganizations) { + toSerialize["max_organizations"] = o.MaxOrganizations + } + if !IsNil(o.MaxProjects) { + toSerialize["max_projects"] = o.MaxProjects + } + if !IsNil(o.PhoneNumber) { + toSerialize["phone_number"] = o.PhoneNumber + } + if !IsNil(o.ShortId) { + toSerialize["short_id"] = o.ShortId + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + if !IsNil(o.TwoFactorAuth) { + toSerialize["two_factor_auth"] = o.TwoFactorAuth + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *User) UnmarshalJSON(bytes []byte) (err error) { + varUser := _User{} + + err = json.Unmarshal(bytes, &varUser) + + if err != nil { + return err + } + + *o = User(varUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar_thumb_url") + delete(additionalProperties, "avatar_url") + delete(additionalProperties, "created_at") + delete(additionalProperties, "customdata") + delete(additionalProperties, "default_organization_id") + delete(additionalProperties, "default_project_id") + delete(additionalProperties, "email") + delete(additionalProperties, "emails") + delete(additionalProperties, "first_name") + delete(additionalProperties, "fraud_score") + delete(additionalProperties, "full_name") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "last_login_at") + delete(additionalProperties, "last_name") + delete(additionalProperties, "max_organizations") + delete(additionalProperties, "max_projects") + delete(additionalProperties, "phone_number") + delete(additionalProperties, "short_id") + delete(additionalProperties, "timezone") + delete(additionalProperties, "two_factor_auth") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user_create_input.go b/services/metalv1/model_user_create_input.go new file mode 100644 index 00000000..a724dadb --- /dev/null +++ b/services/metalv1/model_user_create_input.go @@ -0,0 +1,745 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "os" + "time" +) + +// checks if the UserCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCreateInput{} + +// UserCreateInput struct for UserCreateInput +type UserCreateInput struct { + Avatar **os.File `json:"avatar,omitempty"` + CompanyName *string `json:"company_name,omitempty"` + CompanyUrl *string `json:"company_url,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Emails []EmailInput `json:"emails"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Level *string `json:"level,omitempty"` + Password *string `json:"password,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + SocialAccounts map[string]interface{} `json:"social_accounts,omitempty"` + Timezone *string `json:"timezone,omitempty"` + Title *string `json:"title,omitempty"` + TwoFactorAuth *string `json:"two_factor_auth,omitempty"` + VerifiedAt *time.Time `json:"verified_at,omitempty"` + InvitationId *string `json:"invitation_id,omitempty"` + Nonce *string `json:"nonce,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserCreateInput UserCreateInput + +// NewUserCreateInput instantiates a new UserCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserCreateInput(emails []EmailInput, firstName string, lastName string) *UserCreateInput { + this := UserCreateInput{} + this.Emails = emails + this.FirstName = firstName + this.LastName = lastName + return &this +} + +// NewUserCreateInputWithDefaults instantiates a new UserCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserCreateInputWithDefaults() *UserCreateInput { + this := UserCreateInput{} + return &this +} + +// GetAvatar returns the Avatar field value if set, zero value otherwise. +func (o *UserCreateInput) GetAvatar() *os.File { + if o == nil || IsNil(o.Avatar) { + var ret *os.File + return ret + } + return *o.Avatar +} + +// GetAvatarOk returns a tuple with the Avatar field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetAvatarOk() (**os.File, bool) { + if o == nil || IsNil(o.Avatar) { + return nil, false + } + return o.Avatar, true +} + +// HasAvatar returns a boolean if a field has been set. +func (o *UserCreateInput) HasAvatar() bool { + if o != nil && !IsNil(o.Avatar) { + return true + } + + return false +} + +// SetAvatar gets a reference to the given *os.File and assigns it to the Avatar field. +func (o *UserCreateInput) SetAvatar(v *os.File) { + o.Avatar = &v +} + +// GetCompanyName returns the CompanyName field value if set, zero value otherwise. +func (o *UserCreateInput) GetCompanyName() string { + if o == nil || IsNil(o.CompanyName) { + var ret string + return ret + } + return *o.CompanyName +} + +// GetCompanyNameOk returns a tuple with the CompanyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetCompanyNameOk() (*string, bool) { + if o == nil || IsNil(o.CompanyName) { + return nil, false + } + return o.CompanyName, true +} + +// HasCompanyName returns a boolean if a field has been set. +func (o *UserCreateInput) HasCompanyName() bool { + if o != nil && !IsNil(o.CompanyName) { + return true + } + + return false +} + +// SetCompanyName gets a reference to the given string and assigns it to the CompanyName field. +func (o *UserCreateInput) SetCompanyName(v string) { + o.CompanyName = &v +} + +// GetCompanyUrl returns the CompanyUrl field value if set, zero value otherwise. +func (o *UserCreateInput) GetCompanyUrl() string { + if o == nil || IsNil(o.CompanyUrl) { + var ret string + return ret + } + return *o.CompanyUrl +} + +// GetCompanyUrlOk returns a tuple with the CompanyUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetCompanyUrlOk() (*string, bool) { + if o == nil || IsNil(o.CompanyUrl) { + return nil, false + } + return o.CompanyUrl, true +} + +// HasCompanyUrl returns a boolean if a field has been set. +func (o *UserCreateInput) HasCompanyUrl() bool { + if o != nil && !IsNil(o.CompanyUrl) { + return true + } + + return false +} + +// SetCompanyUrl gets a reference to the given string and assigns it to the CompanyUrl field. +func (o *UserCreateInput) SetCompanyUrl(v string) { + o.CompanyUrl = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *UserCreateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *UserCreateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *UserCreateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetEmails returns the Emails field value +func (o *UserCreateInput) GetEmails() []EmailInput { + if o == nil { + var ret []EmailInput + return ret + } + + return o.Emails +} + +// GetEmailsOk returns a tuple with the Emails field value +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetEmailsOk() ([]EmailInput, bool) { + if o == nil { + return nil, false + } + return o.Emails, true +} + +// SetEmails sets field value +func (o *UserCreateInput) SetEmails(v []EmailInput) { + o.Emails = v +} + +// GetFirstName returns the FirstName field value +func (o *UserCreateInput) GetFirstName() string { + if o == nil { + var ret string + return ret + } + + return o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetFirstNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FirstName, true +} + +// SetFirstName sets field value +func (o *UserCreateInput) SetFirstName(v string) { + o.FirstName = v +} + +// GetLastName returns the LastName field value +func (o *UserCreateInput) GetLastName() string { + if o == nil { + var ret string + return ret + } + + return o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetLastNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastName, true +} + +// SetLastName sets field value +func (o *UserCreateInput) SetLastName(v string) { + o.LastName = v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *UserCreateInput) GetLevel() string { + if o == nil || IsNil(o.Level) { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetLevelOk() (*string, bool) { + if o == nil || IsNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *UserCreateInput) HasLevel() bool { + if o != nil && !IsNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *UserCreateInput) SetLevel(v string) { + o.Level = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UserCreateInput) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *UserCreateInput) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UserCreateInput) SetPassword(v string) { + o.Password = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *UserCreateInput) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *UserCreateInput) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *UserCreateInput) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetSocialAccounts returns the SocialAccounts field value if set, zero value otherwise. +func (o *UserCreateInput) GetSocialAccounts() map[string]interface{} { + if o == nil || IsNil(o.SocialAccounts) { + var ret map[string]interface{} + return ret + } + return o.SocialAccounts +} + +// GetSocialAccountsOk returns a tuple with the SocialAccounts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetSocialAccountsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.SocialAccounts) { + return map[string]interface{}{}, false + } + return o.SocialAccounts, true +} + +// HasSocialAccounts returns a boolean if a field has been set. +func (o *UserCreateInput) HasSocialAccounts() bool { + if o != nil && !IsNil(o.SocialAccounts) { + return true + } + + return false +} + +// SetSocialAccounts gets a reference to the given map[string]interface{} and assigns it to the SocialAccounts field. +func (o *UserCreateInput) SetSocialAccounts(v map[string]interface{}) { + o.SocialAccounts = v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *UserCreateInput) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *UserCreateInput) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *UserCreateInput) SetTimezone(v string) { + o.Timezone = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *UserCreateInput) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *UserCreateInput) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *UserCreateInput) SetTitle(v string) { + o.Title = &v +} + +// GetTwoFactorAuth returns the TwoFactorAuth field value if set, zero value otherwise. +func (o *UserCreateInput) GetTwoFactorAuth() string { + if o == nil || IsNil(o.TwoFactorAuth) { + var ret string + return ret + } + return *o.TwoFactorAuth +} + +// GetTwoFactorAuthOk returns a tuple with the TwoFactorAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetTwoFactorAuthOk() (*string, bool) { + if o == nil || IsNil(o.TwoFactorAuth) { + return nil, false + } + return o.TwoFactorAuth, true +} + +// HasTwoFactorAuth returns a boolean if a field has been set. +func (o *UserCreateInput) HasTwoFactorAuth() bool { + if o != nil && !IsNil(o.TwoFactorAuth) { + return true + } + + return false +} + +// SetTwoFactorAuth gets a reference to the given string and assigns it to the TwoFactorAuth field. +func (o *UserCreateInput) SetTwoFactorAuth(v string) { + o.TwoFactorAuth = &v +} + +// GetVerifiedAt returns the VerifiedAt field value if set, zero value otherwise. +func (o *UserCreateInput) GetVerifiedAt() time.Time { + if o == nil || IsNil(o.VerifiedAt) { + var ret time.Time + return ret + } + return *o.VerifiedAt +} + +// GetVerifiedAtOk returns a tuple with the VerifiedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetVerifiedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.VerifiedAt) { + return nil, false + } + return o.VerifiedAt, true +} + +// HasVerifiedAt returns a boolean if a field has been set. +func (o *UserCreateInput) HasVerifiedAt() bool { + if o != nil && !IsNil(o.VerifiedAt) { + return true + } + + return false +} + +// SetVerifiedAt gets a reference to the given time.Time and assigns it to the VerifiedAt field. +func (o *UserCreateInput) SetVerifiedAt(v time.Time) { + o.VerifiedAt = &v +} + +// GetInvitationId returns the InvitationId field value if set, zero value otherwise. +func (o *UserCreateInput) GetInvitationId() string { + if o == nil || IsNil(o.InvitationId) { + var ret string + return ret + } + return *o.InvitationId +} + +// GetInvitationIdOk returns a tuple with the InvitationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetInvitationIdOk() (*string, bool) { + if o == nil || IsNil(o.InvitationId) { + return nil, false + } + return o.InvitationId, true +} + +// HasInvitationId returns a boolean if a field has been set. +func (o *UserCreateInput) HasInvitationId() bool { + if o != nil && !IsNil(o.InvitationId) { + return true + } + + return false +} + +// SetInvitationId gets a reference to the given string and assigns it to the InvitationId field. +func (o *UserCreateInput) SetInvitationId(v string) { + o.InvitationId = &v +} + +// GetNonce returns the Nonce field value if set, zero value otherwise. +func (o *UserCreateInput) GetNonce() string { + if o == nil || IsNil(o.Nonce) { + var ret string + return ret + } + return *o.Nonce +} + +// GetNonceOk returns a tuple with the Nonce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCreateInput) GetNonceOk() (*string, bool) { + if o == nil || IsNil(o.Nonce) { + return nil, false + } + return o.Nonce, true +} + +// HasNonce returns a boolean if a field has been set. +func (o *UserCreateInput) HasNonce() bool { + if o != nil && !IsNil(o.Nonce) { + return true + } + + return false +} + +// SetNonce gets a reference to the given string and assigns it to the Nonce field. +func (o *UserCreateInput) SetNonce(v string) { + o.Nonce = &v +} + +func (o UserCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Avatar) { + toSerialize["avatar"] = o.Avatar + } + if !IsNil(o.CompanyName) { + toSerialize["company_name"] = o.CompanyName + } + if !IsNil(o.CompanyUrl) { + toSerialize["company_url"] = o.CompanyUrl + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + toSerialize["emails"] = o.Emails + toSerialize["first_name"] = o.FirstName + toSerialize["last_name"] = o.LastName + if !IsNil(o.Level) { + toSerialize["level"] = o.Level + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.PhoneNumber) { + toSerialize["phone_number"] = o.PhoneNumber + } + if !IsNil(o.SocialAccounts) { + toSerialize["social_accounts"] = o.SocialAccounts + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.TwoFactorAuth) { + toSerialize["two_factor_auth"] = o.TwoFactorAuth + } + if !IsNil(o.VerifiedAt) { + toSerialize["verified_at"] = o.VerifiedAt + } + if !IsNil(o.InvitationId) { + toSerialize["invitation_id"] = o.InvitationId + } + if !IsNil(o.Nonce) { + toSerialize["nonce"] = o.Nonce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "emails", + "first_name", + "last_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserCreateInput := _UserCreateInput{} + + err = json.Unmarshal(bytes, &varUserCreateInput) + + if err != nil { + return err + } + + *o = UserCreateInput(varUserCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar") + delete(additionalProperties, "company_name") + delete(additionalProperties, "company_url") + delete(additionalProperties, "customdata") + delete(additionalProperties, "emails") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "level") + delete(additionalProperties, "password") + delete(additionalProperties, "phone_number") + delete(additionalProperties, "social_accounts") + delete(additionalProperties, "timezone") + delete(additionalProperties, "title") + delete(additionalProperties, "two_factor_auth") + delete(additionalProperties, "verified_at") + delete(additionalProperties, "invitation_id") + delete(additionalProperties, "nonce") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserCreateInput struct { + value *UserCreateInput + isSet bool +} + +func (v NullableUserCreateInput) Get() *UserCreateInput { + return v.value +} + +func (v *NullableUserCreateInput) Set(val *UserCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableUserCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCreateInput(val *UserCreateInput) *NullableUserCreateInput { + return &NullableUserCreateInput{value: val, isSet: true} +} + +func (v NullableUserCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user_limited.go b/services/metalv1/model_user_limited.go new file mode 100644 index 00000000..a16c95b5 --- /dev/null +++ b/services/metalv1/model_user_limited.go @@ -0,0 +1,320 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLimited type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLimited{} + +// UserLimited struct for UserLimited +type UserLimited struct { + // Avatar thumbnail URL of the User + AvatarThumbUrl *string `json:"avatar_thumb_url,omitempty"` + // Avatar URL of the User + AvatarUrl *string `json:"avatar_url,omitempty"` + // Full name of the User + FullName *string `json:"full_name,omitempty"` + // API URL uniquely representing the User + Href *string `json:"href,omitempty"` + // ID of the User + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _UserLimited UserLimited + +// NewUserLimited instantiates a new UserLimited object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLimited(id string) *UserLimited { + this := UserLimited{} + this.Id = id + return &this +} + +// NewUserLimitedWithDefaults instantiates a new UserLimited object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLimitedWithDefaults() *UserLimited { + this := UserLimited{} + return &this +} + +// GetAvatarThumbUrl returns the AvatarThumbUrl field value if set, zero value otherwise. +func (o *UserLimited) GetAvatarThumbUrl() string { + if o == nil || IsNil(o.AvatarThumbUrl) { + var ret string + return ret + } + return *o.AvatarThumbUrl +} + +// GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLimited) GetAvatarThumbUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarThumbUrl) { + return nil, false + } + return o.AvatarThumbUrl, true +} + +// HasAvatarThumbUrl returns a boolean if a field has been set. +func (o *UserLimited) HasAvatarThumbUrl() bool { + if o != nil && !IsNil(o.AvatarThumbUrl) { + return true + } + + return false +} + +// SetAvatarThumbUrl gets a reference to the given string and assigns it to the AvatarThumbUrl field. +func (o *UserLimited) SetAvatarThumbUrl(v string) { + o.AvatarThumbUrl = &v +} + +// GetAvatarUrl returns the AvatarUrl field value if set, zero value otherwise. +func (o *UserLimited) GetAvatarUrl() string { + if o == nil || IsNil(o.AvatarUrl) { + var ret string + return ret + } + return *o.AvatarUrl +} + +// GetAvatarUrlOk returns a tuple with the AvatarUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLimited) GetAvatarUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarUrl) { + return nil, false + } + return o.AvatarUrl, true +} + +// HasAvatarUrl returns a boolean if a field has been set. +func (o *UserLimited) HasAvatarUrl() bool { + if o != nil && !IsNil(o.AvatarUrl) { + return true + } + + return false +} + +// SetAvatarUrl gets a reference to the given string and assigns it to the AvatarUrl field. +func (o *UserLimited) SetAvatarUrl(v string) { + o.AvatarUrl = &v +} + +// GetFullName returns the FullName field value if set, zero value otherwise. +func (o *UserLimited) GetFullName() string { + if o == nil || IsNil(o.FullName) { + var ret string + return ret + } + return *o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLimited) GetFullNameOk() (*string, bool) { + if o == nil || IsNil(o.FullName) { + return nil, false + } + return o.FullName, true +} + +// HasFullName returns a boolean if a field has been set. +func (o *UserLimited) HasFullName() bool { + if o != nil && !IsNil(o.FullName) { + return true + } + + return false +} + +// SetFullName gets a reference to the given string and assigns it to the FullName field. +func (o *UserLimited) SetFullName(v string) { + o.FullName = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *UserLimited) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLimited) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *UserLimited) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *UserLimited) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value +func (o *UserLimited) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UserLimited) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *UserLimited) SetId(v string) { + o.Id = v +} + +func (o UserLimited) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLimited) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvatarThumbUrl) { + toSerialize["avatar_thumb_url"] = o.AvatarThumbUrl + } + if !IsNil(o.AvatarUrl) { + toSerialize["avatar_url"] = o.AvatarUrl + } + if !IsNil(o.FullName) { + toSerialize["full_name"] = o.FullName + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLimited) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLimited := _UserLimited{} + + err = json.Unmarshal(bytes, &varUserLimited) + + if err != nil { + return err + } + + *o = UserLimited(varUserLimited) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar_thumb_url") + delete(additionalProperties, "avatar_url") + delete(additionalProperties, "full_name") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLimited struct { + value *UserLimited + isSet bool +} + +func (v NullableUserLimited) Get() *UserLimited { + return v.value +} + +func (v *NullableUserLimited) Set(val *UserLimited) { + v.value = val + v.isSet = true +} + +func (v NullableUserLimited) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLimited) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLimited(val *UserLimited) *NullableUserLimited { + return &NullableUserLimited{value: val, isSet: true} +} + +func (v NullableUserLimited) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLimited) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user_list.go b/services/metalv1/model_user_list.go new file mode 100644 index 00000000..89f9b558 --- /dev/null +++ b/services/metalv1/model_user_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the UserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserList{} + +// UserList struct for UserList +type UserList struct { + Meta *Meta `json:"meta,omitempty"` + Users []User `json:"users,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserList UserList + +// NewUserList instantiates a new UserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserList() *UserList { + this := UserList{} + return &this +} + +// NewUserListWithDefaults instantiates a new UserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserListWithDefaults() *UserList { + this := UserList{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *UserList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *UserList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *UserList) SetMeta(v Meta) { + o.Meta = &v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *UserList) GetUsers() []User { + if o == nil || IsNil(o.Users) { + var ret []User + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserList) GetUsersOk() ([]User, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *UserList) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []User and assigns it to the Users field. +func (o *UserList) SetUsers(v []User) { + o.Users = v +} + +func (o UserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserList) UnmarshalJSON(bytes []byte) (err error) { + varUserList := _UserList{} + + err = json.Unmarshal(bytes, &varUserList) + + if err != nil { + return err + } + + *o = UserList(varUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "meta") + delete(additionalProperties, "users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserList struct { + value *UserList + isSet bool +} + +func (v NullableUserList) Get() *UserList { + return v.value +} + +func (v *NullableUserList) Set(val *UserList) { + v.value = val + v.isSet = true +} + +func (v NullableUserList) IsSet() bool { + return v.isSet +} + +func (v *NullableUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserList(val *UserList) *NullableUserList { + return &NullableUserList{value: val, isSet: true} +} + +func (v NullableUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user_lite.go b/services/metalv1/model_user_lite.go new file mode 100644 index 00000000..c923f8e9 --- /dev/null +++ b/services/metalv1/model_user_lite.go @@ -0,0 +1,503 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserLite type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLite{} + +// UserLite struct for UserLite +type UserLite struct { + // Avatar thumbnail URL of the User + AvatarThumbUrl *string `json:"avatar_thumb_url,omitempty"` + // When the user was created + CreatedAt *time.Time `json:"created_at,omitempty"` + // Primary email address of the User + Email *string `json:"email,omitempty"` + // First name of the User + FirstName *string `json:"first_name,omitempty"` + // Full name of the User + FullName *string `json:"full_name,omitempty"` + // API URL uniquely representing the User + Href *string `json:"href,omitempty"` + // ID of the User + Id string `json:"id"` + // Last name of the User + LastName *string `json:"last_name,omitempty"` + // Short ID of the User + ShortId string `json:"short_id"` + // When the user details were last updated + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserLite UserLite + +// NewUserLite instantiates a new UserLite object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLite(id string, shortId string) *UserLite { + this := UserLite{} + this.Id = id + this.ShortId = shortId + return &this +} + +// NewUserLiteWithDefaults instantiates a new UserLite object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLiteWithDefaults() *UserLite { + this := UserLite{} + return &this +} + +// GetAvatarThumbUrl returns the AvatarThumbUrl field value if set, zero value otherwise. +func (o *UserLite) GetAvatarThumbUrl() string { + if o == nil || IsNil(o.AvatarThumbUrl) { + var ret string + return ret + } + return *o.AvatarThumbUrl +} + +// GetAvatarThumbUrlOk returns a tuple with the AvatarThumbUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetAvatarThumbUrlOk() (*string, bool) { + if o == nil || IsNil(o.AvatarThumbUrl) { + return nil, false + } + return o.AvatarThumbUrl, true +} + +// HasAvatarThumbUrl returns a boolean if a field has been set. +func (o *UserLite) HasAvatarThumbUrl() bool { + if o != nil && !IsNil(o.AvatarThumbUrl) { + return true + } + + return false +} + +// SetAvatarThumbUrl gets a reference to the given string and assigns it to the AvatarThumbUrl field. +func (o *UserLite) SetAvatarThumbUrl(v string) { + o.AvatarThumbUrl = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UserLite) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UserLite) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UserLite) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserLite) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserLite) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserLite) SetEmail(v string) { + o.Email = &v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *UserLite) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *UserLite) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *UserLite) SetFirstName(v string) { + o.FirstName = &v +} + +// GetFullName returns the FullName field value if set, zero value otherwise. +func (o *UserLite) GetFullName() string { + if o == nil || IsNil(o.FullName) { + var ret string + return ret + } + return *o.FullName +} + +// GetFullNameOk returns a tuple with the FullName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetFullNameOk() (*string, bool) { + if o == nil || IsNil(o.FullName) { + return nil, false + } + return o.FullName, true +} + +// HasFullName returns a boolean if a field has been set. +func (o *UserLite) HasFullName() bool { + if o != nil && !IsNil(o.FullName) { + return true + } + + return false +} + +// SetFullName gets a reference to the given string and assigns it to the FullName field. +func (o *UserLite) SetFullName(v string) { + o.FullName = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *UserLite) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *UserLite) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *UserLite) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value +func (o *UserLite) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UserLite) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *UserLite) SetId(v string) { + o.Id = v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *UserLite) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *UserLite) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *UserLite) SetLastName(v string) { + o.LastName = &v +} + +// GetShortId returns the ShortId field value +func (o *UserLite) GetShortId() string { + if o == nil { + var ret string + return ret + } + + return o.ShortId +} + +// GetShortIdOk returns a tuple with the ShortId field value +// and a boolean to check if the value has been set. +func (o *UserLite) GetShortIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortId, true +} + +// SetShortId sets field value +func (o *UserLite) SetShortId(v string) { + o.ShortId = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *UserLite) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLite) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *UserLite) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *UserLite) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o UserLite) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLite) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvatarThumbUrl) { + toSerialize["avatar_thumb_url"] = o.AvatarThumbUrl + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.FullName) { + toSerialize["full_name"] = o.FullName + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + toSerialize["id"] = o.Id + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + toSerialize["short_id"] = o.ShortId + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLite) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "short_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLite := _UserLite{} + + err = json.Unmarshal(bytes, &varUserLite) + + if err != nil { + return err + } + + *o = UserLite(varUserLite) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "avatar_thumb_url") + delete(additionalProperties, "created_at") + delete(additionalProperties, "email") + delete(additionalProperties, "first_name") + delete(additionalProperties, "full_name") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "last_name") + delete(additionalProperties, "short_id") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLite struct { + value *UserLite + isSet bool +} + +func (v NullableUserLite) Get() *UserLite { + return v.value +} + +func (v *NullableUserLite) Set(val *UserLite) { + v.value = val + v.isSet = true +} + +func (v NullableUserLite) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLite) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLite(val *UserLite) *NullableUserLite { + return &NullableUserLite{value: val, isSet: true} +} + +func (v NullableUserLite) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLite) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_user_update_input.go b/services/metalv1/model_user_update_input.go new file mode 100644 index 00000000..7545c63d --- /dev/null +++ b/services/metalv1/model_user_update_input.go @@ -0,0 +1,339 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the UserUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserUpdateInput{} + +// UserUpdateInput struct for UserUpdateInput +type UserUpdateInput struct { + Customdata map[string]interface{} `json:"customdata,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Password *string `json:"password,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + Timezone *string `json:"timezone,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserUpdateInput UserUpdateInput + +// NewUserUpdateInput instantiates a new UserUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserUpdateInput() *UserUpdateInput { + this := UserUpdateInput{} + return &this +} + +// NewUserUpdateInputWithDefaults instantiates a new UserUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserUpdateInputWithDefaults() *UserUpdateInput { + this := UserUpdateInput{} + return &this +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *UserUpdateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *UserUpdateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *UserUpdateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *UserUpdateInput) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *UserUpdateInput) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *UserUpdateInput) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *UserUpdateInput) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *UserUpdateInput) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *UserUpdateInput) SetLastName(v string) { + o.LastName = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *UserUpdateInput) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *UserUpdateInput) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *UserUpdateInput) SetPassword(v string) { + o.Password = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *UserUpdateInput) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *UserUpdateInput) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *UserUpdateInput) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *UserUpdateInput) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret + } + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserUpdateInput) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false + } + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *UserUpdateInput) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true + } + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *UserUpdateInput) SetTimezone(v string) { + o.Timezone = &v +} + +func (o UserUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.PhoneNumber) { + toSerialize["phone_number"] = o.PhoneNumber + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varUserUpdateInput := _UserUpdateInput{} + + err = json.Unmarshal(bytes, &varUserUpdateInput) + + if err != nil { + return err + } + + *o = UserUpdateInput(varUserUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customdata") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "password") + delete(additionalProperties, "phone_number") + delete(additionalProperties, "timezone") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserUpdateInput struct { + value *UserUpdateInput + isSet bool +} + +func (v NullableUserUpdateInput) Get() *UserUpdateInput { + return v.value +} + +func (v *NullableUserUpdateInput) Set(val *UserUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableUserUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableUserUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserUpdateInput(val *UserUpdateInput) *NullableUserUpdateInput { + return &NullableUserUpdateInput{value: val, isSet: true} +} + +func (v NullableUserUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_userdata.go b/services/metalv1/model_userdata.go new file mode 100644 index 00000000..6dbdb769 --- /dev/null +++ b/services/metalv1/model_userdata.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the Userdata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Userdata{} + +// Userdata struct for Userdata +type Userdata struct { + Userdata *string `json:"userdata,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Userdata Userdata + +// NewUserdata instantiates a new Userdata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserdata() *Userdata { + this := Userdata{} + return &this +} + +// NewUserdataWithDefaults instantiates a new Userdata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserdataWithDefaults() *Userdata { + this := Userdata{} + return &this +} + +// GetUserdata returns the Userdata field value if set, zero value otherwise. +func (o *Userdata) GetUserdata() string { + if o == nil || IsNil(o.Userdata) { + var ret string + return ret + } + return *o.Userdata +} + +// GetUserdataOk returns a tuple with the Userdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Userdata) GetUserdataOk() (*string, bool) { + if o == nil || IsNil(o.Userdata) { + return nil, false + } + return o.Userdata, true +} + +// HasUserdata returns a boolean if a field has been set. +func (o *Userdata) HasUserdata() bool { + if o != nil && !IsNil(o.Userdata) { + return true + } + + return false +} + +// SetUserdata gets a reference to the given string and assigns it to the Userdata field. +func (o *Userdata) SetUserdata(v string) { + o.Userdata = &v +} + +func (o Userdata) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Userdata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Userdata) { + toSerialize["userdata"] = o.Userdata + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Userdata) UnmarshalJSON(bytes []byte) (err error) { + varUserdata := _Userdata{} + + err = json.Unmarshal(bytes, &varUserdata) + + if err != nil { + return err + } + + *o = Userdata(varUserdata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "userdata") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserdata struct { + value *Userdata + isSet bool +} + +func (v NullableUserdata) Get() *Userdata { + return v.value +} + +func (v *NullableUserdata) Set(val *Userdata) { + v.value = val + v.isSet = true +} + +func (v NullableUserdata) IsSet() bool { + return v.isSet +} + +func (v *NullableUserdata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserdata(val *Userdata) *NullableUserdata { + return &NullableUserdata{value: val, isSet: true} +} + +func (v NullableUserdata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserdata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_verify_email.go b/services/metalv1/model_verify_email.go new file mode 100644 index 00000000..9863c594 --- /dev/null +++ b/services/metalv1/model_verify_email.go @@ -0,0 +1,168 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VerifyEmail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VerifyEmail{} + +// VerifyEmail struct for VerifyEmail +type VerifyEmail struct { + // User verification token + UserToken string `json:"user_token"` + AdditionalProperties map[string]interface{} +} + +type _VerifyEmail VerifyEmail + +// NewVerifyEmail instantiates a new VerifyEmail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVerifyEmail(userToken string) *VerifyEmail { + this := VerifyEmail{} + this.UserToken = userToken + return &this +} + +// NewVerifyEmailWithDefaults instantiates a new VerifyEmail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVerifyEmailWithDefaults() *VerifyEmail { + this := VerifyEmail{} + return &this +} + +// GetUserToken returns the UserToken field value +func (o *VerifyEmail) GetUserToken() string { + if o == nil { + var ret string + return ret + } + + return o.UserToken +} + +// GetUserTokenOk returns a tuple with the UserToken field value +// and a boolean to check if the value has been set. +func (o *VerifyEmail) GetUserTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserToken, true +} + +// SetUserToken sets field value +func (o *VerifyEmail) SetUserToken(v string) { + o.UserToken = v +} + +func (o VerifyEmail) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VerifyEmail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user_token"] = o.UserToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VerifyEmail) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVerifyEmail := _VerifyEmail{} + + err = json.Unmarshal(bytes, &varVerifyEmail) + + if err != nil { + return err + } + + *o = VerifyEmail(varVerifyEmail) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "user_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVerifyEmail struct { + value *VerifyEmail + isSet bool +} + +func (v NullableVerifyEmail) Get() *VerifyEmail { + return v.value +} + +func (v *NullableVerifyEmail) Set(val *VerifyEmail) { + v.value = val + v.isSet = true +} + +func (v NullableVerifyEmail) IsSet() bool { + return v.isSet +} + +func (v *NullableVerifyEmail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVerifyEmail(val *VerifyEmail) *NullableVerifyEmail { + return &NullableVerifyEmail{value: val, isSet: true} +} + +func (v NullableVerifyEmail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVerifyEmail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_circuit.go b/services/metalv1/model_virtual_circuit.go new file mode 100644 index 00000000..da0bbdca --- /dev/null +++ b/services/metalv1/model_virtual_circuit.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VirtualCircuit - struct for VirtualCircuit +type VirtualCircuit struct { + VlanVirtualCircuit *VlanVirtualCircuit + VrfVirtualCircuit *VrfVirtualCircuit +} + +// VlanVirtualCircuitAsVirtualCircuit is a convenience function that returns VlanVirtualCircuit wrapped in VirtualCircuit +func VlanVirtualCircuitAsVirtualCircuit(v *VlanVirtualCircuit) VirtualCircuit { + return VirtualCircuit{ + VlanVirtualCircuit: v, + } +} + +// VrfVirtualCircuitAsVirtualCircuit is a convenience function that returns VrfVirtualCircuit wrapped in VirtualCircuit +func VrfVirtualCircuitAsVirtualCircuit(v *VrfVirtualCircuit) VirtualCircuit { + return VirtualCircuit{ + VrfVirtualCircuit: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *VirtualCircuit) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into VlanVirtualCircuit + err = newStrictDecoder(data).Decode(&dst.VlanVirtualCircuit) + if err == nil { + jsonVlanVirtualCircuit, _ := json.Marshal(dst.VlanVirtualCircuit) + if string(jsonVlanVirtualCircuit) == "{}" { // empty struct + dst.VlanVirtualCircuit = nil + } else { + match++ + } + } else { + dst.VlanVirtualCircuit = nil + } + + // try to unmarshal data into VrfVirtualCircuit + err = newStrictDecoder(data).Decode(&dst.VrfVirtualCircuit) + if err == nil { + jsonVrfVirtualCircuit, _ := json.Marshal(dst.VrfVirtualCircuit) + if string(jsonVrfVirtualCircuit) == "{}" { // empty struct + dst.VrfVirtualCircuit = nil + } else { + match++ + } + } else { + dst.VrfVirtualCircuit = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.VlanVirtualCircuit = nil + dst.VrfVirtualCircuit = nil + + return fmt.Errorf("data matches more than one schema in oneOf(VirtualCircuit)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(VirtualCircuit)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src VirtualCircuit) MarshalJSON() ([]byte, error) { + if src.VlanVirtualCircuit != nil { + return json.Marshal(&src.VlanVirtualCircuit) + } + + if src.VrfVirtualCircuit != nil { + return json.Marshal(&src.VrfVirtualCircuit) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *VirtualCircuit) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.VlanVirtualCircuit != nil { + return obj.VlanVirtualCircuit + } + + if obj.VrfVirtualCircuit != nil { + return obj.VrfVirtualCircuit + } + + // all schemas are nil + return nil +} + +type NullableVirtualCircuit struct { + value *VirtualCircuit + isSet bool +} + +func (v NullableVirtualCircuit) Get() *VirtualCircuit { + return v.value +} + +func (v *NullableVirtualCircuit) Set(val *VirtualCircuit) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualCircuit) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualCircuit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualCircuit(val *VirtualCircuit) *NullableVirtualCircuit { + return &NullableVirtualCircuit{value: val, isSet: true} +} + +func (v NullableVirtualCircuit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualCircuit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_circuit_create_input.go b/services/metalv1/model_virtual_circuit_create_input.go new file mode 100644 index 00000000..3accc34a --- /dev/null +++ b/services/metalv1/model_virtual_circuit_create_input.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VirtualCircuitCreateInput - struct for VirtualCircuitCreateInput +type VirtualCircuitCreateInput struct { + VlanVirtualCircuitCreateInput *VlanVirtualCircuitCreateInput + VrfVirtualCircuitCreateInput *VrfVirtualCircuitCreateInput +} + +// VlanVirtualCircuitCreateInputAsVirtualCircuitCreateInput is a convenience function that returns VlanVirtualCircuitCreateInput wrapped in VirtualCircuitCreateInput +func VlanVirtualCircuitCreateInputAsVirtualCircuitCreateInput(v *VlanVirtualCircuitCreateInput) VirtualCircuitCreateInput { + return VirtualCircuitCreateInput{ + VlanVirtualCircuitCreateInput: v, + } +} + +// VrfVirtualCircuitCreateInputAsVirtualCircuitCreateInput is a convenience function that returns VrfVirtualCircuitCreateInput wrapped in VirtualCircuitCreateInput +func VrfVirtualCircuitCreateInputAsVirtualCircuitCreateInput(v *VrfVirtualCircuitCreateInput) VirtualCircuitCreateInput { + return VirtualCircuitCreateInput{ + VrfVirtualCircuitCreateInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *VirtualCircuitCreateInput) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into VlanVirtualCircuitCreateInput + err = newStrictDecoder(data).Decode(&dst.VlanVirtualCircuitCreateInput) + if err == nil { + jsonVlanVirtualCircuitCreateInput, _ := json.Marshal(dst.VlanVirtualCircuitCreateInput) + if string(jsonVlanVirtualCircuitCreateInput) == "{}" { // empty struct + dst.VlanVirtualCircuitCreateInput = nil + } else { + match++ + } + } else { + dst.VlanVirtualCircuitCreateInput = nil + } + + // try to unmarshal data into VrfVirtualCircuitCreateInput + err = newStrictDecoder(data).Decode(&dst.VrfVirtualCircuitCreateInput) + if err == nil { + jsonVrfVirtualCircuitCreateInput, _ := json.Marshal(dst.VrfVirtualCircuitCreateInput) + if string(jsonVrfVirtualCircuitCreateInput) == "{}" { // empty struct + dst.VrfVirtualCircuitCreateInput = nil + } else { + match++ + } + } else { + dst.VrfVirtualCircuitCreateInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.VlanVirtualCircuitCreateInput = nil + dst.VrfVirtualCircuitCreateInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(VirtualCircuitCreateInput)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(VirtualCircuitCreateInput)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src VirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + if src.VlanVirtualCircuitCreateInput != nil { + return json.Marshal(&src.VlanVirtualCircuitCreateInput) + } + + if src.VrfVirtualCircuitCreateInput != nil { + return json.Marshal(&src.VrfVirtualCircuitCreateInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *VirtualCircuitCreateInput) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.VlanVirtualCircuitCreateInput != nil { + return obj.VlanVirtualCircuitCreateInput + } + + if obj.VrfVirtualCircuitCreateInput != nil { + return obj.VrfVirtualCircuitCreateInput + } + + // all schemas are nil + return nil +} + +type NullableVirtualCircuitCreateInput struct { + value *VirtualCircuitCreateInput + isSet bool +} + +func (v NullableVirtualCircuitCreateInput) Get() *VirtualCircuitCreateInput { + return v.value +} + +func (v *NullableVirtualCircuitCreateInput) Set(val *VirtualCircuitCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualCircuitCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualCircuitCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualCircuitCreateInput(val *VirtualCircuitCreateInput) *NullableVirtualCircuitCreateInput { + return &NullableVirtualCircuitCreateInput{value: val, isSet: true} +} + +func (v NullableVirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualCircuitCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_circuit_list.go b/services/metalv1/model_virtual_circuit_list.go new file mode 100644 index 00000000..99cec4ee --- /dev/null +++ b/services/metalv1/model_virtual_circuit_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VirtualCircuitList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualCircuitList{} + +// VirtualCircuitList struct for VirtualCircuitList +type VirtualCircuitList struct { + VirtualCircuits []VirtualCircuit `json:"virtual_circuits,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualCircuitList VirtualCircuitList + +// NewVirtualCircuitList instantiates a new VirtualCircuitList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualCircuitList() *VirtualCircuitList { + this := VirtualCircuitList{} + return &this +} + +// NewVirtualCircuitListWithDefaults instantiates a new VirtualCircuitList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualCircuitListWithDefaults() *VirtualCircuitList { + this := VirtualCircuitList{} + return &this +} + +// GetVirtualCircuits returns the VirtualCircuits field value if set, zero value otherwise. +func (o *VirtualCircuitList) GetVirtualCircuits() []VirtualCircuit { + if o == nil || IsNil(o.VirtualCircuits) { + var ret []VirtualCircuit + return ret + } + return o.VirtualCircuits +} + +// GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualCircuitList) GetVirtualCircuitsOk() ([]VirtualCircuit, bool) { + if o == nil || IsNil(o.VirtualCircuits) { + return nil, false + } + return o.VirtualCircuits, true +} + +// HasVirtualCircuits returns a boolean if a field has been set. +func (o *VirtualCircuitList) HasVirtualCircuits() bool { + if o != nil && !IsNil(o.VirtualCircuits) { + return true + } + + return false +} + +// SetVirtualCircuits gets a reference to the given []VirtualCircuit and assigns it to the VirtualCircuits field. +func (o *VirtualCircuitList) SetVirtualCircuits(v []VirtualCircuit) { + o.VirtualCircuits = v +} + +func (o VirtualCircuitList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualCircuitList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VirtualCircuits) { + toSerialize["virtual_circuits"] = o.VirtualCircuits + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualCircuitList) UnmarshalJSON(bytes []byte) (err error) { + varVirtualCircuitList := _VirtualCircuitList{} + + err = json.Unmarshal(bytes, &varVirtualCircuitList) + + if err != nil { + return err + } + + *o = VirtualCircuitList(varVirtualCircuitList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_circuits") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualCircuitList struct { + value *VirtualCircuitList + isSet bool +} + +func (v NullableVirtualCircuitList) Get() *VirtualCircuitList { + return v.value +} + +func (v *NullableVirtualCircuitList) Set(val *VirtualCircuitList) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualCircuitList) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualCircuitList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualCircuitList(val *VirtualCircuitList) *NullableVirtualCircuitList { + return &NullableVirtualCircuitList{value: val, isSet: true} +} + +func (v NullableVirtualCircuitList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualCircuitList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_circuit_update_input.go b/services/metalv1/model_virtual_circuit_update_input.go new file mode 100644 index 00000000..cee251b5 --- /dev/null +++ b/services/metalv1/model_virtual_circuit_update_input.go @@ -0,0 +1,146 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VirtualCircuitUpdateInput - struct for VirtualCircuitUpdateInput +type VirtualCircuitUpdateInput struct { + VlanVirtualCircuitUpdateInput *VlanVirtualCircuitUpdateInput + VrfVirtualCircuitUpdateInput *VrfVirtualCircuitUpdateInput +} + +// VlanVirtualCircuitUpdateInputAsVirtualCircuitUpdateInput is a convenience function that returns VlanVirtualCircuitUpdateInput wrapped in VirtualCircuitUpdateInput +func VlanVirtualCircuitUpdateInputAsVirtualCircuitUpdateInput(v *VlanVirtualCircuitUpdateInput) VirtualCircuitUpdateInput { + return VirtualCircuitUpdateInput{ + VlanVirtualCircuitUpdateInput: v, + } +} + +// VrfVirtualCircuitUpdateInputAsVirtualCircuitUpdateInput is a convenience function that returns VrfVirtualCircuitUpdateInput wrapped in VirtualCircuitUpdateInput +func VrfVirtualCircuitUpdateInputAsVirtualCircuitUpdateInput(v *VrfVirtualCircuitUpdateInput) VirtualCircuitUpdateInput { + return VirtualCircuitUpdateInput{ + VrfVirtualCircuitUpdateInput: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *VirtualCircuitUpdateInput) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into VlanVirtualCircuitUpdateInput + err = newStrictDecoder(data).Decode(&dst.VlanVirtualCircuitUpdateInput) + if err == nil { + jsonVlanVirtualCircuitUpdateInput, _ := json.Marshal(dst.VlanVirtualCircuitUpdateInput) + if string(jsonVlanVirtualCircuitUpdateInput) == "{}" { // empty struct + dst.VlanVirtualCircuitUpdateInput = nil + } else { + match++ + } + } else { + dst.VlanVirtualCircuitUpdateInput = nil + } + + // try to unmarshal data into VrfVirtualCircuitUpdateInput + err = newStrictDecoder(data).Decode(&dst.VrfVirtualCircuitUpdateInput) + if err == nil { + jsonVrfVirtualCircuitUpdateInput, _ := json.Marshal(dst.VrfVirtualCircuitUpdateInput) + if string(jsonVrfVirtualCircuitUpdateInput) == "{}" { // empty struct + dst.VrfVirtualCircuitUpdateInput = nil + } else { + match++ + } + } else { + dst.VrfVirtualCircuitUpdateInput = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.VlanVirtualCircuitUpdateInput = nil + dst.VrfVirtualCircuitUpdateInput = nil + + return fmt.Errorf("data matches more than one schema in oneOf(VirtualCircuitUpdateInput)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(VirtualCircuitUpdateInput)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src VirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + if src.VlanVirtualCircuitUpdateInput != nil { + return json.Marshal(&src.VlanVirtualCircuitUpdateInput) + } + + if src.VrfVirtualCircuitUpdateInput != nil { + return json.Marshal(&src.VrfVirtualCircuitUpdateInput) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *VirtualCircuitUpdateInput) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.VlanVirtualCircuitUpdateInput != nil { + return obj.VlanVirtualCircuitUpdateInput + } + + if obj.VrfVirtualCircuitUpdateInput != nil { + return obj.VrfVirtualCircuitUpdateInput + } + + // all schemas are nil + return nil +} + +type NullableVirtualCircuitUpdateInput struct { + value *VirtualCircuitUpdateInput + isSet bool +} + +func (v NullableVirtualCircuitUpdateInput) Get() *VirtualCircuitUpdateInput { + return v.value +} + +func (v *NullableVirtualCircuitUpdateInput) Set(val *VirtualCircuitUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualCircuitUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualCircuitUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualCircuitUpdateInput(val *VirtualCircuitUpdateInput) *NullableVirtualCircuitUpdateInput { + return &NullableVirtualCircuitUpdateInput{value: val, isSet: true} +} + +func (v NullableVirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualCircuitUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_network.go b/services/metalv1/model_virtual_network.go new file mode 100644 index 00000000..1a00f80f --- /dev/null +++ b/services/metalv1/model_virtual_network.go @@ -0,0 +1,603 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the VirtualNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualNetwork{} + +// VirtualNetwork struct for VirtualNetwork +type VirtualNetwork struct { + AssignedTo *Href `json:"assigned_to,omitempty"` + // True if the virtual network is attached to a virtual circuit. False if not. + AssignedToVirtualCircuit *bool `json:"assigned_to_virtual_circuit,omitempty"` + Description *string `json:"description,omitempty"` + Facility *Href `json:"facility,omitempty"` + Href *string `json:"href,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + // A list of instances with ports currently associated to this Virtual Network. + Instances []Href `json:"instances,omitempty"` + // A list of metal gateways currently associated to this Virtual Network. + MetalGateways []MetalGatewayLite `json:"metal_gateways,omitempty"` + Metro *Href `json:"metro,omitempty"` + // The Metro code of the metro in which this Virtual Network is defined. + MetroCode *string `json:"metro_code,omitempty"` + Vxlan *int32 `json:"vxlan,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualNetwork VirtualNetwork + +// NewVirtualNetwork instantiates a new VirtualNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualNetwork() *VirtualNetwork { + this := VirtualNetwork{} + return &this +} + +// NewVirtualNetworkWithDefaults instantiates a new VirtualNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualNetworkWithDefaults() *VirtualNetwork { + this := VirtualNetwork{} + return &this +} + +// GetAssignedTo returns the AssignedTo field value if set, zero value otherwise. +func (o *VirtualNetwork) GetAssignedTo() Href { + if o == nil || IsNil(o.AssignedTo) { + var ret Href + return ret + } + return *o.AssignedTo +} + +// GetAssignedToOk returns a tuple with the AssignedTo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetAssignedToOk() (*Href, bool) { + if o == nil || IsNil(o.AssignedTo) { + return nil, false + } + return o.AssignedTo, true +} + +// HasAssignedTo returns a boolean if a field has been set. +func (o *VirtualNetwork) HasAssignedTo() bool { + if o != nil && !IsNil(o.AssignedTo) { + return true + } + + return false +} + +// SetAssignedTo gets a reference to the given Href and assigns it to the AssignedTo field. +func (o *VirtualNetwork) SetAssignedTo(v Href) { + o.AssignedTo = &v +} + +// GetAssignedToVirtualCircuit returns the AssignedToVirtualCircuit field value if set, zero value otherwise. +func (o *VirtualNetwork) GetAssignedToVirtualCircuit() bool { + if o == nil || IsNil(o.AssignedToVirtualCircuit) { + var ret bool + return ret + } + return *o.AssignedToVirtualCircuit +} + +// GetAssignedToVirtualCircuitOk returns a tuple with the AssignedToVirtualCircuit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetAssignedToVirtualCircuitOk() (*bool, bool) { + if o == nil || IsNil(o.AssignedToVirtualCircuit) { + return nil, false + } + return o.AssignedToVirtualCircuit, true +} + +// HasAssignedToVirtualCircuit returns a boolean if a field has been set. +func (o *VirtualNetwork) HasAssignedToVirtualCircuit() bool { + if o != nil && !IsNil(o.AssignedToVirtualCircuit) { + return true + } + + return false +} + +// SetAssignedToVirtualCircuit gets a reference to the given bool and assigns it to the AssignedToVirtualCircuit field. +func (o *VirtualNetwork) SetAssignedToVirtualCircuit(v bool) { + o.AssignedToVirtualCircuit = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualNetwork) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualNetwork) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualNetwork) SetDescription(v string) { + o.Description = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +func (o *VirtualNetwork) GetFacility() Href { + if o == nil || IsNil(o.Facility) { + var ret Href + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetFacilityOk() (*Href, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *VirtualNetwork) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given Href and assigns it to the Facility field. +func (o *VirtualNetwork) SetFacility(v Href) { + o.Facility = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *VirtualNetwork) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *VirtualNetwork) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *VirtualNetwork) SetHref(v string) { + o.Href = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VirtualNetwork) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VirtualNetwork) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VirtualNetwork) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VirtualNetwork) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VirtualNetwork) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VirtualNetwork) SetId(v string) { + o.Id = &v +} + +// GetInstances returns the Instances field value if set, zero value otherwise. +func (o *VirtualNetwork) GetInstances() []Href { + if o == nil || IsNil(o.Instances) { + var ret []Href + return ret + } + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetInstancesOk() ([]Href, bool) { + if o == nil || IsNil(o.Instances) { + return nil, false + } + return o.Instances, true +} + +// HasInstances returns a boolean if a field has been set. +func (o *VirtualNetwork) HasInstances() bool { + if o != nil && !IsNil(o.Instances) { + return true + } + + return false +} + +// SetInstances gets a reference to the given []Href and assigns it to the Instances field. +func (o *VirtualNetwork) SetInstances(v []Href) { + o.Instances = v +} + +// GetMetalGateways returns the MetalGateways field value if set, zero value otherwise. +func (o *VirtualNetwork) GetMetalGateways() []MetalGatewayLite { + if o == nil || IsNil(o.MetalGateways) { + var ret []MetalGatewayLite + return ret + } + return o.MetalGateways +} + +// GetMetalGatewaysOk returns a tuple with the MetalGateways field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetMetalGatewaysOk() ([]MetalGatewayLite, bool) { + if o == nil || IsNil(o.MetalGateways) { + return nil, false + } + return o.MetalGateways, true +} + +// HasMetalGateways returns a boolean if a field has been set. +func (o *VirtualNetwork) HasMetalGateways() bool { + if o != nil && !IsNil(o.MetalGateways) { + return true + } + + return false +} + +// SetMetalGateways gets a reference to the given []MetalGatewayLite and assigns it to the MetalGateways field. +func (o *VirtualNetwork) SetMetalGateways(v []MetalGatewayLite) { + o.MetalGateways = v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *VirtualNetwork) GetMetro() Href { + if o == nil || IsNil(o.Metro) { + var ret Href + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetMetroOk() (*Href, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *VirtualNetwork) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given Href and assigns it to the Metro field. +func (o *VirtualNetwork) SetMetro(v Href) { + o.Metro = &v +} + +// GetMetroCode returns the MetroCode field value if set, zero value otherwise. +func (o *VirtualNetwork) GetMetroCode() string { + if o == nil || IsNil(o.MetroCode) { + var ret string + return ret + } + return *o.MetroCode +} + +// GetMetroCodeOk returns a tuple with the MetroCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetMetroCodeOk() (*string, bool) { + if o == nil || IsNil(o.MetroCode) { + return nil, false + } + return o.MetroCode, true +} + +// HasMetroCode returns a boolean if a field has been set. +func (o *VirtualNetwork) HasMetroCode() bool { + if o != nil && !IsNil(o.MetroCode) { + return true + } + + return false +} + +// SetMetroCode gets a reference to the given string and assigns it to the MetroCode field. +func (o *VirtualNetwork) SetMetroCode(v string) { + o.MetroCode = &v +} + +// GetVxlan returns the Vxlan field value if set, zero value otherwise. +func (o *VirtualNetwork) GetVxlan() int32 { + if o == nil || IsNil(o.Vxlan) { + var ret int32 + return ret + } + return *o.Vxlan +} + +// GetVxlanOk returns a tuple with the Vxlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetVxlanOk() (*int32, bool) { + if o == nil || IsNil(o.Vxlan) { + return nil, false + } + return o.Vxlan, true +} + +// HasVxlan returns a boolean if a field has been set. +func (o *VirtualNetwork) HasVxlan() bool { + if o != nil && !IsNil(o.Vxlan) { + return true + } + + return false +} + +// SetVxlan gets a reference to the given int32 and assigns it to the Vxlan field. +func (o *VirtualNetwork) SetVxlan(v int32) { + o.Vxlan = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualNetwork) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetwork) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualNetwork) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VirtualNetwork) SetTags(v []string) { + o.Tags = v +} + +func (o VirtualNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AssignedTo) { + toSerialize["assigned_to"] = o.AssignedTo + } + if !IsNil(o.AssignedToVirtualCircuit) { + toSerialize["assigned_to_virtual_circuit"] = o.AssignedToVirtualCircuit + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Instances) { + toSerialize["instances"] = o.Instances + } + if !IsNil(o.MetalGateways) { + toSerialize["metal_gateways"] = o.MetalGateways + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.MetroCode) { + toSerialize["metro_code"] = o.MetroCode + } + if !IsNil(o.Vxlan) { + toSerialize["vxlan"] = o.Vxlan + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualNetwork) UnmarshalJSON(bytes []byte) (err error) { + varVirtualNetwork := _VirtualNetwork{} + + err = json.Unmarshal(bytes, &varVirtualNetwork) + + if err != nil { + return err + } + + *o = VirtualNetwork(varVirtualNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "assigned_to") + delete(additionalProperties, "assigned_to_virtual_circuit") + delete(additionalProperties, "description") + delete(additionalProperties, "facility") + delete(additionalProperties, "href") + delete(additionalProperties, "created_at") + delete(additionalProperties, "id") + delete(additionalProperties, "instances") + delete(additionalProperties, "metal_gateways") + delete(additionalProperties, "metro") + delete(additionalProperties, "metro_code") + delete(additionalProperties, "vxlan") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualNetwork struct { + value *VirtualNetwork + isSet bool +} + +func (v NullableVirtualNetwork) Get() *VirtualNetwork { + return v.value +} + +func (v *NullableVirtualNetwork) Set(val *VirtualNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualNetwork(val *VirtualNetwork) *NullableVirtualNetwork { + return &NullableVirtualNetwork{value: val, isSet: true} +} + +func (v NullableVirtualNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_network_create_input.go b/services/metalv1/model_virtual_network_create_input.go new file mode 100644 index 00000000..89423806 --- /dev/null +++ b/services/metalv1/model_virtual_network_create_input.go @@ -0,0 +1,309 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VirtualNetworkCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualNetworkCreateInput{} + +// VirtualNetworkCreateInput struct for VirtualNetworkCreateInput +type VirtualNetworkCreateInput struct { + Description *string `json:"description,omitempty"` + // The UUID (or facility code) for the Facility in which to create this Virtual network. + // Deprecated + Facility *string `json:"facility,omitempty"` + // The UUID (or metro code) for the Metro in which to create this Virtual Network. + Metro *string `json:"metro,omitempty"` + // VLAN ID between 2-3999. Must be unique for the project within the Metro in which this Virtual Network is being created. If no value is specified, the next-available VLAN ID in the range 1000-1999 will be automatically selected. + Vxlan *int32 `json:"vxlan,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualNetworkCreateInput VirtualNetworkCreateInput + +// NewVirtualNetworkCreateInput instantiates a new VirtualNetworkCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualNetworkCreateInput() *VirtualNetworkCreateInput { + this := VirtualNetworkCreateInput{} + return &this +} + +// NewVirtualNetworkCreateInputWithDefaults instantiates a new VirtualNetworkCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualNetworkCreateInputWithDefaults() *VirtualNetworkCreateInput { + this := VirtualNetworkCreateInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VirtualNetworkCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetworkCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VirtualNetworkCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VirtualNetworkCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetFacility returns the Facility field value if set, zero value otherwise. +// Deprecated +func (o *VirtualNetworkCreateInput) GetFacility() string { + if o == nil || IsNil(o.Facility) { + var ret string + return ret + } + return *o.Facility +} + +// GetFacilityOk returns a tuple with the Facility field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated +func (o *VirtualNetworkCreateInput) GetFacilityOk() (*string, bool) { + if o == nil || IsNil(o.Facility) { + return nil, false + } + return o.Facility, true +} + +// HasFacility returns a boolean if a field has been set. +func (o *VirtualNetworkCreateInput) HasFacility() bool { + if o != nil && !IsNil(o.Facility) { + return true + } + + return false +} + +// SetFacility gets a reference to the given string and assigns it to the Facility field. +// Deprecated +func (o *VirtualNetworkCreateInput) SetFacility(v string) { + o.Facility = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *VirtualNetworkCreateInput) GetMetro() string { + if o == nil || IsNil(o.Metro) { + var ret string + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetworkCreateInput) GetMetroOk() (*string, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *VirtualNetworkCreateInput) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given string and assigns it to the Metro field. +func (o *VirtualNetworkCreateInput) SetMetro(v string) { + o.Metro = &v +} + +// GetVxlan returns the Vxlan field value if set, zero value otherwise. +func (o *VirtualNetworkCreateInput) GetVxlan() int32 { + if o == nil || IsNil(o.Vxlan) { + var ret int32 + return ret + } + return *o.Vxlan +} + +// GetVxlanOk returns a tuple with the Vxlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetworkCreateInput) GetVxlanOk() (*int32, bool) { + if o == nil || IsNil(o.Vxlan) { + return nil, false + } + return o.Vxlan, true +} + +// HasVxlan returns a boolean if a field has been set. +func (o *VirtualNetworkCreateInput) HasVxlan() bool { + if o != nil && !IsNil(o.Vxlan) { + return true + } + + return false +} + +// SetVxlan gets a reference to the given int32 and assigns it to the Vxlan field. +func (o *VirtualNetworkCreateInput) SetVxlan(v int32) { + o.Vxlan = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VirtualNetworkCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetworkCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VirtualNetworkCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VirtualNetworkCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VirtualNetworkCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualNetworkCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Facility) { + toSerialize["facility"] = o.Facility + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.Vxlan) { + toSerialize["vxlan"] = o.Vxlan + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualNetworkCreateInput) UnmarshalJSON(bytes []byte) (err error) { + varVirtualNetworkCreateInput := _VirtualNetworkCreateInput{} + + err = json.Unmarshal(bytes, &varVirtualNetworkCreateInput) + + if err != nil { + return err + } + + *o = VirtualNetworkCreateInput(varVirtualNetworkCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "facility") + delete(additionalProperties, "metro") + delete(additionalProperties, "vxlan") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualNetworkCreateInput struct { + value *VirtualNetworkCreateInput + isSet bool +} + +func (v NullableVirtualNetworkCreateInput) Get() *VirtualNetworkCreateInput { + return v.value +} + +func (v *NullableVirtualNetworkCreateInput) Set(val *VirtualNetworkCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualNetworkCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualNetworkCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualNetworkCreateInput(val *VirtualNetworkCreateInput) *NullableVirtualNetworkCreateInput { + return &NullableVirtualNetworkCreateInput{value: val, isSet: true} +} + +func (v NullableVirtualNetworkCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualNetworkCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_virtual_network_list.go b/services/metalv1/model_virtual_network_list.go new file mode 100644 index 00000000..cfbfc85b --- /dev/null +++ b/services/metalv1/model_virtual_network_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VirtualNetworkList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VirtualNetworkList{} + +// VirtualNetworkList struct for VirtualNetworkList +type VirtualNetworkList struct { + VirtualNetworks []VirtualNetwork `json:"virtual_networks,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VirtualNetworkList VirtualNetworkList + +// NewVirtualNetworkList instantiates a new VirtualNetworkList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVirtualNetworkList() *VirtualNetworkList { + this := VirtualNetworkList{} + return &this +} + +// NewVirtualNetworkListWithDefaults instantiates a new VirtualNetworkList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVirtualNetworkListWithDefaults() *VirtualNetworkList { + this := VirtualNetworkList{} + return &this +} + +// GetVirtualNetworks returns the VirtualNetworks field value if set, zero value otherwise. +func (o *VirtualNetworkList) GetVirtualNetworks() []VirtualNetwork { + if o == nil || IsNil(o.VirtualNetworks) { + var ret []VirtualNetwork + return ret + } + return o.VirtualNetworks +} + +// GetVirtualNetworksOk returns a tuple with the VirtualNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VirtualNetworkList) GetVirtualNetworksOk() ([]VirtualNetwork, bool) { + if o == nil || IsNil(o.VirtualNetworks) { + return nil, false + } + return o.VirtualNetworks, true +} + +// HasVirtualNetworks returns a boolean if a field has been set. +func (o *VirtualNetworkList) HasVirtualNetworks() bool { + if o != nil && !IsNil(o.VirtualNetworks) { + return true + } + + return false +} + +// SetVirtualNetworks gets a reference to the given []VirtualNetwork and assigns it to the VirtualNetworks field. +func (o *VirtualNetworkList) SetVirtualNetworks(v []VirtualNetwork) { + o.VirtualNetworks = v +} + +func (o VirtualNetworkList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VirtualNetworkList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.VirtualNetworks) { + toSerialize["virtual_networks"] = o.VirtualNetworks + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VirtualNetworkList) UnmarshalJSON(bytes []byte) (err error) { + varVirtualNetworkList := _VirtualNetworkList{} + + err = json.Unmarshal(bytes, &varVirtualNetworkList) + + if err != nil { + return err + } + + *o = VirtualNetworkList(varVirtualNetworkList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "virtual_networks") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVirtualNetworkList struct { + value *VirtualNetworkList + isSet bool +} + +func (v NullableVirtualNetworkList) Get() *VirtualNetworkList { + return v.value +} + +func (v *NullableVirtualNetworkList) Set(val *VirtualNetworkList) { + v.value = val + v.isSet = true +} + +func (v NullableVirtualNetworkList) IsSet() bool { + return v.isSet +} + +func (v *NullableVirtualNetworkList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVirtualNetworkList(val *VirtualNetworkList) *NullableVirtualNetworkList { + return &NullableVirtualNetworkList{value: val, isSet: true} +} + +func (v NullableVirtualNetworkList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVirtualNetworkList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_fabric_vc_create_input.go b/services/metalv1/model_vlan_fabric_vc_create_input.go new file mode 100644 index 00000000..e021bef6 --- /dev/null +++ b/services/metalv1/model_vlan_fabric_vc_create_input.go @@ -0,0 +1,510 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VlanFabricVcCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VlanFabricVcCreateInput{} + +// VlanFabricVcCreateInput struct for VlanFabricVcCreateInput +type VlanFabricVcCreateInput struct { + // The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + ContactEmail *string `json:"contact_email,omitempty"` + Description *string `json:"description,omitempty"` + // A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. + Metro string `json:"metro"` + Name string `json:"name"` + Project *string `json:"project,omitempty"` + // Either 'primary' or 'redundant'. + Redundancy string `json:"redundancy"` + ServiceTokenType VlanFabricVcCreateInputServiceTokenType `json:"service_token_type"` + // A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + Speed *int32 `json:"speed,omitempty"` + Tags []string `json:"tags,omitempty"` + Type VlanFabricVcCreateInputType `json:"type"` + // A list of one or two metro-based VLANs that will be set on the virtual circuits of primary and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + Vlans []int32 `json:"vlans,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VlanFabricVcCreateInput VlanFabricVcCreateInput + +// NewVlanFabricVcCreateInput instantiates a new VlanFabricVcCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVlanFabricVcCreateInput(metro string, name string, redundancy string, serviceTokenType VlanFabricVcCreateInputServiceTokenType, type_ VlanFabricVcCreateInputType) *VlanFabricVcCreateInput { + this := VlanFabricVcCreateInput{} + this.Metro = metro + this.Name = name + this.Redundancy = redundancy + this.ServiceTokenType = serviceTokenType + this.Type = type_ + return &this +} + +// NewVlanFabricVcCreateInputWithDefaults instantiates a new VlanFabricVcCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVlanFabricVcCreateInputWithDefaults() *VlanFabricVcCreateInput { + this := VlanFabricVcCreateInput{} + return &this +} + +// GetContactEmail returns the ContactEmail field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetContactEmail() string { + if o == nil || IsNil(o.ContactEmail) { + var ret string + return ret + } + return *o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetContactEmailOk() (*string, bool) { + if o == nil || IsNil(o.ContactEmail) { + return nil, false + } + return o.ContactEmail, true +} + +// HasContactEmail returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasContactEmail() bool { + if o != nil && !IsNil(o.ContactEmail) { + return true + } + + return false +} + +// SetContactEmail gets a reference to the given string and assigns it to the ContactEmail field. +func (o *VlanFabricVcCreateInput) SetContactEmail(v string) { + o.ContactEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VlanFabricVcCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMetro returns the Metro field value +func (o *VlanFabricVcCreateInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *VlanFabricVcCreateInput) SetMetro(v string) { + o.Metro = v +} + +// GetName returns the Name field value +func (o *VlanFabricVcCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VlanFabricVcCreateInput) SetName(v string) { + o.Name = v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetProject() string { + if o == nil || IsNil(o.Project) { + var ret string + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetProjectOk() (*string, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given string and assigns it to the Project field. +func (o *VlanFabricVcCreateInput) SetProject(v string) { + o.Project = &v +} + +// GetRedundancy returns the Redundancy field value +func (o *VlanFabricVcCreateInput) GetRedundancy() string { + if o == nil { + var ret string + return ret + } + + return o.Redundancy +} + +// GetRedundancyOk returns a tuple with the Redundancy field value +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetRedundancyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Redundancy, true +} + +// SetRedundancy sets field value +func (o *VlanFabricVcCreateInput) SetRedundancy(v string) { + o.Redundancy = v +} + +// GetServiceTokenType returns the ServiceTokenType field value +func (o *VlanFabricVcCreateInput) GetServiceTokenType() VlanFabricVcCreateInputServiceTokenType { + if o == nil { + var ret VlanFabricVcCreateInputServiceTokenType + return ret + } + + return o.ServiceTokenType +} + +// GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field value +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetServiceTokenTypeOk() (*VlanFabricVcCreateInputServiceTokenType, bool) { + if o == nil { + return nil, false + } + return &o.ServiceTokenType, true +} + +// SetServiceTokenType sets field value +func (o *VlanFabricVcCreateInput) SetServiceTokenType(v VlanFabricVcCreateInputServiceTokenType) { + o.ServiceTokenType = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VlanFabricVcCreateInput) SetSpeed(v int32) { + o.Speed = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VlanFabricVcCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *VlanFabricVcCreateInput) GetType() VlanFabricVcCreateInputType { + if o == nil { + var ret VlanFabricVcCreateInputType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetTypeOk() (*VlanFabricVcCreateInputType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VlanFabricVcCreateInput) SetType(v VlanFabricVcCreateInputType) { + o.Type = v +} + +// GetVlans returns the Vlans field value if set, zero value otherwise. +func (o *VlanFabricVcCreateInput) GetVlans() []int32 { + if o == nil || IsNil(o.Vlans) { + var ret []int32 + return ret + } + return o.Vlans +} + +// GetVlansOk returns a tuple with the Vlans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanFabricVcCreateInput) GetVlansOk() ([]int32, bool) { + if o == nil || IsNil(o.Vlans) { + return nil, false + } + return o.Vlans, true +} + +// HasVlans returns a boolean if a field has been set. +func (o *VlanFabricVcCreateInput) HasVlans() bool { + if o != nil && !IsNil(o.Vlans) { + return true + } + + return false +} + +// SetVlans gets a reference to the given []int32 and assigns it to the Vlans field. +func (o *VlanFabricVcCreateInput) SetVlans(v []int32) { + o.Vlans = v +} + +func (o VlanFabricVcCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VlanFabricVcCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContactEmail) { + toSerialize["contact_email"] = o.ContactEmail + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["metro"] = o.Metro + toSerialize["name"] = o.Name + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + toSerialize["redundancy"] = o.Redundancy + toSerialize["service_token_type"] = o.ServiceTokenType + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + if !IsNil(o.Vlans) { + toSerialize["vlans"] = o.Vlans + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VlanFabricVcCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "name", + "redundancy", + "service_token_type", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVlanFabricVcCreateInput := _VlanFabricVcCreateInput{} + + err = json.Unmarshal(bytes, &varVlanFabricVcCreateInput) + + if err != nil { + return err + } + + *o = VlanFabricVcCreateInput(varVlanFabricVcCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contact_email") + delete(additionalProperties, "description") + delete(additionalProperties, "metro") + delete(additionalProperties, "name") + delete(additionalProperties, "project") + delete(additionalProperties, "redundancy") + delete(additionalProperties, "service_token_type") + delete(additionalProperties, "speed") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "vlans") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVlanFabricVcCreateInput struct { + value *VlanFabricVcCreateInput + isSet bool +} + +func (v NullableVlanFabricVcCreateInput) Get() *VlanFabricVcCreateInput { + return v.value +} + +func (v *NullableVlanFabricVcCreateInput) Set(val *VlanFabricVcCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVlanFabricVcCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanFabricVcCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanFabricVcCreateInput(val *VlanFabricVcCreateInput) *NullableVlanFabricVcCreateInput { + return &NullableVlanFabricVcCreateInput{value: val, isSet: true} +} + +func (v NullableVlanFabricVcCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanFabricVcCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_fabric_vc_create_input_service_token_type.go b/services/metalv1/model_vlan_fabric_vc_create_input_service_token_type.go new file mode 100644 index 00000000..a3d787d9 --- /dev/null +++ b/services/metalv1/model_vlan_fabric_vc_create_input_service_token_type.go @@ -0,0 +1,111 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VlanFabricVcCreateInputServiceTokenType Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. +type VlanFabricVcCreateInputServiceTokenType string + +// List of VlanFabricVcCreateInput_service_token_type +const ( + VLANFABRICVCCREATEINPUTSERVICETOKENTYPE_A_SIDE VlanFabricVcCreateInputServiceTokenType = "a_side" + VLANFABRICVCCREATEINPUTSERVICETOKENTYPE_Z_SIDE VlanFabricVcCreateInputServiceTokenType = "z_side" +) + +// All allowed values of VlanFabricVcCreateInputServiceTokenType enum +var AllowedVlanFabricVcCreateInputServiceTokenTypeEnumValues = []VlanFabricVcCreateInputServiceTokenType{ + "a_side", + "z_side", +} + +func (v *VlanFabricVcCreateInputServiceTokenType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VlanFabricVcCreateInputServiceTokenType(value) + for _, existing := range AllowedVlanFabricVcCreateInputServiceTokenTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VlanFabricVcCreateInputServiceTokenType", value) +} + +// NewVlanFabricVcCreateInputServiceTokenTypeFromValue returns a pointer to a valid VlanFabricVcCreateInputServiceTokenType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVlanFabricVcCreateInputServiceTokenTypeFromValue(v string) (*VlanFabricVcCreateInputServiceTokenType, error) { + ev := VlanFabricVcCreateInputServiceTokenType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VlanFabricVcCreateInputServiceTokenType: valid values are %v", v, AllowedVlanFabricVcCreateInputServiceTokenTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VlanFabricVcCreateInputServiceTokenType) IsValid() bool { + for _, existing := range AllowedVlanFabricVcCreateInputServiceTokenTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VlanFabricVcCreateInput_service_token_type value +func (v VlanFabricVcCreateInputServiceTokenType) Ptr() *VlanFabricVcCreateInputServiceTokenType { + return &v +} + +type NullableVlanFabricVcCreateInputServiceTokenType struct { + value *VlanFabricVcCreateInputServiceTokenType + isSet bool +} + +func (v NullableVlanFabricVcCreateInputServiceTokenType) Get() *VlanFabricVcCreateInputServiceTokenType { + return v.value +} + +func (v *NullableVlanFabricVcCreateInputServiceTokenType) Set(val *VlanFabricVcCreateInputServiceTokenType) { + v.value = val + v.isSet = true +} + +func (v NullableVlanFabricVcCreateInputServiceTokenType) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanFabricVcCreateInputServiceTokenType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanFabricVcCreateInputServiceTokenType(val *VlanFabricVcCreateInputServiceTokenType) *NullableVlanFabricVcCreateInputServiceTokenType { + return &NullableVlanFabricVcCreateInputServiceTokenType{value: val, isSet: true} +} + +func (v NullableVlanFabricVcCreateInputServiceTokenType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanFabricVcCreateInputServiceTokenType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_fabric_vc_create_input_type.go b/services/metalv1/model_vlan_fabric_vc_create_input_type.go new file mode 100644 index 00000000..1f3e7ed8 --- /dev/null +++ b/services/metalv1/model_vlan_fabric_vc_create_input_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VlanFabricVcCreateInputType When requesting for a Fabric VC, the value of this field should be 'shared'. +type VlanFabricVcCreateInputType string + +// List of VlanFabricVcCreateInput_type +const ( + VLANFABRICVCCREATEINPUTTYPE_SHARED VlanFabricVcCreateInputType = "shared" +) + +// All allowed values of VlanFabricVcCreateInputType enum +var AllowedVlanFabricVcCreateInputTypeEnumValues = []VlanFabricVcCreateInputType{ + "shared", +} + +func (v *VlanFabricVcCreateInputType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VlanFabricVcCreateInputType(value) + for _, existing := range AllowedVlanFabricVcCreateInputTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VlanFabricVcCreateInputType", value) +} + +// NewVlanFabricVcCreateInputTypeFromValue returns a pointer to a valid VlanFabricVcCreateInputType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVlanFabricVcCreateInputTypeFromValue(v string) (*VlanFabricVcCreateInputType, error) { + ev := VlanFabricVcCreateInputType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VlanFabricVcCreateInputType: valid values are %v", v, AllowedVlanFabricVcCreateInputTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VlanFabricVcCreateInputType) IsValid() bool { + for _, existing := range AllowedVlanFabricVcCreateInputTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VlanFabricVcCreateInput_type value +func (v VlanFabricVcCreateInputType) Ptr() *VlanFabricVcCreateInputType { + return &v +} + +type NullableVlanFabricVcCreateInputType struct { + value *VlanFabricVcCreateInputType + isSet bool +} + +func (v NullableVlanFabricVcCreateInputType) Get() *VlanFabricVcCreateInputType { + return v.value +} + +func (v *NullableVlanFabricVcCreateInputType) Set(val *VlanFabricVcCreateInputType) { + v.value = val + v.isSet = true +} + +func (v NullableVlanFabricVcCreateInputType) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanFabricVcCreateInputType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanFabricVcCreateInputType(val *VlanFabricVcCreateInputType) *NullableVlanFabricVcCreateInputType { + return &NullableVlanFabricVcCreateInputType{value: val, isSet: true} +} + +func (v NullableVlanFabricVcCreateInputType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanFabricVcCreateInputType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_virtual_circuit.go b/services/metalv1/model_vlan_virtual_circuit.go new file mode 100644 index 00000000..065efdb8 --- /dev/null +++ b/services/metalv1/model_vlan_virtual_circuit.go @@ -0,0 +1,679 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the VlanVirtualCircuit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VlanVirtualCircuit{} + +// VlanVirtualCircuit struct for VlanVirtualCircuit +type VlanVirtualCircuit struct { + // True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. + Bill *bool `json:"bill,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + NniVlan *int32 `json:"nni_vlan,omitempty"` + Port *Href `json:"port,omitempty"` + Project *Href `json:"project,omitempty"` + // For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + Speed *int32 `json:"speed,omitempty"` + Status *VlanVirtualCircuitStatus `json:"status,omitempty"` + Tags []string `json:"tags,omitempty"` + Type *VlanVirtualCircuitType `json:"type,omitempty"` + VirtualNetwork *Href `json:"virtual_network,omitempty"` + Vnid *int32 `json:"vnid,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VlanVirtualCircuit VlanVirtualCircuit + +// NewVlanVirtualCircuit instantiates a new VlanVirtualCircuit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVlanVirtualCircuit() *VlanVirtualCircuit { + this := VlanVirtualCircuit{} + var bill bool = false + this.Bill = &bill + return &this +} + +// NewVlanVirtualCircuitWithDefaults instantiates a new VlanVirtualCircuit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVlanVirtualCircuitWithDefaults() *VlanVirtualCircuit { + this := VlanVirtualCircuit{} + var bill bool = false + this.Bill = &bill + return &this +} + +// GetBill returns the Bill field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetBill() bool { + if o == nil || IsNil(o.Bill) { + var ret bool + return ret + } + return *o.Bill +} + +// GetBillOk returns a tuple with the Bill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetBillOk() (*bool, bool) { + if o == nil || IsNil(o.Bill) { + return nil, false + } + return o.Bill, true +} + +// HasBill returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasBill() bool { + if o != nil && !IsNil(o.Bill) { + return true + } + + return false +} + +// SetBill gets a reference to the given bool and assigns it to the Bill field. +func (o *VlanVirtualCircuit) SetBill(v bool) { + o.Bill = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VlanVirtualCircuit) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VlanVirtualCircuit) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VlanVirtualCircuit) SetName(v string) { + o.Name = &v +} + +// GetNniVlan returns the NniVlan field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetNniVlan() int32 { + if o == nil || IsNil(o.NniVlan) { + var ret int32 + return ret + } + return *o.NniVlan +} + +// GetNniVlanOk returns a tuple with the NniVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetNniVlanOk() (*int32, bool) { + if o == nil || IsNil(o.NniVlan) { + return nil, false + } + return o.NniVlan, true +} + +// HasNniVlan returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasNniVlan() bool { + if o != nil && !IsNil(o.NniVlan) { + return true + } + + return false +} + +// SetNniVlan gets a reference to the given int32 and assigns it to the NniVlan field. +func (o *VlanVirtualCircuit) SetNniVlan(v int32) { + o.NniVlan = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetPort() Href { + if o == nil || IsNil(o.Port) { + var ret Href + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetPortOk() (*Href, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given Href and assigns it to the Port field. +func (o *VlanVirtualCircuit) SetPort(v Href) { + o.Port = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *VlanVirtualCircuit) SetProject(v Href) { + o.Project = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VlanVirtualCircuit) SetSpeed(v int32) { + o.Speed = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetStatus() VlanVirtualCircuitStatus { + if o == nil || IsNil(o.Status) { + var ret VlanVirtualCircuitStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetStatusOk() (*VlanVirtualCircuitStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given VlanVirtualCircuitStatus and assigns it to the Status field. +func (o *VlanVirtualCircuit) SetStatus(v VlanVirtualCircuitStatus) { + o.Status = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VlanVirtualCircuit) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetType() VlanVirtualCircuitType { + if o == nil || IsNil(o.Type) { + var ret VlanVirtualCircuitType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetTypeOk() (*VlanVirtualCircuitType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given VlanVirtualCircuitType and assigns it to the Type field. +func (o *VlanVirtualCircuit) SetType(v VlanVirtualCircuitType) { + o.Type = &v +} + +// GetVirtualNetwork returns the VirtualNetwork field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetVirtualNetwork() Href { + if o == nil || IsNil(o.VirtualNetwork) { + var ret Href + return ret + } + return *o.VirtualNetwork +} + +// GetVirtualNetworkOk returns a tuple with the VirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetVirtualNetworkOk() (*Href, bool) { + if o == nil || IsNil(o.VirtualNetwork) { + return nil, false + } + return o.VirtualNetwork, true +} + +// HasVirtualNetwork returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasVirtualNetwork() bool { + if o != nil && !IsNil(o.VirtualNetwork) { + return true + } + + return false +} + +// SetVirtualNetwork gets a reference to the given Href and assigns it to the VirtualNetwork field. +func (o *VlanVirtualCircuit) SetVirtualNetwork(v Href) { + o.VirtualNetwork = &v +} + +// GetVnid returns the Vnid field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetVnid() int32 { + if o == nil || IsNil(o.Vnid) { + var ret int32 + return ret + } + return *o.Vnid +} + +// GetVnidOk returns a tuple with the Vnid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetVnidOk() (*int32, bool) { + if o == nil || IsNil(o.Vnid) { + return nil, false + } + return o.Vnid, true +} + +// HasVnid returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasVnid() bool { + if o != nil && !IsNil(o.Vnid) { + return true + } + + return false +} + +// SetVnid gets a reference to the given int32 and assigns it to the Vnid field. +func (o *VlanVirtualCircuit) SetVnid(v int32) { + o.Vnid = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VlanVirtualCircuit) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *VlanVirtualCircuit) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuit) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *VlanVirtualCircuit) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *VlanVirtualCircuit) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o VlanVirtualCircuit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VlanVirtualCircuit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bill) { + toSerialize["bill"] = o.Bill + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NniVlan) { + toSerialize["nni_vlan"] = o.NniVlan + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.VirtualNetwork) { + toSerialize["virtual_network"] = o.VirtualNetwork + } + if !IsNil(o.Vnid) { + toSerialize["vnid"] = o.Vnid + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VlanVirtualCircuit) UnmarshalJSON(bytes []byte) (err error) { + varVlanVirtualCircuit := _VlanVirtualCircuit{} + + err = json.Unmarshal(bytes, &varVlanVirtualCircuit) + + if err != nil { + return err + } + + *o = VlanVirtualCircuit(varVlanVirtualCircuit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bill") + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nni_vlan") + delete(additionalProperties, "port") + delete(additionalProperties, "project") + delete(additionalProperties, "speed") + delete(additionalProperties, "status") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "virtual_network") + delete(additionalProperties, "vnid") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVlanVirtualCircuit struct { + value *VlanVirtualCircuit + isSet bool +} + +func (v NullableVlanVirtualCircuit) Get() *VlanVirtualCircuit { + return v.value +} + +func (v *NullableVlanVirtualCircuit) Set(val *VlanVirtualCircuit) { + v.value = val + v.isSet = true +} + +func (v NullableVlanVirtualCircuit) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanVirtualCircuit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanVirtualCircuit(val *VlanVirtualCircuit) *NullableVlanVirtualCircuit { + return &NullableVlanVirtualCircuit{value: val, isSet: true} +} + +func (v NullableVlanVirtualCircuit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanVirtualCircuit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_virtual_circuit_create_input.go b/services/metalv1/model_vlan_virtual_circuit_create_input.go new file mode 100644 index 00000000..bbf211be --- /dev/null +++ b/services/metalv1/model_vlan_virtual_circuit_create_input.go @@ -0,0 +1,391 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VlanVirtualCircuitCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VlanVirtualCircuitCreateInput{} + +// VlanVirtualCircuitCreateInput struct for VlanVirtualCircuitCreateInput +type VlanVirtualCircuitCreateInput struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + NniVlan *int32 `json:"nni_vlan,omitempty"` + ProjectId string `json:"project_id"` + // speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') + Speed *int32 `json:"speed,omitempty"` + Tags []string `json:"tags,omitempty"` + // A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project (sent as integer). + Vnid *string `json:"vnid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VlanVirtualCircuitCreateInput VlanVirtualCircuitCreateInput + +// NewVlanVirtualCircuitCreateInput instantiates a new VlanVirtualCircuitCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVlanVirtualCircuitCreateInput(projectId string) *VlanVirtualCircuitCreateInput { + this := VlanVirtualCircuitCreateInput{} + this.ProjectId = projectId + return &this +} + +// NewVlanVirtualCircuitCreateInputWithDefaults instantiates a new VlanVirtualCircuitCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVlanVirtualCircuitCreateInputWithDefaults() *VlanVirtualCircuitCreateInput { + this := VlanVirtualCircuitCreateInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VlanVirtualCircuitCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VlanVirtualCircuitCreateInput) SetName(v string) { + o.Name = &v +} + +// GetNniVlan returns the NniVlan field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetNniVlan() int32 { + if o == nil || IsNil(o.NniVlan) { + var ret int32 + return ret + } + return *o.NniVlan +} + +// GetNniVlanOk returns a tuple with the NniVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetNniVlanOk() (*int32, bool) { + if o == nil || IsNil(o.NniVlan) { + return nil, false + } + return o.NniVlan, true +} + +// HasNniVlan returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasNniVlan() bool { + if o != nil && !IsNil(o.NniVlan) { + return true + } + + return false +} + +// SetNniVlan gets a reference to the given int32 and assigns it to the NniVlan field. +func (o *VlanVirtualCircuitCreateInput) SetNniVlan(v int32) { + o.NniVlan = &v +} + +// GetProjectId returns the ProjectId field value +func (o *VlanVirtualCircuitCreateInput) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *VlanVirtualCircuitCreateInput) SetProjectId(v string) { + o.ProjectId = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VlanVirtualCircuitCreateInput) SetSpeed(v int32) { + o.Speed = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VlanVirtualCircuitCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetVnid returns the Vnid field value if set, zero value otherwise. +func (o *VlanVirtualCircuitCreateInput) GetVnid() string { + if o == nil || IsNil(o.Vnid) { + var ret string + return ret + } + return *o.Vnid +} + +// GetVnidOk returns a tuple with the Vnid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitCreateInput) GetVnidOk() (*string, bool) { + if o == nil || IsNil(o.Vnid) { + return nil, false + } + return o.Vnid, true +} + +// HasVnid returns a boolean if a field has been set. +func (o *VlanVirtualCircuitCreateInput) HasVnid() bool { + if o != nil && !IsNil(o.Vnid) { + return true + } + + return false +} + +// SetVnid gets a reference to the given string and assigns it to the Vnid field. +func (o *VlanVirtualCircuitCreateInput) SetVnid(v string) { + o.Vnid = &v +} + +func (o VlanVirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VlanVirtualCircuitCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NniVlan) { + toSerialize["nni_vlan"] = o.NniVlan + } + toSerialize["project_id"] = o.ProjectId + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Vnid) { + toSerialize["vnid"] = o.Vnid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VlanVirtualCircuitCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "project_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVlanVirtualCircuitCreateInput := _VlanVirtualCircuitCreateInput{} + + err = json.Unmarshal(bytes, &varVlanVirtualCircuitCreateInput) + + if err != nil { + return err + } + + *o = VlanVirtualCircuitCreateInput(varVlanVirtualCircuitCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "name") + delete(additionalProperties, "nni_vlan") + delete(additionalProperties, "project_id") + delete(additionalProperties, "speed") + delete(additionalProperties, "tags") + delete(additionalProperties, "vnid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVlanVirtualCircuitCreateInput struct { + value *VlanVirtualCircuitCreateInput + isSet bool +} + +func (v NullableVlanVirtualCircuitCreateInput) Get() *VlanVirtualCircuitCreateInput { + return v.value +} + +func (v *NullableVlanVirtualCircuitCreateInput) Set(val *VlanVirtualCircuitCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVlanVirtualCircuitCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanVirtualCircuitCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanVirtualCircuitCreateInput(val *VlanVirtualCircuitCreateInput) *NullableVlanVirtualCircuitCreateInput { + return &NullableVlanVirtualCircuitCreateInput{value: val, isSet: true} +} + +func (v NullableVlanVirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanVirtualCircuitCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_virtual_circuit_status.go b/services/metalv1/model_vlan_virtual_circuit_status.go new file mode 100644 index 00000000..7a74e6a1 --- /dev/null +++ b/services/metalv1/model_vlan_virtual_circuit_status.go @@ -0,0 +1,131 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VlanVirtualCircuitStatus The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. +type VlanVirtualCircuitStatus string + +// List of VlanVirtualCircuit_status +const ( + VLANVIRTUALCIRCUITSTATUS_PENDING VlanVirtualCircuitStatus = "pending" + VLANVIRTUALCIRCUITSTATUS_WAITING_ON_CUSTOMER_VLAN VlanVirtualCircuitStatus = "waiting_on_customer_vlan" + VLANVIRTUALCIRCUITSTATUS_ACTIVATING VlanVirtualCircuitStatus = "activating" + VLANVIRTUALCIRCUITSTATUS_CHANGING_VLAN VlanVirtualCircuitStatus = "changing_vlan" + VLANVIRTUALCIRCUITSTATUS_DEACTIVATING VlanVirtualCircuitStatus = "deactivating" + VLANVIRTUALCIRCUITSTATUS_DELETING VlanVirtualCircuitStatus = "deleting" + VLANVIRTUALCIRCUITSTATUS_ACTIVE VlanVirtualCircuitStatus = "active" + VLANVIRTUALCIRCUITSTATUS_EXPIRED VlanVirtualCircuitStatus = "expired" + VLANVIRTUALCIRCUITSTATUS_ACTIVATION_FAILED VlanVirtualCircuitStatus = "activation_failed" + VLANVIRTUALCIRCUITSTATUS_CHANGING_VLAN_FAILED VlanVirtualCircuitStatus = "changing_vlan_failed" + VLANVIRTUALCIRCUITSTATUS_DEACTIVATION_FAILED VlanVirtualCircuitStatus = "deactivation_failed" + VLANVIRTUALCIRCUITSTATUS_DELETE_FAILED VlanVirtualCircuitStatus = "delete_failed" +) + +// All allowed values of VlanVirtualCircuitStatus enum +var AllowedVlanVirtualCircuitStatusEnumValues = []VlanVirtualCircuitStatus{ + "pending", + "waiting_on_customer_vlan", + "activating", + "changing_vlan", + "deactivating", + "deleting", + "active", + "expired", + "activation_failed", + "changing_vlan_failed", + "deactivation_failed", + "delete_failed", +} + +func (v *VlanVirtualCircuitStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VlanVirtualCircuitStatus(value) + for _, existing := range AllowedVlanVirtualCircuitStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VlanVirtualCircuitStatus", value) +} + +// NewVlanVirtualCircuitStatusFromValue returns a pointer to a valid VlanVirtualCircuitStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVlanVirtualCircuitStatusFromValue(v string) (*VlanVirtualCircuitStatus, error) { + ev := VlanVirtualCircuitStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VlanVirtualCircuitStatus: valid values are %v", v, AllowedVlanVirtualCircuitStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VlanVirtualCircuitStatus) IsValid() bool { + for _, existing := range AllowedVlanVirtualCircuitStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VlanVirtualCircuit_status value +func (v VlanVirtualCircuitStatus) Ptr() *VlanVirtualCircuitStatus { + return &v +} + +type NullableVlanVirtualCircuitStatus struct { + value *VlanVirtualCircuitStatus + isSet bool +} + +func (v NullableVlanVirtualCircuitStatus) Get() *VlanVirtualCircuitStatus { + return v.value +} + +func (v *NullableVlanVirtualCircuitStatus) Set(val *VlanVirtualCircuitStatus) { + v.value = val + v.isSet = true +} + +func (v NullableVlanVirtualCircuitStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanVirtualCircuitStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanVirtualCircuitStatus(val *VlanVirtualCircuitStatus) *NullableVlanVirtualCircuitStatus { + return &NullableVlanVirtualCircuitStatus{value: val, isSet: true} +} + +func (v NullableVlanVirtualCircuitStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanVirtualCircuitStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_virtual_circuit_type.go b/services/metalv1/model_vlan_virtual_circuit_type.go new file mode 100644 index 00000000..f7e9e280 --- /dev/null +++ b/services/metalv1/model_vlan_virtual_circuit_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VlanVirtualCircuitType the model 'VlanVirtualCircuitType' +type VlanVirtualCircuitType string + +// List of VlanVirtualCircuit_type +const ( + VLANVIRTUALCIRCUITTYPE_VLAN VlanVirtualCircuitType = "vlan" +) + +// All allowed values of VlanVirtualCircuitType enum +var AllowedVlanVirtualCircuitTypeEnumValues = []VlanVirtualCircuitType{ + "vlan", +} + +func (v *VlanVirtualCircuitType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VlanVirtualCircuitType(value) + for _, existing := range AllowedVlanVirtualCircuitTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VlanVirtualCircuitType", value) +} + +// NewVlanVirtualCircuitTypeFromValue returns a pointer to a valid VlanVirtualCircuitType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVlanVirtualCircuitTypeFromValue(v string) (*VlanVirtualCircuitType, error) { + ev := VlanVirtualCircuitType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VlanVirtualCircuitType: valid values are %v", v, AllowedVlanVirtualCircuitTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VlanVirtualCircuitType) IsValid() bool { + for _, existing := range AllowedVlanVirtualCircuitTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VlanVirtualCircuit_type value +func (v VlanVirtualCircuitType) Ptr() *VlanVirtualCircuitType { + return &v +} + +type NullableVlanVirtualCircuitType struct { + value *VlanVirtualCircuitType + isSet bool +} + +func (v NullableVlanVirtualCircuitType) Get() *VlanVirtualCircuitType { + return v.value +} + +func (v *NullableVlanVirtualCircuitType) Set(val *VlanVirtualCircuitType) { + v.value = val + v.isSet = true +} + +func (v NullableVlanVirtualCircuitType) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanVirtualCircuitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanVirtualCircuitType(val *VlanVirtualCircuitType) *NullableVlanVirtualCircuitType { + return &NullableVlanVirtualCircuitType{value: val, isSet: true} +} + +func (v NullableVlanVirtualCircuitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanVirtualCircuitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vlan_virtual_circuit_update_input.go b/services/metalv1/model_vlan_virtual_circuit_update_input.go new file mode 100644 index 00000000..2383fc79 --- /dev/null +++ b/services/metalv1/model_vlan_virtual_circuit_update_input.go @@ -0,0 +1,304 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VlanVirtualCircuitUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VlanVirtualCircuitUpdateInput{} + +// VlanVirtualCircuitUpdateInput struct for VlanVirtualCircuitUpdateInput +type VlanVirtualCircuitUpdateInput struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + // Speed can be changed only if it is an interconnection on a Dedicated Port + Speed *string `json:"speed,omitempty"` + Tags []string `json:"tags,omitempty"` + // A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project. + Vnid *string `json:"vnid,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VlanVirtualCircuitUpdateInput VlanVirtualCircuitUpdateInput + +// NewVlanVirtualCircuitUpdateInput instantiates a new VlanVirtualCircuitUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVlanVirtualCircuitUpdateInput() *VlanVirtualCircuitUpdateInput { + this := VlanVirtualCircuitUpdateInput{} + return &this +} + +// NewVlanVirtualCircuitUpdateInputWithDefaults instantiates a new VlanVirtualCircuitUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVlanVirtualCircuitUpdateInputWithDefaults() *VlanVirtualCircuitUpdateInput { + this := VlanVirtualCircuitUpdateInput{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VlanVirtualCircuitUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VlanVirtualCircuitUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VlanVirtualCircuitUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VlanVirtualCircuitUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VlanVirtualCircuitUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VlanVirtualCircuitUpdateInput) SetName(v string) { + o.Name = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VlanVirtualCircuitUpdateInput) GetSpeed() string { + if o == nil || IsNil(o.Speed) { + var ret string + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitUpdateInput) GetSpeedOk() (*string, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VlanVirtualCircuitUpdateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given string and assigns it to the Speed field. +func (o *VlanVirtualCircuitUpdateInput) SetSpeed(v string) { + o.Speed = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VlanVirtualCircuitUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VlanVirtualCircuitUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VlanVirtualCircuitUpdateInput) SetTags(v []string) { + o.Tags = v +} + +// GetVnid returns the Vnid field value if set, zero value otherwise. +func (o *VlanVirtualCircuitUpdateInput) GetVnid() string { + if o == nil || IsNil(o.Vnid) { + var ret string + return ret + } + return *o.Vnid +} + +// GetVnidOk returns a tuple with the Vnid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VlanVirtualCircuitUpdateInput) GetVnidOk() (*string, bool) { + if o == nil || IsNil(o.Vnid) { + return nil, false + } + return o.Vnid, true +} + +// HasVnid returns a boolean if a field has been set. +func (o *VlanVirtualCircuitUpdateInput) HasVnid() bool { + if o != nil && !IsNil(o.Vnid) { + return true + } + + return false +} + +// SetVnid gets a reference to the given string and assigns it to the Vnid field. +func (o *VlanVirtualCircuitUpdateInput) SetVnid(v string) { + o.Vnid = &v +} + +func (o VlanVirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VlanVirtualCircuitUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Vnid) { + toSerialize["vnid"] = o.Vnid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VlanVirtualCircuitUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varVlanVirtualCircuitUpdateInput := _VlanVirtualCircuitUpdateInput{} + + err = json.Unmarshal(bytes, &varVlanVirtualCircuitUpdateInput) + + if err != nil { + return err + } + + *o = VlanVirtualCircuitUpdateInput(varVlanVirtualCircuitUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "name") + delete(additionalProperties, "speed") + delete(additionalProperties, "tags") + delete(additionalProperties, "vnid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVlanVirtualCircuitUpdateInput struct { + value *VlanVirtualCircuitUpdateInput + isSet bool +} + +func (v NullableVlanVirtualCircuitUpdateInput) Get() *VlanVirtualCircuitUpdateInput { + return v.value +} + +func (v *NullableVlanVirtualCircuitUpdateInput) Set(val *VlanVirtualCircuitUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVlanVirtualCircuitUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVlanVirtualCircuitUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVlanVirtualCircuitUpdateInput(val *VlanVirtualCircuitUpdateInput) *NullableVlanVirtualCircuitUpdateInput { + return &NullableVlanVirtualCircuitUpdateInput{value: val, isSet: true} +} + +func (v NullableVlanVirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVlanVirtualCircuitUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf.go b/services/metalv1/model_vrf.go new file mode 100644 index 00000000..3e19916c --- /dev/null +++ b/services/metalv1/model_vrf.go @@ -0,0 +1,759 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the Vrf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Vrf{} + +// Vrf struct for Vrf +type Vrf struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Optional field that can be set to describe the VRF + Description *string `json:"description,omitempty"` + // True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. + Bill *bool `json:"bill,omitempty"` + // Toggle to enable the dynamic bgp neighbors feature on the VRF + BgpDynamicNeighborsEnabled *bool `json:"bgp_dynamic_neighbors_enabled,omitempty"` + // Toggle to export the VRF route-map to the dynamic bgp neighbors + BgpDynamicNeighborsExportRouteMap *bool `json:"bgp_dynamic_neighbors_export_route_map,omitempty"` + // Toggle BFD on dynamic bgp neighbors sessions + BgpDynamicNeighborsBfdEnabled *bool `json:"bgp_dynamic_neighbors_bfd_enabled,omitempty"` + // A 4-byte ASN associated with the VRF. + LocalAsn *int32 `json:"local_asn,omitempty"` + // Virtual circuits that are in the VRF + VirtualCircuits []VrfVirtualCircuit `json:"virtual_circuits,omitempty"` + // A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. + IpRanges []string `json:"ip_ranges,omitempty"` + Project *Project `json:"project,omitempty"` + Metro *Metro `json:"metro,omitempty"` + CreatedBy *User `json:"created_by,omitempty"` + Href *string `json:"href,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Vrf Vrf + +// NewVrf instantiates a new Vrf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrf() *Vrf { + this := Vrf{} + var bill bool = false + this.Bill = &bill + return &this +} + +// NewVrfWithDefaults instantiates a new Vrf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfWithDefaults() *Vrf { + this := Vrf{} + var bill bool = false + this.Bill = &bill + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Vrf) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Vrf) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Vrf) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Vrf) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Vrf) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Vrf) SetName(v string) { + o.Name = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Vrf) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Vrf) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Vrf) SetDescription(v string) { + o.Description = &v +} + +// GetBill returns the Bill field value if set, zero value otherwise. +func (o *Vrf) GetBill() bool { + if o == nil || IsNil(o.Bill) { + var ret bool + return ret + } + return *o.Bill +} + +// GetBillOk returns a tuple with the Bill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetBillOk() (*bool, bool) { + if o == nil || IsNil(o.Bill) { + return nil, false + } + return o.Bill, true +} + +// HasBill returns a boolean if a field has been set. +func (o *Vrf) HasBill() bool { + if o != nil && !IsNil(o.Bill) { + return true + } + + return false +} + +// SetBill gets a reference to the given bool and assigns it to the Bill field. +func (o *Vrf) SetBill(v bool) { + o.Bill = &v +} + +// GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field value if set, zero value otherwise. +func (o *Vrf) GetBgpDynamicNeighborsEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsEnabled +} + +// GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetBgpDynamicNeighborsEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsEnabled, true +} + +// HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. +func (o *Vrf) HasBgpDynamicNeighborsEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsEnabled field. +func (o *Vrf) SetBgpDynamicNeighborsEnabled(v bool) { + o.BgpDynamicNeighborsEnabled = &v +} + +// GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field value if set, zero value otherwise. +func (o *Vrf) GetBgpDynamicNeighborsExportRouteMap() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsExportRouteMap +} + +// GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return nil, false + } + return o.BgpDynamicNeighborsExportRouteMap, true +} + +// HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. +func (o *Vrf) HasBgpDynamicNeighborsExportRouteMap() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsExportRouteMap gets a reference to the given bool and assigns it to the BgpDynamicNeighborsExportRouteMap field. +func (o *Vrf) SetBgpDynamicNeighborsExportRouteMap(v bool) { + o.BgpDynamicNeighborsExportRouteMap = &v +} + +// GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field value if set, zero value otherwise. +func (o *Vrf) GetBgpDynamicNeighborsBfdEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsBfdEnabled +} + +// GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsBfdEnabled, true +} + +// HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. +func (o *Vrf) HasBgpDynamicNeighborsBfdEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsBfdEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsBfdEnabled field. +func (o *Vrf) SetBgpDynamicNeighborsBfdEnabled(v bool) { + o.BgpDynamicNeighborsBfdEnabled = &v +} + +// GetLocalAsn returns the LocalAsn field value if set, zero value otherwise. +func (o *Vrf) GetLocalAsn() int32 { + if o == nil || IsNil(o.LocalAsn) { + var ret int32 + return ret + } + return *o.LocalAsn +} + +// GetLocalAsnOk returns a tuple with the LocalAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetLocalAsnOk() (*int32, bool) { + if o == nil || IsNil(o.LocalAsn) { + return nil, false + } + return o.LocalAsn, true +} + +// HasLocalAsn returns a boolean if a field has been set. +func (o *Vrf) HasLocalAsn() bool { + if o != nil && !IsNil(o.LocalAsn) { + return true + } + + return false +} + +// SetLocalAsn gets a reference to the given int32 and assigns it to the LocalAsn field. +func (o *Vrf) SetLocalAsn(v int32) { + o.LocalAsn = &v +} + +// GetVirtualCircuits returns the VirtualCircuits field value if set, zero value otherwise. +func (o *Vrf) GetVirtualCircuits() []VrfVirtualCircuit { + if o == nil || IsNil(o.VirtualCircuits) { + var ret []VrfVirtualCircuit + return ret + } + return o.VirtualCircuits +} + +// GetVirtualCircuitsOk returns a tuple with the VirtualCircuits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetVirtualCircuitsOk() ([]VrfVirtualCircuit, bool) { + if o == nil || IsNil(o.VirtualCircuits) { + return nil, false + } + return o.VirtualCircuits, true +} + +// HasVirtualCircuits returns a boolean if a field has been set. +func (o *Vrf) HasVirtualCircuits() bool { + if o != nil && !IsNil(o.VirtualCircuits) { + return true + } + + return false +} + +// SetVirtualCircuits gets a reference to the given []VrfVirtualCircuit and assigns it to the VirtualCircuits field. +func (o *Vrf) SetVirtualCircuits(v []VrfVirtualCircuit) { + o.VirtualCircuits = v +} + +// GetIpRanges returns the IpRanges field value if set, zero value otherwise. +func (o *Vrf) GetIpRanges() []string { + if o == nil || IsNil(o.IpRanges) { + var ret []string + return ret + } + return o.IpRanges +} + +// GetIpRangesOk returns a tuple with the IpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetIpRangesOk() ([]string, bool) { + if o == nil || IsNil(o.IpRanges) { + return nil, false + } + return o.IpRanges, true +} + +// HasIpRanges returns a boolean if a field has been set. +func (o *Vrf) HasIpRanges() bool { + if o != nil && !IsNil(o.IpRanges) { + return true + } + + return false +} + +// SetIpRanges gets a reference to the given []string and assigns it to the IpRanges field. +func (o *Vrf) SetIpRanges(v []string) { + o.IpRanges = v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *Vrf) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *Vrf) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *Vrf) SetProject(v Project) { + o.Project = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *Vrf) GetMetro() Metro { + if o == nil || IsNil(o.Metro) { + var ret Metro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetMetroOk() (*Metro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *Vrf) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given Metro and assigns it to the Metro field. +func (o *Vrf) SetMetro(v Metro) { + o.Metro = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *Vrf) GetCreatedBy() User { + if o == nil || IsNil(o.CreatedBy) { + var ret User + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetCreatedByOk() (*User, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *Vrf) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given User and assigns it to the CreatedBy field. +func (o *Vrf) SetCreatedBy(v User) { + o.CreatedBy = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *Vrf) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *Vrf) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *Vrf) SetHref(v string) { + o.Href = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Vrf) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Vrf) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Vrf) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Vrf) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Vrf) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Vrf) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *Vrf) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Vrf) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Vrf) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *Vrf) SetTags(v []string) { + o.Tags = v +} + +func (o Vrf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Vrf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Bill) { + toSerialize["bill"] = o.Bill + } + if !IsNil(o.BgpDynamicNeighborsEnabled) { + toSerialize["bgp_dynamic_neighbors_enabled"] = o.BgpDynamicNeighborsEnabled + } + if !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + toSerialize["bgp_dynamic_neighbors_export_route_map"] = o.BgpDynamicNeighborsExportRouteMap + } + if !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + toSerialize["bgp_dynamic_neighbors_bfd_enabled"] = o.BgpDynamicNeighborsBfdEnabled + } + if !IsNil(o.LocalAsn) { + toSerialize["local_asn"] = o.LocalAsn + } + if !IsNil(o.VirtualCircuits) { + toSerialize["virtual_circuits"] = o.VirtualCircuits + } + if !IsNil(o.IpRanges) { + toSerialize["ip_ranges"] = o.IpRanges + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Vrf) UnmarshalJSON(bytes []byte) (err error) { + varVrf := _Vrf{} + + err = json.Unmarshal(bytes, &varVrf) + + if err != nil { + return err + } + + *o = Vrf(varVrf) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "bill") + delete(additionalProperties, "bgp_dynamic_neighbors_enabled") + delete(additionalProperties, "bgp_dynamic_neighbors_export_route_map") + delete(additionalProperties, "bgp_dynamic_neighbors_bfd_enabled") + delete(additionalProperties, "local_asn") + delete(additionalProperties, "virtual_circuits") + delete(additionalProperties, "ip_ranges") + delete(additionalProperties, "project") + delete(additionalProperties, "metro") + delete(additionalProperties, "created_by") + delete(additionalProperties, "href") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrf struct { + value *Vrf + isSet bool +} + +func (v NullableVrf) Get() *Vrf { + return v.value +} + +func (v *NullableVrf) Set(val *Vrf) { + v.value = val + v.isSet = true +} + +func (v NullableVrf) IsSet() bool { + return v.isSet +} + +func (v *NullableVrf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrf(val *Vrf) *NullableVrf { + return &NullableVrf{value: val, isSet: true} +} + +func (v NullableVrf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_create_input.go b/services/metalv1/model_vrf_create_input.go new file mode 100644 index 00000000..d610a8ae --- /dev/null +++ b/services/metalv1/model_vrf_create_input.go @@ -0,0 +1,460 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfCreateInput{} + +// VrfCreateInput struct for VrfCreateInput +type VrfCreateInput struct { + // Toggle to enable the dynamic bgp neighbors feature on the VRF + BgpDynamicNeighborsEnabled *bool `json:"bgp_dynamic_neighbors_enabled,omitempty"` + // Toggle to export the VRF route-map to the dynamic bgp neighbors + BgpDynamicNeighborsExportRouteMap *bool `json:"bgp_dynamic_neighbors_export_route_map,omitempty"` + // Toggle BFD on dynamic bgp neighbors sessions + BgpDynamicNeighborsBfdEnabled *bool `json:"bgp_dynamic_neighbors_bfd_enabled,omitempty"` + Description *string `json:"description,omitempty"` + // A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. + IpRanges []string `json:"ip_ranges,omitempty"` + LocalAsn *int32 `json:"local_asn,omitempty"` + // The UUID (or metro code) for the Metro in which to create this VRF. + Metro string `json:"metro"` + Name string `json:"name"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfCreateInput VrfCreateInput + +// NewVrfCreateInput instantiates a new VrfCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfCreateInput(metro string, name string) *VrfCreateInput { + this := VrfCreateInput{} + this.Metro = metro + this.Name = name + return &this +} + +// NewVrfCreateInputWithDefaults instantiates a new VrfCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfCreateInputWithDefaults() *VrfCreateInput { + this := VrfCreateInput{} + return &this +} + +// GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field value if set, zero value otherwise. +func (o *VrfCreateInput) GetBgpDynamicNeighborsEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsEnabled +} + +// GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetBgpDynamicNeighborsEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsEnabled, true +} + +// HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. +func (o *VrfCreateInput) HasBgpDynamicNeighborsEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsEnabled field. +func (o *VrfCreateInput) SetBgpDynamicNeighborsEnabled(v bool) { + o.BgpDynamicNeighborsEnabled = &v +} + +// GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field value if set, zero value otherwise. +func (o *VrfCreateInput) GetBgpDynamicNeighborsExportRouteMap() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsExportRouteMap +} + +// GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return nil, false + } + return o.BgpDynamicNeighborsExportRouteMap, true +} + +// HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. +func (o *VrfCreateInput) HasBgpDynamicNeighborsExportRouteMap() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsExportRouteMap gets a reference to the given bool and assigns it to the BgpDynamicNeighborsExportRouteMap field. +func (o *VrfCreateInput) SetBgpDynamicNeighborsExportRouteMap(v bool) { + o.BgpDynamicNeighborsExportRouteMap = &v +} + +// GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field value if set, zero value otherwise. +func (o *VrfCreateInput) GetBgpDynamicNeighborsBfdEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsBfdEnabled +} + +// GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsBfdEnabled, true +} + +// HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. +func (o *VrfCreateInput) HasBgpDynamicNeighborsBfdEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsBfdEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsBfdEnabled field. +func (o *VrfCreateInput) SetBgpDynamicNeighborsBfdEnabled(v bool) { + o.BgpDynamicNeighborsBfdEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetIpRanges returns the IpRanges field value if set, zero value otherwise. +func (o *VrfCreateInput) GetIpRanges() []string { + if o == nil || IsNil(o.IpRanges) { + var ret []string + return ret + } + return o.IpRanges +} + +// GetIpRangesOk returns a tuple with the IpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetIpRangesOk() ([]string, bool) { + if o == nil || IsNil(o.IpRanges) { + return nil, false + } + return o.IpRanges, true +} + +// HasIpRanges returns a boolean if a field has been set. +func (o *VrfCreateInput) HasIpRanges() bool { + if o != nil && !IsNil(o.IpRanges) { + return true + } + + return false +} + +// SetIpRanges gets a reference to the given []string and assigns it to the IpRanges field. +func (o *VrfCreateInput) SetIpRanges(v []string) { + o.IpRanges = v +} + +// GetLocalAsn returns the LocalAsn field value if set, zero value otherwise. +func (o *VrfCreateInput) GetLocalAsn() int32 { + if o == nil || IsNil(o.LocalAsn) { + var ret int32 + return ret + } + return *o.LocalAsn +} + +// GetLocalAsnOk returns a tuple with the LocalAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetLocalAsnOk() (*int32, bool) { + if o == nil || IsNil(o.LocalAsn) { + return nil, false + } + return o.LocalAsn, true +} + +// HasLocalAsn returns a boolean if a field has been set. +func (o *VrfCreateInput) HasLocalAsn() bool { + if o != nil && !IsNil(o.LocalAsn) { + return true + } + + return false +} + +// SetLocalAsn gets a reference to the given int32 and assigns it to the LocalAsn field. +func (o *VrfCreateInput) SetLocalAsn(v int32) { + o.LocalAsn = &v +} + +// GetMetro returns the Metro field value +func (o *VrfCreateInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *VrfCreateInput) SetMetro(v string) { + o.Metro = v +} + +// GetName returns the Name field value +func (o *VrfCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VrfCreateInput) SetName(v string) { + o.Name = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VrfCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpDynamicNeighborsEnabled) { + toSerialize["bgp_dynamic_neighbors_enabled"] = o.BgpDynamicNeighborsEnabled + } + if !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + toSerialize["bgp_dynamic_neighbors_export_route_map"] = o.BgpDynamicNeighborsExportRouteMap + } + if !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + toSerialize["bgp_dynamic_neighbors_bfd_enabled"] = o.BgpDynamicNeighborsBfdEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IpRanges) { + toSerialize["ip_ranges"] = o.IpRanges + } + if !IsNil(o.LocalAsn) { + toSerialize["local_asn"] = o.LocalAsn + } + toSerialize["metro"] = o.Metro + toSerialize["name"] = o.Name + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfCreateInput := _VrfCreateInput{} + + err = json.Unmarshal(bytes, &varVrfCreateInput) + + if err != nil { + return err + } + + *o = VrfCreateInput(varVrfCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_dynamic_neighbors_enabled") + delete(additionalProperties, "bgp_dynamic_neighbors_export_route_map") + delete(additionalProperties, "bgp_dynamic_neighbors_bfd_enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "ip_ranges") + delete(additionalProperties, "local_asn") + delete(additionalProperties, "metro") + delete(additionalProperties, "name") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfCreateInput struct { + value *VrfCreateInput + isSet bool +} + +func (v NullableVrfCreateInput) Get() *VrfCreateInput { + return v.value +} + +func (v *NullableVrfCreateInput) Set(val *VrfCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfCreateInput(val *VrfCreateInput) *NullableVrfCreateInput { + return &NullableVrfCreateInput{value: val, isSet: true} +} + +func (v NullableVrfCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_fabric_vc_create_input.go b/services/metalv1/model_vrf_fabric_vc_create_input.go new file mode 100644 index 00000000..288ae042 --- /dev/null +++ b/services/metalv1/model_vrf_fabric_vc_create_input.go @@ -0,0 +1,502 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfFabricVcCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfFabricVcCreateInput{} + +// VrfFabricVcCreateInput struct for VrfFabricVcCreateInput +type VrfFabricVcCreateInput struct { + // The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + ContactEmail *string `json:"contact_email,omitempty"` + Description *string `json:"description,omitempty"` + // A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. + Metro string `json:"metro"` + Name string `json:"name"` + Project *string `json:"project,omitempty"` + // Either 'primary' or 'redundant'. + Redundancy string `json:"redundancy"` + ServiceTokenType VlanFabricVcCreateInputServiceTokenType `json:"service_token_type"` + // A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + Speed *int32 `json:"speed,omitempty"` + Tags []string `json:"tags,omitempty"` + Type VlanFabricVcCreateInputType `json:"type"` + // This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + Vrfs []string `json:"vrfs"` + AdditionalProperties map[string]interface{} +} + +type _VrfFabricVcCreateInput VrfFabricVcCreateInput + +// NewVrfFabricVcCreateInput instantiates a new VrfFabricVcCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfFabricVcCreateInput(metro string, name string, redundancy string, serviceTokenType VlanFabricVcCreateInputServiceTokenType, type_ VlanFabricVcCreateInputType, vrfs []string) *VrfFabricVcCreateInput { + this := VrfFabricVcCreateInput{} + this.Metro = metro + this.Name = name + this.Redundancy = redundancy + this.ServiceTokenType = serviceTokenType + this.Type = type_ + this.Vrfs = vrfs + return &this +} + +// NewVrfFabricVcCreateInputWithDefaults instantiates a new VrfFabricVcCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfFabricVcCreateInputWithDefaults() *VrfFabricVcCreateInput { + this := VrfFabricVcCreateInput{} + return &this +} + +// GetContactEmail returns the ContactEmail field value if set, zero value otherwise. +func (o *VrfFabricVcCreateInput) GetContactEmail() string { + if o == nil || IsNil(o.ContactEmail) { + var ret string + return ret + } + return *o.ContactEmail +} + +// GetContactEmailOk returns a tuple with the ContactEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetContactEmailOk() (*string, bool) { + if o == nil || IsNil(o.ContactEmail) { + return nil, false + } + return o.ContactEmail, true +} + +// HasContactEmail returns a boolean if a field has been set. +func (o *VrfFabricVcCreateInput) HasContactEmail() bool { + if o != nil && !IsNil(o.ContactEmail) { + return true + } + + return false +} + +// SetContactEmail gets a reference to the given string and assigns it to the ContactEmail field. +func (o *VrfFabricVcCreateInput) SetContactEmail(v string) { + o.ContactEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfFabricVcCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfFabricVcCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfFabricVcCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMetro returns the Metro field value +func (o *VrfFabricVcCreateInput) GetMetro() string { + if o == nil { + var ret string + return ret + } + + return o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetMetroOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metro, true +} + +// SetMetro sets field value +func (o *VrfFabricVcCreateInput) SetMetro(v string) { + o.Metro = v +} + +// GetName returns the Name field value +func (o *VrfFabricVcCreateInput) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VrfFabricVcCreateInput) SetName(v string) { + o.Name = v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VrfFabricVcCreateInput) GetProject() string { + if o == nil || IsNil(o.Project) { + var ret string + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetProjectOk() (*string, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VrfFabricVcCreateInput) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given string and assigns it to the Project field. +func (o *VrfFabricVcCreateInput) SetProject(v string) { + o.Project = &v +} + +// GetRedundancy returns the Redundancy field value +func (o *VrfFabricVcCreateInput) GetRedundancy() string { + if o == nil { + var ret string + return ret + } + + return o.Redundancy +} + +// GetRedundancyOk returns a tuple with the Redundancy field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetRedundancyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Redundancy, true +} + +// SetRedundancy sets field value +func (o *VrfFabricVcCreateInput) SetRedundancy(v string) { + o.Redundancy = v +} + +// GetServiceTokenType returns the ServiceTokenType field value +func (o *VrfFabricVcCreateInput) GetServiceTokenType() VlanFabricVcCreateInputServiceTokenType { + if o == nil { + var ret VlanFabricVcCreateInputServiceTokenType + return ret + } + + return o.ServiceTokenType +} + +// GetServiceTokenTypeOk returns a tuple with the ServiceTokenType field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetServiceTokenTypeOk() (*VlanFabricVcCreateInputServiceTokenType, bool) { + if o == nil { + return nil, false + } + return &o.ServiceTokenType, true +} + +// SetServiceTokenType sets field value +func (o *VrfFabricVcCreateInput) SetServiceTokenType(v VlanFabricVcCreateInputServiceTokenType) { + o.ServiceTokenType = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VrfFabricVcCreateInput) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VrfFabricVcCreateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VrfFabricVcCreateInput) SetSpeed(v int32) { + o.Speed = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfFabricVcCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfFabricVcCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfFabricVcCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *VrfFabricVcCreateInput) GetType() VlanFabricVcCreateInputType { + if o == nil { + var ret VlanFabricVcCreateInputType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetTypeOk() (*VlanFabricVcCreateInputType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VrfFabricVcCreateInput) SetType(v VlanFabricVcCreateInputType) { + o.Type = v +} + +// GetVrfs returns the Vrfs field value +func (o *VrfFabricVcCreateInput) GetVrfs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Vrfs +} + +// GetVrfsOk returns a tuple with the Vrfs field value +// and a boolean to check if the value has been set. +func (o *VrfFabricVcCreateInput) GetVrfsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Vrfs, true +} + +// SetVrfs sets field value +func (o *VrfFabricVcCreateInput) SetVrfs(v []string) { + o.Vrfs = v +} + +func (o VrfFabricVcCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfFabricVcCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ContactEmail) { + toSerialize["contact_email"] = o.ContactEmail + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["metro"] = o.Metro + toSerialize["name"] = o.Name + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + toSerialize["redundancy"] = o.Redundancy + toSerialize["service_token_type"] = o.ServiceTokenType + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + toSerialize["vrfs"] = o.Vrfs + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfFabricVcCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metro", + "name", + "redundancy", + "service_token_type", + "type", + "vrfs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfFabricVcCreateInput := _VrfFabricVcCreateInput{} + + err = json.Unmarshal(bytes, &varVrfFabricVcCreateInput) + + if err != nil { + return err + } + + *o = VrfFabricVcCreateInput(varVrfFabricVcCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "contact_email") + delete(additionalProperties, "description") + delete(additionalProperties, "metro") + delete(additionalProperties, "name") + delete(additionalProperties, "project") + delete(additionalProperties, "redundancy") + delete(additionalProperties, "service_token_type") + delete(additionalProperties, "speed") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "vrfs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfFabricVcCreateInput struct { + value *VrfFabricVcCreateInput + isSet bool +} + +func (v NullableVrfFabricVcCreateInput) Get() *VrfFabricVcCreateInput { + return v.value +} + +func (v *NullableVrfFabricVcCreateInput) Set(val *VrfFabricVcCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfFabricVcCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfFabricVcCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfFabricVcCreateInput(val *VrfFabricVcCreateInput) *NullableVrfFabricVcCreateInput { + return &NullableVrfFabricVcCreateInput{value: val, isSet: true} +} + +func (v NullableVrfFabricVcCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfFabricVcCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_ip_reservation.go b/services/metalv1/model_vrf_ip_reservation.go new file mode 100644 index 00000000..faacce4c --- /dev/null +++ b/services/metalv1/model_vrf_ip_reservation.go @@ -0,0 +1,1011 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VrfIpReservation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfIpReservation{} + +// VrfIpReservation struct for VrfIpReservation +type VrfIpReservation struct { + AddressFamily *int32 `json:"address_family,omitempty"` + Cidr *int32 `json:"cidr,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedBy *Href `json:"created_by,omitempty"` + Details *string `json:"details,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + MetalGateway *MetalGatewayLite `json:"metal_gateway,omitempty"` + Netmask *string `json:"netmask,omitempty"` + Network *string `json:"network,omitempty"` + Project *Project `json:"project,omitempty"` + State *string `json:"state,omitempty"` + Tags []string `json:"tags,omitempty"` + Type VrfIpReservationType `json:"type"` + Vrf Vrf `json:"vrf"` + Public *bool `json:"public,omitempty"` + Management *bool `json:"management,omitempty"` + Manageable *bool `json:"manageable,omitempty"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Bill *bool `json:"bill,omitempty"` + ProjectLite *Project `json:"project_lite,omitempty"` + Address *string `json:"address,omitempty"` + Gateway *string `json:"gateway,omitempty"` + Metro *Metro `json:"metro,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfIpReservation VrfIpReservation + +// NewVrfIpReservation instantiates a new VrfIpReservation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfIpReservation(type_ VrfIpReservationType, vrf Vrf) *VrfIpReservation { + this := VrfIpReservation{} + this.Type = type_ + this.Vrf = vrf + return &this +} + +// NewVrfIpReservationWithDefaults instantiates a new VrfIpReservation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfIpReservationWithDefaults() *VrfIpReservation { + this := VrfIpReservation{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *VrfIpReservation) GetAddressFamily() int32 { + if o == nil || IsNil(o.AddressFamily) { + var ret int32 + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetAddressFamilyOk() (*int32, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *VrfIpReservation) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given int32 and assigns it to the AddressFamily field. +func (o *VrfIpReservation) SetAddressFamily(v int32) { + o.AddressFamily = &v +} + +// GetCidr returns the Cidr field value if set, zero value otherwise. +func (o *VrfIpReservation) GetCidr() int32 { + if o == nil || IsNil(o.Cidr) { + var ret int32 + return ret + } + return *o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetCidrOk() (*int32, bool) { + if o == nil || IsNil(o.Cidr) { + return nil, false + } + return o.Cidr, true +} + +// HasCidr returns a boolean if a field has been set. +func (o *VrfIpReservation) HasCidr() bool { + if o != nil && !IsNil(o.Cidr) { + return true + } + + return false +} + +// SetCidr gets a reference to the given int32 and assigns it to the Cidr field. +func (o *VrfIpReservation) SetCidr(v int32) { + o.Cidr = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VrfIpReservation) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VrfIpReservation) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VrfIpReservation) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *VrfIpReservation) GetCreatedBy() Href { + if o == nil || IsNil(o.CreatedBy) { + var ret Href + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetCreatedByOk() (*Href, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *VrfIpReservation) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given Href and assigns it to the CreatedBy field. +func (o *VrfIpReservation) SetCreatedBy(v Href) { + o.CreatedBy = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *VrfIpReservation) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *VrfIpReservation) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *VrfIpReservation) SetDetails(v string) { + o.Details = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *VrfIpReservation) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *VrfIpReservation) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *VrfIpReservation) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VrfIpReservation) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VrfIpReservation) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VrfIpReservation) SetId(v string) { + o.Id = &v +} + +// GetMetalGateway returns the MetalGateway field value if set, zero value otherwise. +func (o *VrfIpReservation) GetMetalGateway() MetalGatewayLite { + if o == nil || IsNil(o.MetalGateway) { + var ret MetalGatewayLite + return ret + } + return *o.MetalGateway +} + +// GetMetalGatewayOk returns a tuple with the MetalGateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetMetalGatewayOk() (*MetalGatewayLite, bool) { + if o == nil || IsNil(o.MetalGateway) { + return nil, false + } + return o.MetalGateway, true +} + +// HasMetalGateway returns a boolean if a field has been set. +func (o *VrfIpReservation) HasMetalGateway() bool { + if o != nil && !IsNil(o.MetalGateway) { + return true + } + + return false +} + +// SetMetalGateway gets a reference to the given MetalGatewayLite and assigns it to the MetalGateway field. +func (o *VrfIpReservation) SetMetalGateway(v MetalGatewayLite) { + o.MetalGateway = &v +} + +// GetNetmask returns the Netmask field value if set, zero value otherwise. +func (o *VrfIpReservation) GetNetmask() string { + if o == nil || IsNil(o.Netmask) { + var ret string + return ret + } + return *o.Netmask +} + +// GetNetmaskOk returns a tuple with the Netmask field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetNetmaskOk() (*string, bool) { + if o == nil || IsNil(o.Netmask) { + return nil, false + } + return o.Netmask, true +} + +// HasNetmask returns a boolean if a field has been set. +func (o *VrfIpReservation) HasNetmask() bool { + if o != nil && !IsNil(o.Netmask) { + return true + } + + return false +} + +// SetNetmask gets a reference to the given string and assigns it to the Netmask field. +func (o *VrfIpReservation) SetNetmask(v string) { + o.Netmask = &v +} + +// GetNetwork returns the Network field value if set, zero value otherwise. +func (o *VrfIpReservation) GetNetwork() string { + if o == nil || IsNil(o.Network) { + var ret string + return ret + } + return *o.Network +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetNetworkOk() (*string, bool) { + if o == nil || IsNil(o.Network) { + return nil, false + } + return o.Network, true +} + +// HasNetwork returns a boolean if a field has been set. +func (o *VrfIpReservation) HasNetwork() bool { + if o != nil && !IsNil(o.Network) { + return true + } + + return false +} + +// SetNetwork gets a reference to the given string and assigns it to the Network field. +func (o *VrfIpReservation) SetNetwork(v string) { + o.Network = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VrfIpReservation) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VrfIpReservation) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *VrfIpReservation) SetProject(v Project) { + o.Project = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *VrfIpReservation) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *VrfIpReservation) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *VrfIpReservation) SetState(v string) { + o.State = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfIpReservation) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfIpReservation) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfIpReservation) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *VrfIpReservation) GetType() VrfIpReservationType { + if o == nil { + var ret VrfIpReservationType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetTypeOk() (*VrfIpReservationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VrfIpReservation) SetType(v VrfIpReservationType) { + o.Type = v +} + +// GetVrf returns the Vrf field value +func (o *VrfIpReservation) GetVrf() Vrf { + if o == nil { + var ret Vrf + return ret + } + + return o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetVrfOk() (*Vrf, bool) { + if o == nil { + return nil, false + } + return &o.Vrf, true +} + +// SetVrf sets field value +func (o *VrfIpReservation) SetVrf(v Vrf) { + o.Vrf = v +} + +// GetPublic returns the Public field value if set, zero value otherwise. +func (o *VrfIpReservation) GetPublic() bool { + if o == nil || IsNil(o.Public) { + var ret bool + return ret + } + return *o.Public +} + +// GetPublicOk returns a tuple with the Public field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetPublicOk() (*bool, bool) { + if o == nil || IsNil(o.Public) { + return nil, false + } + return o.Public, true +} + +// HasPublic returns a boolean if a field has been set. +func (o *VrfIpReservation) HasPublic() bool { + if o != nil && !IsNil(o.Public) { + return true + } + + return false +} + +// SetPublic gets a reference to the given bool and assigns it to the Public field. +func (o *VrfIpReservation) SetPublic(v bool) { + o.Public = &v +} + +// GetManagement returns the Management field value if set, zero value otherwise. +func (o *VrfIpReservation) GetManagement() bool { + if o == nil || IsNil(o.Management) { + var ret bool + return ret + } + return *o.Management +} + +// GetManagementOk returns a tuple with the Management field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetManagementOk() (*bool, bool) { + if o == nil || IsNil(o.Management) { + return nil, false + } + return o.Management, true +} + +// HasManagement returns a boolean if a field has been set. +func (o *VrfIpReservation) HasManagement() bool { + if o != nil && !IsNil(o.Management) { + return true + } + + return false +} + +// SetManagement gets a reference to the given bool and assigns it to the Management field. +func (o *VrfIpReservation) SetManagement(v bool) { + o.Management = &v +} + +// GetManageable returns the Manageable field value if set, zero value otherwise. +func (o *VrfIpReservation) GetManageable() bool { + if o == nil || IsNil(o.Manageable) { + var ret bool + return ret + } + return *o.Manageable +} + +// GetManageableOk returns a tuple with the Manageable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetManageableOk() (*bool, bool) { + if o == nil || IsNil(o.Manageable) { + return nil, false + } + return o.Manageable, true +} + +// HasManageable returns a boolean if a field has been set. +func (o *VrfIpReservation) HasManageable() bool { + if o != nil && !IsNil(o.Manageable) { + return true + } + + return false +} + +// SetManageable gets a reference to the given bool and assigns it to the Manageable field. +func (o *VrfIpReservation) SetManageable(v bool) { + o.Manageable = &v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *VrfIpReservation) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *VrfIpReservation) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *VrfIpReservation) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetBill returns the Bill field value if set, zero value otherwise. +func (o *VrfIpReservation) GetBill() bool { + if o == nil || IsNil(o.Bill) { + var ret bool + return ret + } + return *o.Bill +} + +// GetBillOk returns a tuple with the Bill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetBillOk() (*bool, bool) { + if o == nil || IsNil(o.Bill) { + return nil, false + } + return o.Bill, true +} + +// HasBill returns a boolean if a field has been set. +func (o *VrfIpReservation) HasBill() bool { + if o != nil && !IsNil(o.Bill) { + return true + } + + return false +} + +// SetBill gets a reference to the given bool and assigns it to the Bill field. +func (o *VrfIpReservation) SetBill(v bool) { + o.Bill = &v +} + +// GetProjectLite returns the ProjectLite field value if set, zero value otherwise. +func (o *VrfIpReservation) GetProjectLite() Project { + if o == nil || IsNil(o.ProjectLite) { + var ret Project + return ret + } + return *o.ProjectLite +} + +// GetProjectLiteOk returns a tuple with the ProjectLite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetProjectLiteOk() (*Project, bool) { + if o == nil || IsNil(o.ProjectLite) { + return nil, false + } + return o.ProjectLite, true +} + +// HasProjectLite returns a boolean if a field has been set. +func (o *VrfIpReservation) HasProjectLite() bool { + if o != nil && !IsNil(o.ProjectLite) { + return true + } + + return false +} + +// SetProjectLite gets a reference to the given Project and assigns it to the ProjectLite field. +func (o *VrfIpReservation) SetProjectLite(v Project) { + o.ProjectLite = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *VrfIpReservation) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *VrfIpReservation) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *VrfIpReservation) SetAddress(v string) { + o.Address = &v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise. +func (o *VrfIpReservation) GetGateway() string { + if o == nil || IsNil(o.Gateway) { + var ret string + return ret + } + return *o.Gateway +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway, true +} + +// HasGateway returns a boolean if a field has been set. +func (o *VrfIpReservation) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *VrfIpReservation) SetGateway(v string) { + o.Gateway = &v +} + +// GetMetro returns the Metro field value if set, zero value otherwise. +func (o *VrfIpReservation) GetMetro() Metro { + if o == nil || IsNil(o.Metro) { + var ret Metro + return ret + } + return *o.Metro +} + +// GetMetroOk returns a tuple with the Metro field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservation) GetMetroOk() (*Metro, bool) { + if o == nil || IsNil(o.Metro) { + return nil, false + } + return o.Metro, true +} + +// HasMetro returns a boolean if a field has been set. +func (o *VrfIpReservation) HasMetro() bool { + if o != nil && !IsNil(o.Metro) { + return true + } + + return false +} + +// SetMetro gets a reference to the given Metro and assigns it to the Metro field. +func (o *VrfIpReservation) SetMetro(v Metro) { + o.Metro = &v +} + +func (o VrfIpReservation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfIpReservation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["address_family"] = o.AddressFamily + } + if !IsNil(o.Cidr) { + toSerialize["cidr"] = o.Cidr + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.MetalGateway) { + toSerialize["metal_gateway"] = o.MetalGateway + } + if !IsNil(o.Netmask) { + toSerialize["netmask"] = o.Netmask + } + if !IsNil(o.Network) { + toSerialize["network"] = o.Network + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + toSerialize["vrf"] = o.Vrf + if !IsNil(o.Public) { + toSerialize["public"] = o.Public + } + if !IsNil(o.Management) { + toSerialize["management"] = o.Management + } + if !IsNil(o.Manageable) { + toSerialize["manageable"] = o.Manageable + } + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Bill) { + toSerialize["bill"] = o.Bill + } + if !IsNil(o.ProjectLite) { + toSerialize["project_lite"] = o.ProjectLite + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Gateway) { + toSerialize["gateway"] = o.Gateway + } + if !IsNil(o.Metro) { + toSerialize["metro"] = o.Metro + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfIpReservation) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "vrf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfIpReservation := _VrfIpReservation{} + + err = json.Unmarshal(bytes, &varVrfIpReservation) + + if err != nil { + return err + } + + *o = VrfIpReservation(varVrfIpReservation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "address_family") + delete(additionalProperties, "cidr") + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "details") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "metal_gateway") + delete(additionalProperties, "netmask") + delete(additionalProperties, "network") + delete(additionalProperties, "project") + delete(additionalProperties, "state") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "vrf") + delete(additionalProperties, "public") + delete(additionalProperties, "management") + delete(additionalProperties, "manageable") + delete(additionalProperties, "customdata") + delete(additionalProperties, "bill") + delete(additionalProperties, "project_lite") + delete(additionalProperties, "address") + delete(additionalProperties, "gateway") + delete(additionalProperties, "metro") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfIpReservation struct { + value *VrfIpReservation + isSet bool +} + +func (v NullableVrfIpReservation) Get() *VrfIpReservation { + return v.value +} + +func (v *NullableVrfIpReservation) Set(val *VrfIpReservation) { + v.value = val + v.isSet = true +} + +func (v NullableVrfIpReservation) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfIpReservation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfIpReservation(val *VrfIpReservation) *NullableVrfIpReservation { + return &NullableVrfIpReservation{value: val, isSet: true} +} + +func (v NullableVrfIpReservation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfIpReservation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_ip_reservation_create_input.go b/services/metalv1/model_vrf_ip_reservation_create_input.go new file mode 100644 index 00000000..746a8dbd --- /dev/null +++ b/services/metalv1/model_vrf_ip_reservation_create_input.go @@ -0,0 +1,369 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfIpReservationCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfIpReservationCreateInput{} + +// VrfIpReservationCreateInput struct for VrfIpReservationCreateInput +type VrfIpReservationCreateInput struct { + // The size of the VRF IP Reservation's subnet + Cidr int32 `json:"cidr"` + Customdata map[string]interface{} `json:"customdata,omitempty"` + Details *string `json:"details,omitempty"` + // The starting address for this VRF IP Reservation's subnet + Network string `json:"network"` + Tags []string `json:"tags,omitempty"` + // Must be set to 'vrf' + Type string `json:"type"` + // The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. + VrfId string `json:"vrf_id"` + AdditionalProperties map[string]interface{} +} + +type _VrfIpReservationCreateInput VrfIpReservationCreateInput + +// NewVrfIpReservationCreateInput instantiates a new VrfIpReservationCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfIpReservationCreateInput(cidr int32, network string, type_ string, vrfId string) *VrfIpReservationCreateInput { + this := VrfIpReservationCreateInput{} + this.Cidr = cidr + this.Network = network + this.Type = type_ + this.VrfId = vrfId + return &this +} + +// NewVrfIpReservationCreateInputWithDefaults instantiates a new VrfIpReservationCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfIpReservationCreateInputWithDefaults() *VrfIpReservationCreateInput { + this := VrfIpReservationCreateInput{} + return &this +} + +// GetCidr returns the Cidr field value +func (o *VrfIpReservationCreateInput) GetCidr() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetCidrOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Cidr, true +} + +// SetCidr sets field value +func (o *VrfIpReservationCreateInput) SetCidr(v int32) { + o.Cidr = v +} + +// GetCustomdata returns the Customdata field value if set, zero value otherwise. +func (o *VrfIpReservationCreateInput) GetCustomdata() map[string]interface{} { + if o == nil || IsNil(o.Customdata) { + var ret map[string]interface{} + return ret + } + return o.Customdata +} + +// GetCustomdataOk returns a tuple with the Customdata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetCustomdataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Customdata) { + return map[string]interface{}{}, false + } + return o.Customdata, true +} + +// HasCustomdata returns a boolean if a field has been set. +func (o *VrfIpReservationCreateInput) HasCustomdata() bool { + if o != nil && !IsNil(o.Customdata) { + return true + } + + return false +} + +// SetCustomdata gets a reference to the given map[string]interface{} and assigns it to the Customdata field. +func (o *VrfIpReservationCreateInput) SetCustomdata(v map[string]interface{}) { + o.Customdata = v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *VrfIpReservationCreateInput) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *VrfIpReservationCreateInput) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *VrfIpReservationCreateInput) SetDetails(v string) { + o.Details = &v +} + +// GetNetwork returns the Network field value +func (o *VrfIpReservationCreateInput) GetNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.Network +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Network, true +} + +// SetNetwork sets field value +func (o *VrfIpReservationCreateInput) SetNetwork(v string) { + o.Network = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfIpReservationCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfIpReservationCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfIpReservationCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value +func (o *VrfIpReservationCreateInput) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VrfIpReservationCreateInput) SetType(v string) { + o.Type = v +} + +// GetVrfId returns the VrfId field value +func (o *VrfIpReservationCreateInput) GetVrfId() string { + if o == nil { + var ret string + return ret + } + + return o.VrfId +} + +// GetVrfIdOk returns a tuple with the VrfId field value +// and a boolean to check if the value has been set. +func (o *VrfIpReservationCreateInput) GetVrfIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VrfId, true +} + +// SetVrfId sets field value +func (o *VrfIpReservationCreateInput) SetVrfId(v string) { + o.VrfId = v +} + +func (o VrfIpReservationCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfIpReservationCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cidr"] = o.Cidr + if !IsNil(o.Customdata) { + toSerialize["customdata"] = o.Customdata + } + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["network"] = o.Network + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["type"] = o.Type + toSerialize["vrf_id"] = o.VrfId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfIpReservationCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cidr", + "network", + "type", + "vrf_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfIpReservationCreateInput := _VrfIpReservationCreateInput{} + + err = json.Unmarshal(bytes, &varVrfIpReservationCreateInput) + + if err != nil { + return err + } + + *o = VrfIpReservationCreateInput(varVrfIpReservationCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cidr") + delete(additionalProperties, "customdata") + delete(additionalProperties, "details") + delete(additionalProperties, "network") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "vrf_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfIpReservationCreateInput struct { + value *VrfIpReservationCreateInput + isSet bool +} + +func (v NullableVrfIpReservationCreateInput) Get() *VrfIpReservationCreateInput { + return v.value +} + +func (v *NullableVrfIpReservationCreateInput) Set(val *VrfIpReservationCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfIpReservationCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfIpReservationCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfIpReservationCreateInput(val *VrfIpReservationCreateInput) *NullableVrfIpReservationCreateInput { + return &NullableVrfIpReservationCreateInput{value: val, isSet: true} +} + +func (v NullableVrfIpReservationCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfIpReservationCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_ip_reservation_list.go b/services/metalv1/model_vrf_ip_reservation_list.go new file mode 100644 index 00000000..c3805d4c --- /dev/null +++ b/services/metalv1/model_vrf_ip_reservation_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfIpReservationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfIpReservationList{} + +// VrfIpReservationList struct for VrfIpReservationList +type VrfIpReservationList struct { + IpAddresses []VrfIpReservation `json:"ip_addresses,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfIpReservationList VrfIpReservationList + +// NewVrfIpReservationList instantiates a new VrfIpReservationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfIpReservationList() *VrfIpReservationList { + this := VrfIpReservationList{} + return &this +} + +// NewVrfIpReservationListWithDefaults instantiates a new VrfIpReservationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfIpReservationListWithDefaults() *VrfIpReservationList { + this := VrfIpReservationList{} + return &this +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *VrfIpReservationList) GetIpAddresses() []VrfIpReservation { + if o == nil || IsNil(o.IpAddresses) { + var ret []VrfIpReservation + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfIpReservationList) GetIpAddressesOk() ([]VrfIpReservation, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *VrfIpReservationList) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []VrfIpReservation and assigns it to the IpAddresses field. +func (o *VrfIpReservationList) SetIpAddresses(v []VrfIpReservation) { + o.IpAddresses = v +} + +func (o VrfIpReservationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfIpReservationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfIpReservationList) UnmarshalJSON(bytes []byte) (err error) { + varVrfIpReservationList := _VrfIpReservationList{} + + err = json.Unmarshal(bytes, &varVrfIpReservationList) + + if err != nil { + return err + } + + *o = VrfIpReservationList(varVrfIpReservationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ip_addresses") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfIpReservationList struct { + value *VrfIpReservationList + isSet bool +} + +func (v NullableVrfIpReservationList) Get() *VrfIpReservationList { + return v.value +} + +func (v *NullableVrfIpReservationList) Set(val *VrfIpReservationList) { + v.value = val + v.isSet = true +} + +func (v NullableVrfIpReservationList) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfIpReservationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfIpReservationList(val *VrfIpReservationList) *NullableVrfIpReservationList { + return &NullableVrfIpReservationList{value: val, isSet: true} +} + +func (v NullableVrfIpReservationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfIpReservationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_ip_reservation_type.go b/services/metalv1/model_vrf_ip_reservation_type.go new file mode 100644 index 00000000..cedf4914 --- /dev/null +++ b/services/metalv1/model_vrf_ip_reservation_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VrfIpReservationType the model 'VrfIpReservationType' +type VrfIpReservationType string + +// List of VrfIpReservation_type +const ( + VRFIPRESERVATIONTYPE_VRF VrfIpReservationType = "vrf" +) + +// All allowed values of VrfIpReservationType enum +var AllowedVrfIpReservationTypeEnumValues = []VrfIpReservationType{ + "vrf", +} + +func (v *VrfIpReservationType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VrfIpReservationType(value) + for _, existing := range AllowedVrfIpReservationTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VrfIpReservationType", value) +} + +// NewVrfIpReservationTypeFromValue returns a pointer to a valid VrfIpReservationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVrfIpReservationTypeFromValue(v string) (*VrfIpReservationType, error) { + ev := VrfIpReservationType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VrfIpReservationType: valid values are %v", v, AllowedVrfIpReservationTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VrfIpReservationType) IsValid() bool { + for _, existing := range AllowedVrfIpReservationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VrfIpReservation_type value +func (v VrfIpReservationType) Ptr() *VrfIpReservationType { + return &v +} + +type NullableVrfIpReservationType struct { + value *VrfIpReservationType + isSet bool +} + +func (v NullableVrfIpReservationType) Get() *VrfIpReservationType { + return v.value +} + +func (v *NullableVrfIpReservationType) Set(val *VrfIpReservationType) { + v.value = val + v.isSet = true +} + +func (v NullableVrfIpReservationType) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfIpReservationType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfIpReservationType(val *VrfIpReservationType) *NullableVrfIpReservationType { + return &NullableVrfIpReservationType{value: val, isSet: true} +} + +func (v NullableVrfIpReservationType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfIpReservationType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_list.go b/services/metalv1/model_vrf_list.go new file mode 100644 index 00000000..c53fbdb5 --- /dev/null +++ b/services/metalv1/model_vrf_list.go @@ -0,0 +1,154 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfList{} + +// VrfList struct for VrfList +type VrfList struct { + Vrfs []Vrf `json:"vrfs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfList VrfList + +// NewVrfList instantiates a new VrfList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfList() *VrfList { + this := VrfList{} + return &this +} + +// NewVrfListWithDefaults instantiates a new VrfList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfListWithDefaults() *VrfList { + this := VrfList{} + return &this +} + +// GetVrfs returns the Vrfs field value if set, zero value otherwise. +func (o *VrfList) GetVrfs() []Vrf { + if o == nil || IsNil(o.Vrfs) { + var ret []Vrf + return ret + } + return o.Vrfs +} + +// GetVrfsOk returns a tuple with the Vrfs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfList) GetVrfsOk() ([]Vrf, bool) { + if o == nil || IsNil(o.Vrfs) { + return nil, false + } + return o.Vrfs, true +} + +// HasVrfs returns a boolean if a field has been set. +func (o *VrfList) HasVrfs() bool { + if o != nil && !IsNil(o.Vrfs) { + return true + } + + return false +} + +// SetVrfs gets a reference to the given []Vrf and assigns it to the Vrfs field. +func (o *VrfList) SetVrfs(v []Vrf) { + o.Vrfs = v +} + +func (o VrfList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Vrfs) { + toSerialize["vrfs"] = o.Vrfs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfList) UnmarshalJSON(bytes []byte) (err error) { + varVrfList := _VrfList{} + + err = json.Unmarshal(bytes, &varVrfList) + + if err != nil { + return err + } + + *o = VrfList(varVrfList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "vrfs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfList struct { + value *VrfList + isSet bool +} + +func (v NullableVrfList) Get() *VrfList { + return v.value +} + +func (v *NullableVrfList) Set(val *VrfList) { + v.value = val + v.isSet = true +} + +func (v NullableVrfList) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfList(val *VrfList) *NullableVrfList { + return &NullableVrfList{value: val, isSet: true} +} + +func (v NullableVrfList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_metal_gateway.go b/services/metalv1/model_vrf_metal_gateway.go new file mode 100644 index 00000000..bb27dff1 --- /dev/null +++ b/services/metalv1/model_vrf_metal_gateway.go @@ -0,0 +1,488 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the VrfMetalGateway type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfMetalGateway{} + +// VrfMetalGateway struct for VrfMetalGateway +type VrfMetalGateway struct { + CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedBy *Href `json:"created_by,omitempty"` + Href *string `json:"href,omitempty"` + Id *string `json:"id,omitempty"` + IpReservation *VrfIpReservation `json:"ip_reservation,omitempty"` + Project *Project `json:"project,omitempty"` + State *MetalGatewayState `json:"state,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"` + Vrf *Vrf `json:"vrf,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfMetalGateway VrfMetalGateway + +// NewVrfMetalGateway instantiates a new VrfMetalGateway object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfMetalGateway() *VrfMetalGateway { + this := VrfMetalGateway{} + return &this +} + +// NewVrfMetalGatewayWithDefaults instantiates a new VrfMetalGateway object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfMetalGatewayWithDefaults() *VrfMetalGateway { + this := VrfMetalGateway{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VrfMetalGateway) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetCreatedBy() Href { + if o == nil || IsNil(o.CreatedBy) { + var ret Href + return ret + } + return *o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetCreatedByOk() (*Href, bool) { + if o == nil || IsNil(o.CreatedBy) { + return nil, false + } + return o.CreatedBy, true +} + +// HasCreatedBy returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasCreatedBy() bool { + if o != nil && !IsNil(o.CreatedBy) { + return true + } + + return false +} + +// SetCreatedBy gets a reference to the given Href and assigns it to the CreatedBy field. +func (o *VrfMetalGateway) SetCreatedBy(v Href) { + o.CreatedBy = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *VrfMetalGateway) SetHref(v string) { + o.Href = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VrfMetalGateway) SetId(v string) { + o.Id = &v +} + +// GetIpReservation returns the IpReservation field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetIpReservation() VrfIpReservation { + if o == nil || IsNil(o.IpReservation) { + var ret VrfIpReservation + return ret + } + return *o.IpReservation +} + +// GetIpReservationOk returns a tuple with the IpReservation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetIpReservationOk() (*VrfIpReservation, bool) { + if o == nil || IsNil(o.IpReservation) { + return nil, false + } + return o.IpReservation, true +} + +// HasIpReservation returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasIpReservation() bool { + if o != nil && !IsNil(o.IpReservation) { + return true + } + + return false +} + +// SetIpReservation gets a reference to the given VrfIpReservation and assigns it to the IpReservation field. +func (o *VrfMetalGateway) SetIpReservation(v VrfIpReservation) { + o.IpReservation = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetProject() Project { + if o == nil || IsNil(o.Project) { + var ret Project + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetProjectOk() (*Project, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Project and assigns it to the Project field. +func (o *VrfMetalGateway) SetProject(v Project) { + o.Project = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetState() MetalGatewayState { + if o == nil || IsNil(o.State) { + var ret MetalGatewayState + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetStateOk() (*MetalGatewayState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given MetalGatewayState and assigns it to the State field. +func (o *VrfMetalGateway) SetState(v MetalGatewayState) { + o.State = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *VrfMetalGateway) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVirtualNetwork returns the VirtualNetwork field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetVirtualNetwork() VirtualNetwork { + if o == nil || IsNil(o.VirtualNetwork) { + var ret VirtualNetwork + return ret + } + return *o.VirtualNetwork +} + +// GetVirtualNetworkOk returns a tuple with the VirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetVirtualNetworkOk() (*VirtualNetwork, bool) { + if o == nil || IsNil(o.VirtualNetwork) { + return nil, false + } + return o.VirtualNetwork, true +} + +// HasVirtualNetwork returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasVirtualNetwork() bool { + if o != nil && !IsNil(o.VirtualNetwork) { + return true + } + + return false +} + +// SetVirtualNetwork gets a reference to the given VirtualNetwork and assigns it to the VirtualNetwork field. +func (o *VrfMetalGateway) SetVirtualNetwork(v VirtualNetwork) { + o.VirtualNetwork = &v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise. +func (o *VrfMetalGateway) GetVrf() Vrf { + if o == nil || IsNil(o.Vrf) { + var ret Vrf + return ret + } + return *o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfMetalGateway) GetVrfOk() (*Vrf, bool) { + if o == nil || IsNil(o.Vrf) { + return nil, false + } + return o.Vrf, true +} + +// HasVrf returns a boolean if a field has been set. +func (o *VrfMetalGateway) HasVrf() bool { + if o != nil && !IsNil(o.Vrf) { + return true + } + + return false +} + +// SetVrf gets a reference to the given Vrf and assigns it to the Vrf field. +func (o *VrfMetalGateway) SetVrf(v Vrf) { + o.Vrf = &v +} + +func (o VrfMetalGateway) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfMetalGateway) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.CreatedBy) { + toSerialize["created_by"] = o.CreatedBy + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpReservation) { + toSerialize["ip_reservation"] = o.IpReservation + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.VirtualNetwork) { + toSerialize["virtual_network"] = o.VirtualNetwork + } + if !IsNil(o.Vrf) { + toSerialize["vrf"] = o.Vrf + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfMetalGateway) UnmarshalJSON(bytes []byte) (err error) { + varVrfMetalGateway := _VrfMetalGateway{} + + err = json.Unmarshal(bytes, &varVrfMetalGateway) + + if err != nil { + return err + } + + *o = VrfMetalGateway(varVrfMetalGateway) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "created_at") + delete(additionalProperties, "created_by") + delete(additionalProperties, "href") + delete(additionalProperties, "id") + delete(additionalProperties, "ip_reservation") + delete(additionalProperties, "project") + delete(additionalProperties, "state") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "virtual_network") + delete(additionalProperties, "vrf") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfMetalGateway struct { + value *VrfMetalGateway + isSet bool +} + +func (v NullableVrfMetalGateway) Get() *VrfMetalGateway { + return v.value +} + +func (v *NullableVrfMetalGateway) Set(val *VrfMetalGateway) { + v.value = val + v.isSet = true +} + +func (v NullableVrfMetalGateway) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfMetalGateway) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfMetalGateway(val *VrfMetalGateway) *NullableVrfMetalGateway { + return &NullableVrfMetalGateway{value: val, isSet: true} +} + +func (v NullableVrfMetalGateway) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfMetalGateway) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_metal_gateway_create_input.go b/services/metalv1/model_vrf_metal_gateway_create_input.go new file mode 100644 index 00000000..9d80dc48 --- /dev/null +++ b/services/metalv1/model_vrf_metal_gateway_create_input.go @@ -0,0 +1,198 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfMetalGatewayCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfMetalGatewayCreateInput{} + +// VrfMetalGatewayCreateInput struct for VrfMetalGatewayCreateInput +type VrfMetalGatewayCreateInput struct { + // The UUID an a VRF IP Reservation that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation and the Virtual Network must reside in the same Metro. + IpReservationId string `json:"ip_reservation_id"` + // THe UUID of a Metro Virtual Network that belongs to the same project as the one in which the Metal Gateway is to be created. Additionally, the Virtual Network and the VRF IP Reservation must reside in the same metro. + VirtualNetworkId string `json:"virtual_network_id"` + AdditionalProperties map[string]interface{} +} + +type _VrfMetalGatewayCreateInput VrfMetalGatewayCreateInput + +// NewVrfMetalGatewayCreateInput instantiates a new VrfMetalGatewayCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfMetalGatewayCreateInput(ipReservationId string, virtualNetworkId string) *VrfMetalGatewayCreateInput { + this := VrfMetalGatewayCreateInput{} + this.IpReservationId = ipReservationId + this.VirtualNetworkId = virtualNetworkId + return &this +} + +// NewVrfMetalGatewayCreateInputWithDefaults instantiates a new VrfMetalGatewayCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfMetalGatewayCreateInputWithDefaults() *VrfMetalGatewayCreateInput { + this := VrfMetalGatewayCreateInput{} + return &this +} + +// GetIpReservationId returns the IpReservationId field value +func (o *VrfMetalGatewayCreateInput) GetIpReservationId() string { + if o == nil { + var ret string + return ret + } + + return o.IpReservationId +} + +// GetIpReservationIdOk returns a tuple with the IpReservationId field value +// and a boolean to check if the value has been set. +func (o *VrfMetalGatewayCreateInput) GetIpReservationIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IpReservationId, true +} + +// SetIpReservationId sets field value +func (o *VrfMetalGatewayCreateInput) SetIpReservationId(v string) { + o.IpReservationId = v +} + +// GetVirtualNetworkId returns the VirtualNetworkId field value +func (o *VrfMetalGatewayCreateInput) GetVirtualNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.VirtualNetworkId +} + +// GetVirtualNetworkIdOk returns a tuple with the VirtualNetworkId field value +// and a boolean to check if the value has been set. +func (o *VrfMetalGatewayCreateInput) GetVirtualNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VirtualNetworkId, true +} + +// SetVirtualNetworkId sets field value +func (o *VrfMetalGatewayCreateInput) SetVirtualNetworkId(v string) { + o.VirtualNetworkId = v +} + +func (o VrfMetalGatewayCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfMetalGatewayCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["ip_reservation_id"] = o.IpReservationId + toSerialize["virtual_network_id"] = o.VirtualNetworkId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfMetalGatewayCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "ip_reservation_id", + "virtual_network_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfMetalGatewayCreateInput := _VrfMetalGatewayCreateInput{} + + err = json.Unmarshal(bytes, &varVrfMetalGatewayCreateInput) + + if err != nil { + return err + } + + *o = VrfMetalGatewayCreateInput(varVrfMetalGatewayCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "ip_reservation_id") + delete(additionalProperties, "virtual_network_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfMetalGatewayCreateInput struct { + value *VrfMetalGatewayCreateInput + isSet bool +} + +func (v NullableVrfMetalGatewayCreateInput) Get() *VrfMetalGatewayCreateInput { + return v.value +} + +func (v *NullableVrfMetalGatewayCreateInput) Set(val *VrfMetalGatewayCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfMetalGatewayCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfMetalGatewayCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfMetalGatewayCreateInput(val *VrfMetalGatewayCreateInput) *NullableVrfMetalGatewayCreateInput { + return &NullableVrfMetalGatewayCreateInput{value: val, isSet: true} +} + +func (v NullableVrfMetalGatewayCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfMetalGatewayCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route.go b/services/metalv1/model_vrf_route.go new file mode 100644 index 00000000..3637931d --- /dev/null +++ b/services/metalv1/model_vrf_route.go @@ -0,0 +1,565 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "time" +) + +// checks if the VrfRoute type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfRoute{} + +// VrfRoute struct for VrfRoute +type VrfRoute struct { + // The unique identifier for the newly-created resource + Id *string `json:"id,omitempty"` + Status *VrfRouteStatus `json:"status,omitempty"` + // The IPv4 prefix for the route, in CIDR-style notation + Prefix *string `json:"prefix,omitempty"` + // The next-hop IPv4 address for the route + NextHop *string `json:"next_hop,omitempty"` + Type *VrfRouteType `json:"type,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + MetalGateway *VrfMetalGateway `json:"metal_gateway,omitempty"` + VirtualNetwork *VirtualNetwork `json:"virtual_network,omitempty"` + Vrf *Vrf `json:"vrf,omitempty"` + Href *string `json:"href,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfRoute VrfRoute + +// NewVrfRoute instantiates a new VrfRoute object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfRoute() *VrfRoute { + this := VrfRoute{} + return &this +} + +// NewVrfRouteWithDefaults instantiates a new VrfRoute object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfRouteWithDefaults() *VrfRoute { + this := VrfRoute{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VrfRoute) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VrfRoute) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VrfRoute) SetId(v string) { + o.Id = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VrfRoute) GetStatus() VrfRouteStatus { + if o == nil || IsNil(o.Status) { + var ret VrfRouteStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetStatusOk() (*VrfRouteStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VrfRoute) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given VrfRouteStatus and assigns it to the Status field. +func (o *VrfRoute) SetStatus(v VrfRouteStatus) { + o.Status = &v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *VrfRoute) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *VrfRoute) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *VrfRoute) SetPrefix(v string) { + o.Prefix = &v +} + +// GetNextHop returns the NextHop field value if set, zero value otherwise. +func (o *VrfRoute) GetNextHop() string { + if o == nil || IsNil(o.NextHop) { + var ret string + return ret + } + return *o.NextHop +} + +// GetNextHopOk returns a tuple with the NextHop field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetNextHopOk() (*string, bool) { + if o == nil || IsNil(o.NextHop) { + return nil, false + } + return o.NextHop, true +} + +// HasNextHop returns a boolean if a field has been set. +func (o *VrfRoute) HasNextHop() bool { + if o != nil && !IsNil(o.NextHop) { + return true + } + + return false +} + +// SetNextHop gets a reference to the given string and assigns it to the NextHop field. +func (o *VrfRoute) SetNextHop(v string) { + o.NextHop = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VrfRoute) GetType() VrfRouteType { + if o == nil || IsNil(o.Type) { + var ret VrfRouteType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetTypeOk() (*VrfRouteType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VrfRoute) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given VrfRouteType and assigns it to the Type field. +func (o *VrfRoute) SetType(v VrfRouteType) { + o.Type = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VrfRoute) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VrfRoute) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VrfRoute) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *VrfRoute) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *VrfRoute) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *VrfRoute) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetMetalGateway returns the MetalGateway field value if set, zero value otherwise. +func (o *VrfRoute) GetMetalGateway() VrfMetalGateway { + if o == nil || IsNil(o.MetalGateway) { + var ret VrfMetalGateway + return ret + } + return *o.MetalGateway +} + +// GetMetalGatewayOk returns a tuple with the MetalGateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetMetalGatewayOk() (*VrfMetalGateway, bool) { + if o == nil || IsNil(o.MetalGateway) { + return nil, false + } + return o.MetalGateway, true +} + +// HasMetalGateway returns a boolean if a field has been set. +func (o *VrfRoute) HasMetalGateway() bool { + if o != nil && !IsNil(o.MetalGateway) { + return true + } + + return false +} + +// SetMetalGateway gets a reference to the given VrfMetalGateway and assigns it to the MetalGateway field. +func (o *VrfRoute) SetMetalGateway(v VrfMetalGateway) { + o.MetalGateway = &v +} + +// GetVirtualNetwork returns the VirtualNetwork field value if set, zero value otherwise. +func (o *VrfRoute) GetVirtualNetwork() VirtualNetwork { + if o == nil || IsNil(o.VirtualNetwork) { + var ret VirtualNetwork + return ret + } + return *o.VirtualNetwork +} + +// GetVirtualNetworkOk returns a tuple with the VirtualNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetVirtualNetworkOk() (*VirtualNetwork, bool) { + if o == nil || IsNil(o.VirtualNetwork) { + return nil, false + } + return o.VirtualNetwork, true +} + +// HasVirtualNetwork returns a boolean if a field has been set. +func (o *VrfRoute) HasVirtualNetwork() bool { + if o != nil && !IsNil(o.VirtualNetwork) { + return true + } + + return false +} + +// SetVirtualNetwork gets a reference to the given VirtualNetwork and assigns it to the VirtualNetwork field. +func (o *VrfRoute) SetVirtualNetwork(v VirtualNetwork) { + o.VirtualNetwork = &v +} + +// GetVrf returns the Vrf field value if set, zero value otherwise. +func (o *VrfRoute) GetVrf() Vrf { + if o == nil || IsNil(o.Vrf) { + var ret Vrf + return ret + } + return *o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetVrfOk() (*Vrf, bool) { + if o == nil || IsNil(o.Vrf) { + return nil, false + } + return o.Vrf, true +} + +// HasVrf returns a boolean if a field has been set. +func (o *VrfRoute) HasVrf() bool { + if o != nil && !IsNil(o.Vrf) { + return true + } + + return false +} + +// SetVrf gets a reference to the given Vrf and assigns it to the Vrf field. +func (o *VrfRoute) SetVrf(v Vrf) { + o.Vrf = &v +} + +// GetHref returns the Href field value if set, zero value otherwise. +func (o *VrfRoute) GetHref() string { + if o == nil || IsNil(o.Href) { + var ret string + return ret + } + return *o.Href +} + +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { + return nil, false + } + return o.Href, true +} + +// HasHref returns a boolean if a field has been set. +func (o *VrfRoute) HasHref() bool { + if o != nil && !IsNil(o.Href) { + return true + } + + return false +} + +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *VrfRoute) SetHref(v string) { + o.Href = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfRoute) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRoute) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfRoute) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfRoute) SetTags(v []string) { + o.Tags = v +} + +func (o VrfRoute) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfRoute) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.NextHop) { + toSerialize["next_hop"] = o.NextHop + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.MetalGateway) { + toSerialize["metal_gateway"] = o.MetalGateway + } + if !IsNil(o.VirtualNetwork) { + toSerialize["virtual_network"] = o.VirtualNetwork + } + if !IsNil(o.Vrf) { + toSerialize["vrf"] = o.Vrf + } + if !IsNil(o.Href) { + toSerialize["href"] = o.Href + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfRoute) UnmarshalJSON(bytes []byte) (err error) { + varVrfRoute := _VrfRoute{} + + err = json.Unmarshal(bytes, &varVrfRoute) + + if err != nil { + return err + } + + *o = VrfRoute(varVrfRoute) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "status") + delete(additionalProperties, "prefix") + delete(additionalProperties, "next_hop") + delete(additionalProperties, "type") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "metal_gateway") + delete(additionalProperties, "virtual_network") + delete(additionalProperties, "vrf") + delete(additionalProperties, "href") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfRoute struct { + value *VrfRoute + isSet bool +} + +func (v NullableVrfRoute) Get() *VrfRoute { + return v.value +} + +func (v *NullableVrfRoute) Set(val *VrfRoute) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRoute(val *VrfRoute) *NullableVrfRoute { + return &NullableVrfRoute{value: val, isSet: true} +} + +func (v NullableVrfRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route_create_input.go b/services/metalv1/model_vrf_route_create_input.go new file mode 100644 index 00000000..b4fd5c62 --- /dev/null +++ b/services/metalv1/model_vrf_route_create_input.go @@ -0,0 +1,235 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfRouteCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfRouteCreateInput{} + +// VrfRouteCreateInput struct for VrfRouteCreateInput +type VrfRouteCreateInput struct { + // The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" + Prefix string `json:"prefix"` + // The IPv4 address within the VRF of the host that will handle this route + NextHop string `json:"next_hop"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfRouteCreateInput VrfRouteCreateInput + +// NewVrfRouteCreateInput instantiates a new VrfRouteCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfRouteCreateInput(prefix string, nextHop string) *VrfRouteCreateInput { + this := VrfRouteCreateInput{} + this.Prefix = prefix + this.NextHop = nextHop + return &this +} + +// NewVrfRouteCreateInputWithDefaults instantiates a new VrfRouteCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfRouteCreateInputWithDefaults() *VrfRouteCreateInput { + this := VrfRouteCreateInput{} + return &this +} + +// GetPrefix returns the Prefix field value +func (o *VrfRouteCreateInput) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *VrfRouteCreateInput) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *VrfRouteCreateInput) SetPrefix(v string) { + o.Prefix = v +} + +// GetNextHop returns the NextHop field value +func (o *VrfRouteCreateInput) GetNextHop() string { + if o == nil { + var ret string + return ret + } + + return o.NextHop +} + +// GetNextHopOk returns a tuple with the NextHop field value +// and a boolean to check if the value has been set. +func (o *VrfRouteCreateInput) GetNextHopOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NextHop, true +} + +// SetNextHop sets field value +func (o *VrfRouteCreateInput) SetNextHop(v string) { + o.NextHop = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfRouteCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfRouteCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfRouteCreateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VrfRouteCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfRouteCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["prefix"] = o.Prefix + toSerialize["next_hop"] = o.NextHop + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfRouteCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + "next_hop", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfRouteCreateInput := _VrfRouteCreateInput{} + + err = json.Unmarshal(bytes, &varVrfRouteCreateInput) + + if err != nil { + return err + } + + *o = VrfRouteCreateInput(varVrfRouteCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "next_hop") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfRouteCreateInput struct { + value *VrfRouteCreateInput + isSet bool +} + +func (v NullableVrfRouteCreateInput) Get() *VrfRouteCreateInput { + return v.value +} + +func (v *NullableVrfRouteCreateInput) Set(val *VrfRouteCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRouteCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRouteCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRouteCreateInput(val *VrfRouteCreateInput) *NullableVrfRouteCreateInput { + return &NullableVrfRouteCreateInput{value: val, isSet: true} +} + +func (v NullableVrfRouteCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRouteCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route_list.go b/services/metalv1/model_vrf_route_list.go new file mode 100644 index 00000000..9b380b9d --- /dev/null +++ b/services/metalv1/model_vrf_route_list.go @@ -0,0 +1,191 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfRouteList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfRouteList{} + +// VrfRouteList struct for VrfRouteList +type VrfRouteList struct { + Routes []VrfRoute `json:"routes,omitempty"` + Meta *Meta `json:"meta,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfRouteList VrfRouteList + +// NewVrfRouteList instantiates a new VrfRouteList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfRouteList() *VrfRouteList { + this := VrfRouteList{} + return &this +} + +// NewVrfRouteListWithDefaults instantiates a new VrfRouteList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfRouteListWithDefaults() *VrfRouteList { + this := VrfRouteList{} + return &this +} + +// GetRoutes returns the Routes field value if set, zero value otherwise. +func (o *VrfRouteList) GetRoutes() []VrfRoute { + if o == nil || IsNil(o.Routes) { + var ret []VrfRoute + return ret + } + return o.Routes +} + +// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteList) GetRoutesOk() ([]VrfRoute, bool) { + if o == nil || IsNil(o.Routes) { + return nil, false + } + return o.Routes, true +} + +// HasRoutes returns a boolean if a field has been set. +func (o *VrfRouteList) HasRoutes() bool { + if o != nil && !IsNil(o.Routes) { + return true + } + + return false +} + +// SetRoutes gets a reference to the given []VrfRoute and assigns it to the Routes field. +func (o *VrfRouteList) SetRoutes(v []VrfRoute) { + o.Routes = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *VrfRouteList) GetMeta() Meta { + if o == nil || IsNil(o.Meta) { + var ret Meta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteList) GetMetaOk() (*Meta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *VrfRouteList) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given Meta and assigns it to the Meta field. +func (o *VrfRouteList) SetMeta(v Meta) { + o.Meta = &v +} + +func (o VrfRouteList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfRouteList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Routes) { + toSerialize["routes"] = o.Routes + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfRouteList) UnmarshalJSON(bytes []byte) (err error) { + varVrfRouteList := _VrfRouteList{} + + err = json.Unmarshal(bytes, &varVrfRouteList) + + if err != nil { + return err + } + + *o = VrfRouteList(varVrfRouteList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "routes") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfRouteList struct { + value *VrfRouteList + isSet bool +} + +func (v NullableVrfRouteList) Get() *VrfRouteList { + return v.value +} + +func (v *NullableVrfRouteList) Set(val *VrfRouteList) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRouteList) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRouteList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRouteList(val *VrfRouteList) *NullableVrfRouteList { + return &NullableVrfRouteList{value: val, isSet: true} +} + +func (v NullableVrfRouteList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRouteList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route_status.go b/services/metalv1/model_vrf_route_status.go new file mode 100644 index 00000000..d900dd90 --- /dev/null +++ b/services/metalv1/model_vrf_route_status.go @@ -0,0 +1,115 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VrfRouteStatus The status of the route. Potential values are \"pending\", \"active\", \"deleting\", and \"error\", representing various lifecycle states of the route and whether or not it has been successfully configured on the network +type VrfRouteStatus string + +// List of VrfRoute_status +const ( + VRFROUTESTATUS_PENDING VrfRouteStatus = "pending" + VRFROUTESTATUS_ACTIVE VrfRouteStatus = "active" + VRFROUTESTATUS_DELETING VrfRouteStatus = "deleting" + VRFROUTESTATUS_ERROR VrfRouteStatus = "error" +) + +// All allowed values of VrfRouteStatus enum +var AllowedVrfRouteStatusEnumValues = []VrfRouteStatus{ + "pending", + "active", + "deleting", + "error", +} + +func (v *VrfRouteStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VrfRouteStatus(value) + for _, existing := range AllowedVrfRouteStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VrfRouteStatus", value) +} + +// NewVrfRouteStatusFromValue returns a pointer to a valid VrfRouteStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVrfRouteStatusFromValue(v string) (*VrfRouteStatus, error) { + ev := VrfRouteStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VrfRouteStatus: valid values are %v", v, AllowedVrfRouteStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VrfRouteStatus) IsValid() bool { + for _, existing := range AllowedVrfRouteStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VrfRoute_status value +func (v VrfRouteStatus) Ptr() *VrfRouteStatus { + return &v +} + +type NullableVrfRouteStatus struct { + value *VrfRouteStatus + isSet bool +} + +func (v NullableVrfRouteStatus) Get() *VrfRouteStatus { + return v.value +} + +func (v *NullableVrfRouteStatus) Set(val *VrfRouteStatus) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRouteStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRouteStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRouteStatus(val *VrfRouteStatus) *NullableVrfRouteStatus { + return &NullableVrfRouteStatus{value: val, isSet: true} +} + +func (v NullableVrfRouteStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRouteStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route_type.go b/services/metalv1/model_vrf_route_type.go new file mode 100644 index 00000000..6d255826 --- /dev/null +++ b/services/metalv1/model_vrf_route_type.go @@ -0,0 +1,109 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VrfRouteType VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported +type VrfRouteType string + +// List of VrfRoute_type +const ( + VRFROUTETYPE_STATIC VrfRouteType = "static" +) + +// All allowed values of VrfRouteType enum +var AllowedVrfRouteTypeEnumValues = []VrfRouteType{ + "static", +} + +func (v *VrfRouteType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VrfRouteType(value) + for _, existing := range AllowedVrfRouteTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VrfRouteType", value) +} + +// NewVrfRouteTypeFromValue returns a pointer to a valid VrfRouteType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVrfRouteTypeFromValue(v string) (*VrfRouteType, error) { + ev := VrfRouteType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VrfRouteType: valid values are %v", v, AllowedVrfRouteTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VrfRouteType) IsValid() bool { + for _, existing := range AllowedVrfRouteTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VrfRoute_type value +func (v VrfRouteType) Ptr() *VrfRouteType { + return &v +} + +type NullableVrfRouteType struct { + value *VrfRouteType + isSet bool +} + +func (v NullableVrfRouteType) Get() *VrfRouteType { + return v.value +} + +func (v *NullableVrfRouteType) Set(val *VrfRouteType) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRouteType) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRouteType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRouteType(val *VrfRouteType) *NullableVrfRouteType { + return &NullableVrfRouteType{value: val, isSet: true} +} + +func (v NullableVrfRouteType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRouteType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_route_update_input.go b/services/metalv1/model_vrf_route_update_input.go new file mode 100644 index 00000000..74236dd8 --- /dev/null +++ b/services/metalv1/model_vrf_route_update_input.go @@ -0,0 +1,230 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfRouteUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfRouteUpdateInput{} + +// VrfRouteUpdateInput struct for VrfRouteUpdateInput +type VrfRouteUpdateInput struct { + // The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be \"0.0.0.0/0\" + Prefix *string `json:"prefix,omitempty"` + // The IPv4 address within the VRF of the host that will handle this route + NextHop *string `json:"next_hop,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfRouteUpdateInput VrfRouteUpdateInput + +// NewVrfRouteUpdateInput instantiates a new VrfRouteUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfRouteUpdateInput() *VrfRouteUpdateInput { + this := VrfRouteUpdateInput{} + return &this +} + +// NewVrfRouteUpdateInputWithDefaults instantiates a new VrfRouteUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfRouteUpdateInputWithDefaults() *VrfRouteUpdateInput { + this := VrfRouteUpdateInput{} + return &this +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *VrfRouteUpdateInput) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteUpdateInput) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *VrfRouteUpdateInput) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *VrfRouteUpdateInput) SetPrefix(v string) { + o.Prefix = &v +} + +// GetNextHop returns the NextHop field value if set, zero value otherwise. +func (o *VrfRouteUpdateInput) GetNextHop() string { + if o == nil || IsNil(o.NextHop) { + var ret string + return ret + } + return *o.NextHop +} + +// GetNextHopOk returns a tuple with the NextHop field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteUpdateInput) GetNextHopOk() (*string, bool) { + if o == nil || IsNil(o.NextHop) { + return nil, false + } + return o.NextHop, true +} + +// HasNextHop returns a boolean if a field has been set. +func (o *VrfRouteUpdateInput) HasNextHop() bool { + if o != nil && !IsNil(o.NextHop) { + return true + } + + return false +} + +// SetNextHop gets a reference to the given string and assigns it to the NextHop field. +func (o *VrfRouteUpdateInput) SetNextHop(v string) { + o.NextHop = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfRouteUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfRouteUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfRouteUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfRouteUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VrfRouteUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfRouteUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.NextHop) { + toSerialize["next_hop"] = o.NextHop + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfRouteUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varVrfRouteUpdateInput := _VrfRouteUpdateInput{} + + err = json.Unmarshal(bytes, &varVrfRouteUpdateInput) + + if err != nil { + return err + } + + *o = VrfRouteUpdateInput(varVrfRouteUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "next_hop") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfRouteUpdateInput struct { + value *VrfRouteUpdateInput + isSet bool +} + +func (v NullableVrfRouteUpdateInput) Get() *VrfRouteUpdateInput { + return v.value +} + +func (v *NullableVrfRouteUpdateInput) Set(val *VrfRouteUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfRouteUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfRouteUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfRouteUpdateInput(val *VrfRouteUpdateInput) *NullableVrfRouteUpdateInput { + return &NullableVrfRouteUpdateInput{value: val, isSet: true} +} + +func (v NullableVrfRouteUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfRouteUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_update_input.go b/services/metalv1/model_vrf_update_input.go new file mode 100644 index 00000000..3370d0b3 --- /dev/null +++ b/services/metalv1/model_vrf_update_input.go @@ -0,0 +1,418 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfUpdateInput{} + +// VrfUpdateInput struct for VrfUpdateInput +type VrfUpdateInput struct { + // Toggle to enable the dynamic bgp neighbors feature on the VRF + BgpDynamicNeighborsEnabled *bool `json:"bgp_dynamic_neighbors_enabled,omitempty"` + // Toggle to export the VRF route-map to the dynamic bgp neighbors + BgpDynamicNeighborsExportRouteMap *bool `json:"bgp_dynamic_neighbors_export_route_map,omitempty"` + // Toggle BFD on dynamic bgp neighbors sessions + BgpDynamicNeighborsBfdEnabled *bool `json:"bgp_dynamic_neighbors_bfd_enabled,omitempty"` + Description *string `json:"description,omitempty"` + // A list of CIDR network addresses. Like [\"10.0.0.0/16\", \"2001:d78::/56\"]. IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. A VRF\\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\\'s associated Metal Gateways or Virtual Circuits. If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. Specifying a value of `[]` will remove all existing IP Ranges from the VRF. + IpRanges []string `json:"ip_ranges,omitempty"` + // The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. + LocalAsn *int32 `json:"local_asn,omitempty"` + Name *string `json:"name,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfUpdateInput VrfUpdateInput + +// NewVrfUpdateInput instantiates a new VrfUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfUpdateInput() *VrfUpdateInput { + this := VrfUpdateInput{} + return &this +} + +// NewVrfUpdateInputWithDefaults instantiates a new VrfUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfUpdateInputWithDefaults() *VrfUpdateInput { + this := VrfUpdateInput{} + return &this +} + +// GetBgpDynamicNeighborsEnabled returns the BgpDynamicNeighborsEnabled field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsEnabled +} + +// GetBgpDynamicNeighborsEnabledOk returns a tuple with the BgpDynamicNeighborsEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsEnabled, true +} + +// HasBgpDynamicNeighborsEnabled returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasBgpDynamicNeighborsEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsEnabled field. +func (o *VrfUpdateInput) SetBgpDynamicNeighborsEnabled(v bool) { + o.BgpDynamicNeighborsEnabled = &v +} + +// GetBgpDynamicNeighborsExportRouteMap returns the BgpDynamicNeighborsExportRouteMap field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsExportRouteMap() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsExportRouteMap +} + +// GetBgpDynamicNeighborsExportRouteMapOk returns a tuple with the BgpDynamicNeighborsExportRouteMap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsExportRouteMapOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return nil, false + } + return o.BgpDynamicNeighborsExportRouteMap, true +} + +// HasBgpDynamicNeighborsExportRouteMap returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasBgpDynamicNeighborsExportRouteMap() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsExportRouteMap gets a reference to the given bool and assigns it to the BgpDynamicNeighborsExportRouteMap field. +func (o *VrfUpdateInput) SetBgpDynamicNeighborsExportRouteMap(v bool) { + o.BgpDynamicNeighborsExportRouteMap = &v +} + +// GetBgpDynamicNeighborsBfdEnabled returns the BgpDynamicNeighborsBfdEnabled field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsBfdEnabled() bool { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + var ret bool + return ret + } + return *o.BgpDynamicNeighborsBfdEnabled +} + +// GetBgpDynamicNeighborsBfdEnabledOk returns a tuple with the BgpDynamicNeighborsBfdEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetBgpDynamicNeighborsBfdEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return nil, false + } + return o.BgpDynamicNeighborsBfdEnabled, true +} + +// HasBgpDynamicNeighborsBfdEnabled returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasBgpDynamicNeighborsBfdEnabled() bool { + if o != nil && !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + return true + } + + return false +} + +// SetBgpDynamicNeighborsBfdEnabled gets a reference to the given bool and assigns it to the BgpDynamicNeighborsBfdEnabled field. +func (o *VrfUpdateInput) SetBgpDynamicNeighborsBfdEnabled(v bool) { + o.BgpDynamicNeighborsBfdEnabled = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetIpRanges returns the IpRanges field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetIpRanges() []string { + if o == nil || IsNil(o.IpRanges) { + var ret []string + return ret + } + return o.IpRanges +} + +// GetIpRangesOk returns a tuple with the IpRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetIpRangesOk() ([]string, bool) { + if o == nil || IsNil(o.IpRanges) { + return nil, false + } + return o.IpRanges, true +} + +// HasIpRanges returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasIpRanges() bool { + if o != nil && !IsNil(o.IpRanges) { + return true + } + + return false +} + +// SetIpRanges gets a reference to the given []string and assigns it to the IpRanges field. +func (o *VrfUpdateInput) SetIpRanges(v []string) { + o.IpRanges = v +} + +// GetLocalAsn returns the LocalAsn field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetLocalAsn() int32 { + if o == nil || IsNil(o.LocalAsn) { + var ret int32 + return ret + } + return *o.LocalAsn +} + +// GetLocalAsnOk returns a tuple with the LocalAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetLocalAsnOk() (*int32, bool) { + if o == nil || IsNil(o.LocalAsn) { + return nil, false + } + return o.LocalAsn, true +} + +// HasLocalAsn returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasLocalAsn() bool { + if o != nil && !IsNil(o.LocalAsn) { + return true + } + + return false +} + +// SetLocalAsn gets a reference to the given int32 and assigns it to the LocalAsn field. +func (o *VrfUpdateInput) SetLocalAsn(v int32) { + o.LocalAsn = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VrfUpdateInput) SetName(v string) { + o.Name = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VrfUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BgpDynamicNeighborsEnabled) { + toSerialize["bgp_dynamic_neighbors_enabled"] = o.BgpDynamicNeighborsEnabled + } + if !IsNil(o.BgpDynamicNeighborsExportRouteMap) { + toSerialize["bgp_dynamic_neighbors_export_route_map"] = o.BgpDynamicNeighborsExportRouteMap + } + if !IsNil(o.BgpDynamicNeighborsBfdEnabled) { + toSerialize["bgp_dynamic_neighbors_bfd_enabled"] = o.BgpDynamicNeighborsBfdEnabled + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.IpRanges) { + toSerialize["ip_ranges"] = o.IpRanges + } + if !IsNil(o.LocalAsn) { + toSerialize["local_asn"] = o.LocalAsn + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varVrfUpdateInput := _VrfUpdateInput{} + + err = json.Unmarshal(bytes, &varVrfUpdateInput) + + if err != nil { + return err + } + + *o = VrfUpdateInput(varVrfUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bgp_dynamic_neighbors_enabled") + delete(additionalProperties, "bgp_dynamic_neighbors_export_route_map") + delete(additionalProperties, "bgp_dynamic_neighbors_bfd_enabled") + delete(additionalProperties, "description") + delete(additionalProperties, "ip_ranges") + delete(additionalProperties, "local_asn") + delete(additionalProperties, "name") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfUpdateInput struct { + value *VrfUpdateInput + isSet bool +} + +func (v NullableVrfUpdateInput) Get() *VrfUpdateInput { + return v.value +} + +func (v *NullableVrfUpdateInput) Set(val *VrfUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfUpdateInput(val *VrfUpdateInput) *NullableVrfUpdateInput { + return &NullableVrfUpdateInput{value: val, isSet: true} +} + +func (v NullableVrfUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_virtual_circuit.go b/services/metalv1/model_vrf_virtual_circuit.go new file mode 100644 index 00000000..111d9786 --- /dev/null +++ b/services/metalv1/model_vrf_virtual_circuit.go @@ -0,0 +1,803 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VrfVirtualCircuit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfVirtualCircuit{} + +// VrfVirtualCircuit struct for VrfVirtualCircuit +type VrfVirtualCircuit struct { + // An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. + CustomerIp *string `json:"customer_ip,omitempty"` + Description *string `json:"description,omitempty"` + Id *string `json:"id,omitempty"` + // The MD5 password for the BGP peering in plaintext (not a checksum). + Md5 *string `json:"md5,omitempty"` + // An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. + MetalIp *string `json:"metal_ip,omitempty"` + Name *string `json:"name,omitempty"` + Port *Href `json:"port,omitempty"` + NniVlan *int32 `json:"nni_vlan,omitempty"` + // The peer ASN that will be used with the VRF on the Virtual Circuit. + PeerAsn *int32 `json:"peer_asn,omitempty"` + Project *Href `json:"project,omitempty"` + // integer representing bps speed + Speed *int32 `json:"speed,omitempty"` + Status *VrfVirtualCircuitStatus `json:"status,omitempty"` + // The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. + Subnet *string `json:"subnet,omitempty"` + Tags []string `json:"tags,omitempty"` + Type *VrfIpReservationType `json:"type,omitempty"` + Vrf Vrf `json:"vrf"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfVirtualCircuit VrfVirtualCircuit + +// NewVrfVirtualCircuit instantiates a new VrfVirtualCircuit object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfVirtualCircuit(vrf Vrf) *VrfVirtualCircuit { + this := VrfVirtualCircuit{} + this.Vrf = vrf + return &this +} + +// NewVrfVirtualCircuitWithDefaults instantiates a new VrfVirtualCircuit object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfVirtualCircuitWithDefaults() *VrfVirtualCircuit { + this := VrfVirtualCircuit{} + return &this +} + +// GetCustomerIp returns the CustomerIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetCustomerIp() string { + if o == nil || IsNil(o.CustomerIp) { + var ret string + return ret + } + return *o.CustomerIp +} + +// GetCustomerIpOk returns a tuple with the CustomerIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetCustomerIpOk() (*string, bool) { + if o == nil || IsNil(o.CustomerIp) { + return nil, false + } + return o.CustomerIp, true +} + +// HasCustomerIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasCustomerIp() bool { + if o != nil && !IsNil(o.CustomerIp) { + return true + } + + return false +} + +// SetCustomerIp gets a reference to the given string and assigns it to the CustomerIp field. +func (o *VrfVirtualCircuit) SetCustomerIp(v string) { + o.CustomerIp = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfVirtualCircuit) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *VrfVirtualCircuit) SetId(v string) { + o.Id = &v +} + +// GetMd5 returns the Md5 field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetMd5() string { + if o == nil || IsNil(o.Md5) { + var ret string + return ret + } + return *o.Md5 +} + +// GetMd5Ok returns a tuple with the Md5 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetMd5Ok() (*string, bool) { + if o == nil || IsNil(o.Md5) { + return nil, false + } + return o.Md5, true +} + +// HasMd5 returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasMd5() bool { + if o != nil && !IsNil(o.Md5) { + return true + } + + return false +} + +// SetMd5 gets a reference to the given string and assigns it to the Md5 field. +func (o *VrfVirtualCircuit) SetMd5(v string) { + o.Md5 = &v +} + +// GetMetalIp returns the MetalIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetMetalIp() string { + if o == nil || IsNil(o.MetalIp) { + var ret string + return ret + } + return *o.MetalIp +} + +// GetMetalIpOk returns a tuple with the MetalIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetMetalIpOk() (*string, bool) { + if o == nil || IsNil(o.MetalIp) { + return nil, false + } + return o.MetalIp, true +} + +// HasMetalIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasMetalIp() bool { + if o != nil && !IsNil(o.MetalIp) { + return true + } + + return false +} + +// SetMetalIp gets a reference to the given string and assigns it to the MetalIp field. +func (o *VrfVirtualCircuit) SetMetalIp(v string) { + o.MetalIp = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VrfVirtualCircuit) SetName(v string) { + o.Name = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetPort() Href { + if o == nil || IsNil(o.Port) { + var ret Href + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetPortOk() (*Href, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given Href and assigns it to the Port field. +func (o *VrfVirtualCircuit) SetPort(v Href) { + o.Port = &v +} + +// GetNniVlan returns the NniVlan field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetNniVlan() int32 { + if o == nil || IsNil(o.NniVlan) { + var ret int32 + return ret + } + return *o.NniVlan +} + +// GetNniVlanOk returns a tuple with the NniVlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetNniVlanOk() (*int32, bool) { + if o == nil || IsNil(o.NniVlan) { + return nil, false + } + return o.NniVlan, true +} + +// HasNniVlan returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasNniVlan() bool { + if o != nil && !IsNil(o.NniVlan) { + return true + } + + return false +} + +// SetNniVlan gets a reference to the given int32 and assigns it to the NniVlan field. +func (o *VrfVirtualCircuit) SetNniVlan(v int32) { + o.NniVlan = &v +} + +// GetPeerAsn returns the PeerAsn field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetPeerAsn() int32 { + if o == nil || IsNil(o.PeerAsn) { + var ret int32 + return ret + } + return *o.PeerAsn +} + +// GetPeerAsnOk returns a tuple with the PeerAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetPeerAsnOk() (*int32, bool) { + if o == nil || IsNil(o.PeerAsn) { + return nil, false + } + return o.PeerAsn, true +} + +// HasPeerAsn returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasPeerAsn() bool { + if o != nil && !IsNil(o.PeerAsn) { + return true + } + + return false +} + +// SetPeerAsn gets a reference to the given int32 and assigns it to the PeerAsn field. +func (o *VrfVirtualCircuit) SetPeerAsn(v int32) { + o.PeerAsn = &v +} + +// GetProject returns the Project field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetProject() Href { + if o == nil || IsNil(o.Project) { + var ret Href + return ret + } + return *o.Project +} + +// GetProjectOk returns a tuple with the Project field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetProjectOk() (*Href, bool) { + if o == nil || IsNil(o.Project) { + return nil, false + } + return o.Project, true +} + +// HasProject returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasProject() bool { + if o != nil && !IsNil(o.Project) { + return true + } + + return false +} + +// SetProject gets a reference to the given Href and assigns it to the Project field. +func (o *VrfVirtualCircuit) SetProject(v Href) { + o.Project = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VrfVirtualCircuit) SetSpeed(v int32) { + o.Speed = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetStatus() VrfVirtualCircuitStatus { + if o == nil || IsNil(o.Status) { + var ret VrfVirtualCircuitStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetStatusOk() (*VrfVirtualCircuitStatus, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given VrfVirtualCircuitStatus and assigns it to the Status field. +func (o *VrfVirtualCircuit) SetStatus(v VrfVirtualCircuitStatus) { + o.Status = &v +} + +// GetSubnet returns the Subnet field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetSubnet() string { + if o == nil || IsNil(o.Subnet) { + var ret string + return ret + } + return *o.Subnet +} + +// GetSubnetOk returns a tuple with the Subnet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetSubnetOk() (*string, bool) { + if o == nil || IsNil(o.Subnet) { + return nil, false + } + return o.Subnet, true +} + +// HasSubnet returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasSubnet() bool { + if o != nil && !IsNil(o.Subnet) { + return true + } + + return false +} + +// SetSubnet gets a reference to the given string and assigns it to the Subnet field. +func (o *VrfVirtualCircuit) SetSubnet(v string) { + o.Subnet = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfVirtualCircuit) SetTags(v []string) { + o.Tags = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetType() VrfIpReservationType { + if o == nil || IsNil(o.Type) { + var ret VrfIpReservationType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetTypeOk() (*VrfIpReservationType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given VrfIpReservationType and assigns it to the Type field. +func (o *VrfVirtualCircuit) SetType(v VrfIpReservationType) { + o.Type = &v +} + +// GetVrf returns the Vrf field value +func (o *VrfVirtualCircuit) GetVrf() Vrf { + if o == nil { + var ret Vrf + return ret + } + + return o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetVrfOk() (*Vrf, bool) { + if o == nil { + return nil, false + } + return &o.Vrf, true +} + +// SetVrf sets field value +func (o *VrfVirtualCircuit) SetVrf(v Vrf) { + o.Vrf = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *VrfVirtualCircuit) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *VrfVirtualCircuit) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuit) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *VrfVirtualCircuit) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *VrfVirtualCircuit) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o VrfVirtualCircuit) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfVirtualCircuit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomerIp) { + toSerialize["customer_ip"] = o.CustomerIp + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Md5) { + toSerialize["md5"] = o.Md5 + } + if !IsNil(o.MetalIp) { + toSerialize["metal_ip"] = o.MetalIp + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.NniVlan) { + toSerialize["nni_vlan"] = o.NniVlan + } + if !IsNil(o.PeerAsn) { + toSerialize["peer_asn"] = o.PeerAsn + } + if !IsNil(o.Project) { + toSerialize["project"] = o.Project + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Subnet) { + toSerialize["subnet"] = o.Subnet + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + toSerialize["vrf"] = o.Vrf + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfVirtualCircuit) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "vrf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfVirtualCircuit := _VrfVirtualCircuit{} + + err = json.Unmarshal(bytes, &varVrfVirtualCircuit) + + if err != nil { + return err + } + + *o = VrfVirtualCircuit(varVrfVirtualCircuit) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customer_ip") + delete(additionalProperties, "description") + delete(additionalProperties, "id") + delete(additionalProperties, "md5") + delete(additionalProperties, "metal_ip") + delete(additionalProperties, "name") + delete(additionalProperties, "port") + delete(additionalProperties, "nni_vlan") + delete(additionalProperties, "peer_asn") + delete(additionalProperties, "project") + delete(additionalProperties, "speed") + delete(additionalProperties, "status") + delete(additionalProperties, "subnet") + delete(additionalProperties, "tags") + delete(additionalProperties, "type") + delete(additionalProperties, "vrf") + delete(additionalProperties, "created_at") + delete(additionalProperties, "updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfVirtualCircuit struct { + value *VrfVirtualCircuit + isSet bool +} + +func (v NullableVrfVirtualCircuit) Get() *VrfVirtualCircuit { + return v.value +} + +func (v *NullableVrfVirtualCircuit) Set(val *VrfVirtualCircuit) { + v.value = val + v.isSet = true +} + +func (v NullableVrfVirtualCircuit) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfVirtualCircuit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfVirtualCircuit(val *VrfVirtualCircuit) *NullableVrfVirtualCircuit { + return &NullableVrfVirtualCircuit{value: val, isSet: true} +} + +func (v NullableVrfVirtualCircuit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfVirtualCircuit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_virtual_circuit_create_input.go b/services/metalv1/model_vrf_virtual_circuit_create_input.go new file mode 100644 index 00000000..59c9099f --- /dev/null +++ b/services/metalv1/model_vrf_virtual_circuit_create_input.go @@ -0,0 +1,560 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// checks if the VrfVirtualCircuitCreateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfVirtualCircuitCreateInput{} + +// VrfVirtualCircuitCreateInput struct for VrfVirtualCircuitCreateInput +type VrfVirtualCircuitCreateInput struct { + // An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. + CustomerIp *string `json:"customer_ip,omitempty"` + Description *string `json:"description,omitempty"` + // The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character + Md5 NullableString `json:"md5,omitempty"` + // An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. + MetalIp *string `json:"metal_ip,omitempty"` + Name *string `json:"name,omitempty"` + NniVlan int32 `json:"nni_vlan"` + // The peer ASN that will be used with the VRF on the Virtual Circuit. + PeerAsn int32 `json:"peer_asn"` + ProjectId string `json:"project_id"` + // speed can be passed as integer number representing bps speed or string (e.g. '52m' or '100g' or '4 gbps') + Speed *int32 `json:"speed,omitempty"` + // The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. The subnet specified must be contained within an already-defined IP Range for the VRF. + Subnet string `json:"subnet"` + Tags []string `json:"tags,omitempty"` + // The UUID of the VRF that will be associated with the Virtual Circuit. + Vrf string `json:"vrf"` + AdditionalProperties map[string]interface{} +} + +type _VrfVirtualCircuitCreateInput VrfVirtualCircuitCreateInput + +// NewVrfVirtualCircuitCreateInput instantiates a new VrfVirtualCircuitCreateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfVirtualCircuitCreateInput(nniVlan int32, peerAsn int32, projectId string, subnet string, vrf string) *VrfVirtualCircuitCreateInput { + this := VrfVirtualCircuitCreateInput{} + this.NniVlan = nniVlan + this.PeerAsn = peerAsn + this.ProjectId = projectId + this.Subnet = subnet + this.Vrf = vrf + return &this +} + +// NewVrfVirtualCircuitCreateInputWithDefaults instantiates a new VrfVirtualCircuitCreateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfVirtualCircuitCreateInputWithDefaults() *VrfVirtualCircuitCreateInput { + this := VrfVirtualCircuitCreateInput{} + return &this +} + +// GetCustomerIp returns the CustomerIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetCustomerIp() string { + if o == nil || IsNil(o.CustomerIp) { + var ret string + return ret + } + return *o.CustomerIp +} + +// GetCustomerIpOk returns a tuple with the CustomerIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetCustomerIpOk() (*string, bool) { + if o == nil || IsNil(o.CustomerIp) { + return nil, false + } + return o.CustomerIp, true +} + +// HasCustomerIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasCustomerIp() bool { + if o != nil && !IsNil(o.CustomerIp) { + return true + } + + return false +} + +// SetCustomerIp gets a reference to the given string and assigns it to the CustomerIp field. +func (o *VrfVirtualCircuitCreateInput) SetCustomerIp(v string) { + o.CustomerIp = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfVirtualCircuitCreateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMd5 returns the Md5 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *VrfVirtualCircuitCreateInput) GetMd5() string { + if o == nil || IsNil(o.Md5.Get()) { + var ret string + return ret + } + return *o.Md5.Get() +} + +// GetMd5Ok returns a tuple with the Md5 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *VrfVirtualCircuitCreateInput) GetMd5Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.Md5.Get(), o.Md5.IsSet() +} + +// HasMd5 returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasMd5() bool { + if o != nil && o.Md5.IsSet() { + return true + } + + return false +} + +// SetMd5 gets a reference to the given NullableString and assigns it to the Md5 field. +func (o *VrfVirtualCircuitCreateInput) SetMd5(v string) { + o.Md5.Set(&v) +} + +// SetMd5Nil sets the value for Md5 to be an explicit nil +func (o *VrfVirtualCircuitCreateInput) SetMd5Nil() { + o.Md5.Set(nil) +} + +// UnsetMd5 ensures that no value is present for Md5, not even an explicit nil +func (o *VrfVirtualCircuitCreateInput) UnsetMd5() { + o.Md5.Unset() +} + +// GetMetalIp returns the MetalIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetMetalIp() string { + if o == nil || IsNil(o.MetalIp) { + var ret string + return ret + } + return *o.MetalIp +} + +// GetMetalIpOk returns a tuple with the MetalIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetMetalIpOk() (*string, bool) { + if o == nil || IsNil(o.MetalIp) { + return nil, false + } + return o.MetalIp, true +} + +// HasMetalIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasMetalIp() bool { + if o != nil && !IsNil(o.MetalIp) { + return true + } + + return false +} + +// SetMetalIp gets a reference to the given string and assigns it to the MetalIp field. +func (o *VrfVirtualCircuitCreateInput) SetMetalIp(v string) { + o.MetalIp = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VrfVirtualCircuitCreateInput) SetName(v string) { + o.Name = &v +} + +// GetNniVlan returns the NniVlan field value +func (o *VrfVirtualCircuitCreateInput) GetNniVlan() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NniVlan +} + +// GetNniVlanOk returns a tuple with the NniVlan field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetNniVlanOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NniVlan, true +} + +// SetNniVlan sets field value +func (o *VrfVirtualCircuitCreateInput) SetNniVlan(v int32) { + o.NniVlan = v +} + +// GetPeerAsn returns the PeerAsn field value +func (o *VrfVirtualCircuitCreateInput) GetPeerAsn() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.PeerAsn +} + +// GetPeerAsnOk returns a tuple with the PeerAsn field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetPeerAsnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.PeerAsn, true +} + +// SetPeerAsn sets field value +func (o *VrfVirtualCircuitCreateInput) SetPeerAsn(v int32) { + o.PeerAsn = v +} + +// GetProjectId returns the ProjectId field value +func (o *VrfVirtualCircuitCreateInput) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *VrfVirtualCircuitCreateInput) SetProjectId(v string) { + o.ProjectId = v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetSpeed() int32 { + if o == nil || IsNil(o.Speed) { + var ret int32 + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetSpeedOk() (*int32, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given int32 and assigns it to the Speed field. +func (o *VrfVirtualCircuitCreateInput) SetSpeed(v int32) { + o.Speed = &v +} + +// GetSubnet returns the Subnet field value +func (o *VrfVirtualCircuitCreateInput) GetSubnet() string { + if o == nil { + var ret string + return ret + } + + return o.Subnet +} + +// GetSubnetOk returns a tuple with the Subnet field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetSubnetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Subnet, true +} + +// SetSubnet sets field value +func (o *VrfVirtualCircuitCreateInput) SetSubnet(v string) { + o.Subnet = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfVirtualCircuitCreateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfVirtualCircuitCreateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfVirtualCircuitCreateInput) SetTags(v []string) { + o.Tags = v +} + +// GetVrf returns the Vrf field value +func (o *VrfVirtualCircuitCreateInput) GetVrf() string { + if o == nil { + var ret string + return ret + } + + return o.Vrf +} + +// GetVrfOk returns a tuple with the Vrf field value +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitCreateInput) GetVrfOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Vrf, true +} + +// SetVrf sets field value +func (o *VrfVirtualCircuitCreateInput) SetVrf(v string) { + o.Vrf = v +} + +func (o VrfVirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfVirtualCircuitCreateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomerIp) { + toSerialize["customer_ip"] = o.CustomerIp + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Md5.IsSet() { + toSerialize["md5"] = o.Md5.Get() + } + if !IsNil(o.MetalIp) { + toSerialize["metal_ip"] = o.MetalIp + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["nni_vlan"] = o.NniVlan + toSerialize["peer_asn"] = o.PeerAsn + toSerialize["project_id"] = o.ProjectId + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + toSerialize["subnet"] = o.Subnet + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + toSerialize["vrf"] = o.Vrf + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfVirtualCircuitCreateInput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "nni_vlan", + "peer_asn", + "project_id", + "subnet", + "vrf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVrfVirtualCircuitCreateInput := _VrfVirtualCircuitCreateInput{} + + err = json.Unmarshal(bytes, &varVrfVirtualCircuitCreateInput) + + if err != nil { + return err + } + + *o = VrfVirtualCircuitCreateInput(varVrfVirtualCircuitCreateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customer_ip") + delete(additionalProperties, "description") + delete(additionalProperties, "md5") + delete(additionalProperties, "metal_ip") + delete(additionalProperties, "name") + delete(additionalProperties, "nni_vlan") + delete(additionalProperties, "peer_asn") + delete(additionalProperties, "project_id") + delete(additionalProperties, "speed") + delete(additionalProperties, "subnet") + delete(additionalProperties, "tags") + delete(additionalProperties, "vrf") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfVirtualCircuitCreateInput struct { + value *VrfVirtualCircuitCreateInput + isSet bool +} + +func (v NullableVrfVirtualCircuitCreateInput) Get() *VrfVirtualCircuitCreateInput { + return v.value +} + +func (v *NullableVrfVirtualCircuitCreateInput) Set(val *VrfVirtualCircuitCreateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfVirtualCircuitCreateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfVirtualCircuitCreateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfVirtualCircuitCreateInput(val *VrfVirtualCircuitCreateInput) *NullableVrfVirtualCircuitCreateInput { + return &NullableVrfVirtualCircuitCreateInput{value: val, isSet: true} +} + +func (v NullableVrfVirtualCircuitCreateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfVirtualCircuitCreateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_virtual_circuit_status.go b/services/metalv1/model_vrf_virtual_circuit_status.go new file mode 100644 index 00000000..f1a91bc9 --- /dev/null +++ b/services/metalv1/model_vrf_virtual_circuit_status.go @@ -0,0 +1,131 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "fmt" +) + +// VrfVirtualCircuitStatus The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF Virtual Circuit has any of its peering details updated. +type VrfVirtualCircuitStatus string + +// List of VrfVirtualCircuit_status +const ( + VRFVIRTUALCIRCUITSTATUS_PENDING VrfVirtualCircuitStatus = "pending" + VRFVIRTUALCIRCUITSTATUS_WAITING_ON_PEERING_DETAILS VrfVirtualCircuitStatus = "waiting_on_peering_details" + VRFVIRTUALCIRCUITSTATUS_ACTIVATING VrfVirtualCircuitStatus = "activating" + VRFVIRTUALCIRCUITSTATUS_CHANGING_PEERING_DETAILS VrfVirtualCircuitStatus = "changing_peering_details" + VRFVIRTUALCIRCUITSTATUS_DEACTIVATING VrfVirtualCircuitStatus = "deactivating" + VRFVIRTUALCIRCUITSTATUS_DELETING VrfVirtualCircuitStatus = "deleting" + VRFVIRTUALCIRCUITSTATUS_ACTIVE VrfVirtualCircuitStatus = "active" + VRFVIRTUALCIRCUITSTATUS_EXPIRED VrfVirtualCircuitStatus = "expired" + VRFVIRTUALCIRCUITSTATUS_ACTIVATION_FAILED VrfVirtualCircuitStatus = "activation_failed" + VRFVIRTUALCIRCUITSTATUS_CHANGING_PEERING_DETAILS_FAILED VrfVirtualCircuitStatus = "changing_peering_details_failed" + VRFVIRTUALCIRCUITSTATUS_DEACTIVATION_FAILED VrfVirtualCircuitStatus = "deactivation_failed" + VRFVIRTUALCIRCUITSTATUS_DELETE_FAILED VrfVirtualCircuitStatus = "delete_failed" +) + +// All allowed values of VrfVirtualCircuitStatus enum +var AllowedVrfVirtualCircuitStatusEnumValues = []VrfVirtualCircuitStatus{ + "pending", + "waiting_on_peering_details", + "activating", + "changing_peering_details", + "deactivating", + "deleting", + "active", + "expired", + "activation_failed", + "changing_peering_details_failed", + "deactivation_failed", + "delete_failed", +} + +func (v *VrfVirtualCircuitStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VrfVirtualCircuitStatus(value) + for _, existing := range AllowedVrfVirtualCircuitStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VrfVirtualCircuitStatus", value) +} + +// NewVrfVirtualCircuitStatusFromValue returns a pointer to a valid VrfVirtualCircuitStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVrfVirtualCircuitStatusFromValue(v string) (*VrfVirtualCircuitStatus, error) { + ev := VrfVirtualCircuitStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VrfVirtualCircuitStatus: valid values are %v", v, AllowedVrfVirtualCircuitStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VrfVirtualCircuitStatus) IsValid() bool { + for _, existing := range AllowedVrfVirtualCircuitStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VrfVirtualCircuit_status value +func (v VrfVirtualCircuitStatus) Ptr() *VrfVirtualCircuitStatus { + return &v +} + +type NullableVrfVirtualCircuitStatus struct { + value *VrfVirtualCircuitStatus + isSet bool +} + +func (v NullableVrfVirtualCircuitStatus) Get() *VrfVirtualCircuitStatus { + return v.value +} + +func (v *NullableVrfVirtualCircuitStatus) Set(val *VrfVirtualCircuitStatus) { + v.value = val + v.isSet = true +} + +func (v NullableVrfVirtualCircuitStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfVirtualCircuitStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfVirtualCircuitStatus(val *VrfVirtualCircuitStatus) *NullableVrfVirtualCircuitStatus { + return &NullableVrfVirtualCircuitStatus{value: val, isSet: true} +} + +func (v NullableVrfVirtualCircuitStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfVirtualCircuitStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/model_vrf_virtual_circuit_update_input.go b/services/metalv1/model_vrf_virtual_circuit_update_input.go new file mode 100644 index 00000000..53a72ffd --- /dev/null +++ b/services/metalv1/model_vrf_virtual_circuit_update_input.go @@ -0,0 +1,456 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" +) + +// checks if the VrfVirtualCircuitUpdateInput type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VrfVirtualCircuitUpdateInput{} + +// VrfVirtualCircuitUpdateInput struct for VrfVirtualCircuitUpdateInput +type VrfVirtualCircuitUpdateInput struct { + // An IP address from the subnet that will be used on the Customer side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used. + CustomerIp *string `json:"customer_ip,omitempty"` + Description *string `json:"description,omitempty"` + // The plaintext BGP peering password shared by neighbors as an MD5 checksum: * must be 10-20 characters long * may not include punctuation * must be a combination of numbers and letters * must contain at least one lowercase, uppercase, and digit character + Md5 *string `json:"md5,omitempty"` + // An IP address from the subnet that will be used on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used. + MetalIp *string `json:"metal_ip,omitempty"` + Name *string `json:"name,omitempty"` + // The peer ASN that will be used with the VRF on the Virtual Circuit. + PeerAsn *int32 `json:"peer_asn,omitempty"` + // Speed can be changed only if it is an interconnection on a Dedicated Port + Speed *string `json:"speed,omitempty"` + // The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used as the Metal or Customer IP. + Subnet *string `json:"subnet,omitempty"` + Tags []string `json:"tags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VrfVirtualCircuitUpdateInput VrfVirtualCircuitUpdateInput + +// NewVrfVirtualCircuitUpdateInput instantiates a new VrfVirtualCircuitUpdateInput object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVrfVirtualCircuitUpdateInput() *VrfVirtualCircuitUpdateInput { + this := VrfVirtualCircuitUpdateInput{} + return &this +} + +// NewVrfVirtualCircuitUpdateInputWithDefaults instantiates a new VrfVirtualCircuitUpdateInput object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVrfVirtualCircuitUpdateInputWithDefaults() *VrfVirtualCircuitUpdateInput { + this := VrfVirtualCircuitUpdateInput{} + return &this +} + +// GetCustomerIp returns the CustomerIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetCustomerIp() string { + if o == nil || IsNil(o.CustomerIp) { + var ret string + return ret + } + return *o.CustomerIp +} + +// GetCustomerIpOk returns a tuple with the CustomerIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetCustomerIpOk() (*string, bool) { + if o == nil || IsNil(o.CustomerIp) { + return nil, false + } + return o.CustomerIp, true +} + +// HasCustomerIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasCustomerIp() bool { + if o != nil && !IsNil(o.CustomerIp) { + return true + } + + return false +} + +// SetCustomerIp gets a reference to the given string and assigns it to the CustomerIp field. +func (o *VrfVirtualCircuitUpdateInput) SetCustomerIp(v string) { + o.CustomerIp = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VrfVirtualCircuitUpdateInput) SetDescription(v string) { + o.Description = &v +} + +// GetMd5 returns the Md5 field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetMd5() string { + if o == nil || IsNil(o.Md5) { + var ret string + return ret + } + return *o.Md5 +} + +// GetMd5Ok returns a tuple with the Md5 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetMd5Ok() (*string, bool) { + if o == nil || IsNil(o.Md5) { + return nil, false + } + return o.Md5, true +} + +// HasMd5 returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasMd5() bool { + if o != nil && !IsNil(o.Md5) { + return true + } + + return false +} + +// SetMd5 gets a reference to the given string and assigns it to the Md5 field. +func (o *VrfVirtualCircuitUpdateInput) SetMd5(v string) { + o.Md5 = &v +} + +// GetMetalIp returns the MetalIp field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetMetalIp() string { + if o == nil || IsNil(o.MetalIp) { + var ret string + return ret + } + return *o.MetalIp +} + +// GetMetalIpOk returns a tuple with the MetalIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetMetalIpOk() (*string, bool) { + if o == nil || IsNil(o.MetalIp) { + return nil, false + } + return o.MetalIp, true +} + +// HasMetalIp returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasMetalIp() bool { + if o != nil && !IsNil(o.MetalIp) { + return true + } + + return false +} + +// SetMetalIp gets a reference to the given string and assigns it to the MetalIp field. +func (o *VrfVirtualCircuitUpdateInput) SetMetalIp(v string) { + o.MetalIp = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *VrfVirtualCircuitUpdateInput) SetName(v string) { + o.Name = &v +} + +// GetPeerAsn returns the PeerAsn field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetPeerAsn() int32 { + if o == nil || IsNil(o.PeerAsn) { + var ret int32 + return ret + } + return *o.PeerAsn +} + +// GetPeerAsnOk returns a tuple with the PeerAsn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetPeerAsnOk() (*int32, bool) { + if o == nil || IsNil(o.PeerAsn) { + return nil, false + } + return o.PeerAsn, true +} + +// HasPeerAsn returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasPeerAsn() bool { + if o != nil && !IsNil(o.PeerAsn) { + return true + } + + return false +} + +// SetPeerAsn gets a reference to the given int32 and assigns it to the PeerAsn field. +func (o *VrfVirtualCircuitUpdateInput) SetPeerAsn(v int32) { + o.PeerAsn = &v +} + +// GetSpeed returns the Speed field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetSpeed() string { + if o == nil || IsNil(o.Speed) { + var ret string + return ret + } + return *o.Speed +} + +// GetSpeedOk returns a tuple with the Speed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetSpeedOk() (*string, bool) { + if o == nil || IsNil(o.Speed) { + return nil, false + } + return o.Speed, true +} + +// HasSpeed returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasSpeed() bool { + if o != nil && !IsNil(o.Speed) { + return true + } + + return false +} + +// SetSpeed gets a reference to the given string and assigns it to the Speed field. +func (o *VrfVirtualCircuitUpdateInput) SetSpeed(v string) { + o.Speed = &v +} + +// GetSubnet returns the Subnet field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetSubnet() string { + if o == nil || IsNil(o.Subnet) { + var ret string + return ret + } + return *o.Subnet +} + +// GetSubnetOk returns a tuple with the Subnet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetSubnetOk() (*string, bool) { + if o == nil || IsNil(o.Subnet) { + return nil, false + } + return o.Subnet, true +} + +// HasSubnet returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasSubnet() bool { + if o != nil && !IsNil(o.Subnet) { + return true + } + + return false +} + +// SetSubnet gets a reference to the given string and assigns it to the Subnet field. +func (o *VrfVirtualCircuitUpdateInput) SetSubnet(v string) { + o.Subnet = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *VrfVirtualCircuitUpdateInput) GetTags() []string { + if o == nil || IsNil(o.Tags) { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VrfVirtualCircuitUpdateInput) GetTagsOk() ([]string, bool) { + if o == nil || IsNil(o.Tags) { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *VrfVirtualCircuitUpdateInput) HasTags() bool { + if o != nil && !IsNil(o.Tags) { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *VrfVirtualCircuitUpdateInput) SetTags(v []string) { + o.Tags = v +} + +func (o VrfVirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VrfVirtualCircuitUpdateInput) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomerIp) { + toSerialize["customer_ip"] = o.CustomerIp + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Md5) { + toSerialize["md5"] = o.Md5 + } + if !IsNil(o.MetalIp) { + toSerialize["metal_ip"] = o.MetalIp + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PeerAsn) { + toSerialize["peer_asn"] = o.PeerAsn + } + if !IsNil(o.Speed) { + toSerialize["speed"] = o.Speed + } + if !IsNil(o.Subnet) { + toSerialize["subnet"] = o.Subnet + } + if !IsNil(o.Tags) { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VrfVirtualCircuitUpdateInput) UnmarshalJSON(bytes []byte) (err error) { + varVrfVirtualCircuitUpdateInput := _VrfVirtualCircuitUpdateInput{} + + err = json.Unmarshal(bytes, &varVrfVirtualCircuitUpdateInput) + + if err != nil { + return err + } + + *o = VrfVirtualCircuitUpdateInput(varVrfVirtualCircuitUpdateInput) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "customer_ip") + delete(additionalProperties, "description") + delete(additionalProperties, "md5") + delete(additionalProperties, "metal_ip") + delete(additionalProperties, "name") + delete(additionalProperties, "peer_asn") + delete(additionalProperties, "speed") + delete(additionalProperties, "subnet") + delete(additionalProperties, "tags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVrfVirtualCircuitUpdateInput struct { + value *VrfVirtualCircuitUpdateInput + isSet bool +} + +func (v NullableVrfVirtualCircuitUpdateInput) Get() *VrfVirtualCircuitUpdateInput { + return v.value +} + +func (v *NullableVrfVirtualCircuitUpdateInput) Set(val *VrfVirtualCircuitUpdateInput) { + v.value = val + v.isSet = true +} + +func (v NullableVrfVirtualCircuitUpdateInput) IsSet() bool { + return v.isSet +} + +func (v *NullableVrfVirtualCircuitUpdateInput) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVrfVirtualCircuitUpdateInput(val *VrfVirtualCircuitUpdateInput) *NullableVrfVirtualCircuitUpdateInput { + return &NullableVrfVirtualCircuitUpdateInput{value: val, isSet: true} +} + +func (v NullableVrfVirtualCircuitUpdateInput) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVrfVirtualCircuitUpdateInput) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/metalv1/response.go b/services/metalv1/response.go new file mode 100644 index 00000000..46c8bbb4 --- /dev/null +++ b/services/metalv1/response.go @@ -0,0 +1,48 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/metalv1/test/api_authentication_test.go b/services/metalv1/test/api_authentication_test.go new file mode 100644 index 00000000..682b54ea --- /dev/null +++ b/services/metalv1/test/api_authentication_test.go @@ -0,0 +1,90 @@ +/* +Metal API + +Testing AuthenticationApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_AuthenticationApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AuthenticationApiService CreateAPIKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AuthenticationApi.CreateAPIKey(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AuthenticationApiService CreateProjectAPIKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.AuthenticationApi.CreateProjectAPIKey(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AuthenticationApiService DeleteAPIKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.AuthenticationApi.DeleteAPIKey(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AuthenticationApiService DeleteUserAPIKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.AuthenticationApi.DeleteUserAPIKey(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AuthenticationApiService FindAPIKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AuthenticationApi.FindAPIKeys(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test AuthenticationApiService FindProjectAPIKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.AuthenticationApi.FindProjectAPIKeys(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_batches_test.go b/services/metalv1/test/api_batches_test.go new file mode 100644 index 00000000..9b693315 --- /dev/null +++ b/services/metalv1/test/api_batches_test.go @@ -0,0 +1,71 @@ +/* +Metal API + +Testing BatchesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_BatchesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test BatchesApiService CreateDeviceBatch", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BatchesApi.CreateDeviceBatch(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BatchesApiService DeleteBatch", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.BatchesApi.DeleteBatch(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BatchesApiService FindBatchById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BatchesApi.FindBatchById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BatchesApiService FindBatchesByProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BatchesApi.FindBatchesByProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_bgp_test.go b/services/metalv1/test/api_bgp_test.go new file mode 100644 index 00000000..1b575839 --- /dev/null +++ b/services/metalv1/test/api_bgp_test.go @@ -0,0 +1,105 @@ +/* +Metal API + +Testing BGPApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_BGPApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test BGPApiService DeleteBgpSession", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.BGPApi.DeleteBgpSession(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService FindBgpConfigByProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BGPApi.FindBgpConfigByProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService FindBgpSessionById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BGPApi.FindBgpSessionById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService FindGlobalBgpRanges", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BGPApi.FindGlobalBgpRanges(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService FindProjectBgpSessions", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.BGPApi.FindProjectBgpSessions(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService RequestBgpConfig", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.BGPApi.RequestBgpConfig(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test BGPApiService UpdateBgpSession", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.BGPApi.UpdateBgpSession(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_capacity_test.go b/services/metalv1/test/api_capacity_test.go new file mode 100644 index 00000000..aeeefa4e --- /dev/null +++ b/services/metalv1/test/api_capacity_test.go @@ -0,0 +1,88 @@ +/* +Metal API + +Testing CapacityApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_CapacityApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test CapacityApiService CheckCapacityForFacility", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CapacityApi.CheckCapacityForFacility(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CapacityApiService CheckCapacityForMetro", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CapacityApi.CheckCapacityForMetro(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CapacityApiService FindCapacityForFacility", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CapacityApi.FindCapacityForFacility(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CapacityApiService FindCapacityForMetro", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.CapacityApi.FindCapacityForMetro(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CapacityApiService FindOrganizationCapacityPerFacility", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.CapacityApi.FindOrganizationCapacityPerFacility(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test CapacityApiService FindOrganizationCapacityPerMetro", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.CapacityApi.FindOrganizationCapacityPerMetro(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_console_log_details_test.go b/services/metalv1/test/api_console_log_details_test.go new file mode 100644 index 00000000..c9eb157d --- /dev/null +++ b/services/metalv1/test/api_console_log_details_test.go @@ -0,0 +1,36 @@ +/* +Metal API + +Testing ConsoleLogDetailsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_ConsoleLogDetailsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ConsoleLogDetailsApiService CaptureScreenshot", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.ConsoleLogDetailsApi.CaptureScreenshot(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_devices_test.go b/services/metalv1/test/api_devices_test.go new file mode 100644 index 00000000..db2f60f6 --- /dev/null +++ b/services/metalv1/test/api_devices_test.go @@ -0,0 +1,267 @@ +/* +Metal API + +Testing DevicesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_DevicesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DevicesApiService CreateBgpSession", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.CreateBgpSession(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService CreateDevice", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.CreateDevice(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService CreateIPAssignment", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.CreateIPAssignment(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService DeleteDevice", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DevicesApi.DeleteDevice(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindBgpSessions", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindBgpSessions(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindDeviceById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindDeviceById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindDeviceCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DevicesApi.FindDeviceCustomdata(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindDeviceMetadataByID", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindDeviceMetadataByID(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindDeviceUserdataByID", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindDeviceUserdataByID(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindIPAssignmentCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var instanceId string + var id string + + httpRes, err := apiClient.DevicesApi.FindIPAssignmentCustomdata(context.Background(), instanceId, id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindIPAssignments", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindIPAssignments(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindInstanceBandwidth", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DevicesApi.FindInstanceBandwidth(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService FindOrganizationDevices", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindOrganizationDevices(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.DevicesApi.FindOrganizationDevices(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test DevicesApiService FindProjectDevices", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.FindProjectDevices(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.DevicesApi.FindProjectDevices(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test DevicesApiService FindTraffic", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DevicesApi.FindTraffic(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService GetBgpNeighborData", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.GetBgpNeighborData(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService GetDeviceFirmwareSets", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.GetDeviceFirmwareSets(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService GetDeviceHealthRollup", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.GetDeviceHealthRollup(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService PerformAction", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.DevicesApi.PerformAction(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test DevicesApiService UpdateDevice", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.DevicesApi.UpdateDevice(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_emails_test.go b/services/metalv1/test/api_emails_test.go new file mode 100644 index 00000000..e33e5fa7 --- /dev/null +++ b/services/metalv1/test/api_emails_test.go @@ -0,0 +1,69 @@ +/* +Metal API + +Testing EmailsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_EmailsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test EmailsApiService CreateEmail", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.EmailsApi.CreateEmail(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EmailsApiService DeleteEmail", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.EmailsApi.DeleteEmail(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EmailsApiService FindEmailById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EmailsApi.FindEmailById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EmailsApiService UpdateEmail", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EmailsApi.UpdateEmail(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_events_test.go b/services/metalv1/test/api_events_test.go new file mode 100644 index 00000000..aac14bb8 --- /dev/null +++ b/services/metalv1/test/api_events_test.go @@ -0,0 +1,151 @@ +/* +Metal API + +Testing EventsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_EventsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test EventsApiService FindDeviceEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindDeviceEvents(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.EventsApi.FindDeviceEvents(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test EventsApiService FindEventById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindEventById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EventsApiService FindEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.EventsApi.FindEvents(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.EventsApi.FindEvents(context.Background()).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test EventsApiService FindInterconnectionEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.EventsApi.FindInterconnectionEvents(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.EventsApi.FindInterconnectionEvents(context.Background(), connectionId).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test EventsApiService FindInterconnectionPortEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + var id string + + resp, httpRes, err := apiClient.EventsApi.FindInterconnectionPortEvents(context.Background(), connectionId, id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EventsApiService FindOrganizationEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindOrganizationEvents(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.EventsApi.FindOrganizationEvents(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test EventsApiService FindProjectEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindProjectEvents(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.EventsApi.FindProjectEvents(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test EventsApiService FindVirtualCircuitEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindVirtualCircuitEvents(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test EventsApiService FindVrfRouteEvents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.EventsApi.FindVrfRouteEvents(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_facilities_test.go b/services/metalv1/test/api_facilities_test.go new file mode 100644 index 00000000..d4a05838 --- /dev/null +++ b/services/metalv1/test/api_facilities_test.go @@ -0,0 +1,58 @@ +/* +Metal API + +Testing FacilitiesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_FacilitiesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test FacilitiesApiService FindFacilities", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.FacilitiesApi.FindFacilities(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test FacilitiesApiService FindFacilitiesByOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.FacilitiesApi.FindFacilitiesByOrganization(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test FacilitiesApiService FindFacilitiesByProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.FacilitiesApi.FindFacilitiesByProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_firmware_sets_test.go b/services/metalv1/test/api_firmware_sets_test.go new file mode 100644 index 00000000..99bf3e15 --- /dev/null +++ b/services/metalv1/test/api_firmware_sets_test.go @@ -0,0 +1,48 @@ +/* +Metal API + +Testing FirmwareSetsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_FirmwareSetsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test FirmwareSetsApiService GetOrganizationFirmwareSets", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.FirmwareSetsApi.GetOrganizationFirmwareSets(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test FirmwareSetsApiService GetProjectFirmwareSets", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.FirmwareSetsApi.GetProjectFirmwareSets(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_hardware_reservations_test.go b/services/metalv1/test/api_hardware_reservations_test.go new file mode 100644 index 00000000..e6140a97 --- /dev/null +++ b/services/metalv1/test/api_hardware_reservations_test.go @@ -0,0 +1,76 @@ +/* +Metal API + +Testing HardwareReservationsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_HardwareReservationsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test HardwareReservationsApiService ActivateHardwareReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.HardwareReservationsApi.ActivateHardwareReservation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test HardwareReservationsApiService FindHardwareReservationById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.HardwareReservationsApi.FindHardwareReservationById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test HardwareReservationsApiService FindProjectHardwareReservations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.HardwareReservationsApi.FindProjectHardwareReservations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.HardwareReservationsApi.FindProjectHardwareReservations(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test HardwareReservationsApiService MoveHardwareReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.HardwareReservationsApi.MoveHardwareReservation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_incidents_test.go b/services/metalv1/test/api_incidents_test.go new file mode 100644 index 00000000..88f52ac9 --- /dev/null +++ b/services/metalv1/test/api_incidents_test.go @@ -0,0 +1,33 @@ +/* +Metal API + +Testing IncidentsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_IncidentsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test IncidentsApiService FindIncidents", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.IncidentsApi.FindIncidents(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_interconnections_test.go b/services/metalv1/test/api_interconnections_test.go new file mode 100644 index 00000000..4fe75965 --- /dev/null +++ b/services/metalv1/test/api_interconnections_test.go @@ -0,0 +1,211 @@ +/* +Metal API + +Testing InterconnectionsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_InterconnectionsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test InterconnectionsApiService CreateInterconnectionPortVirtualCircuit", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + var portId string + + resp, httpRes, err := apiClient.InterconnectionsApi.CreateInterconnectionPortVirtualCircuit(context.Background(), connectionId, portId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService CreateOrganizationInterconnection", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var organizationId string + + resp, httpRes, err := apiClient.InterconnectionsApi.CreateOrganizationInterconnection(context.Background(), organizationId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService CreateProjectInterconnection", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.InterconnectionsApi.CreateProjectInterconnection(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService DeleteInterconnection", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.InterconnectionsApi.DeleteInterconnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService DeleteVirtualCircuit", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InterconnectionsApi.DeleteVirtualCircuit(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService GetInterconnection", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.InterconnectionsApi.GetInterconnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService GetInterconnectionPort", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + var id string + + resp, httpRes, err := apiClient.InterconnectionsApi.GetInterconnectionPort(context.Background(), connectionId, id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService GetVirtualCircuit", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InterconnectionsApi.GetVirtualCircuit(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService ListInterconnectionPortVirtualCircuits", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + var portId string + + resp, httpRes, err := apiClient.InterconnectionsApi.ListInterconnectionPortVirtualCircuits(context.Background(), connectionId, portId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService ListInterconnectionPorts", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.InterconnectionsApi.ListInterconnectionPorts(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService ListInterconnectionVirtualCircuits", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.InterconnectionsApi.ListInterconnectionVirtualCircuits(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService OrganizationListInterconnections", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var organizationId string + + resp, httpRes, err := apiClient.InterconnectionsApi.OrganizationListInterconnections(context.Background(), organizationId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService ProjectListInterconnections", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.InterconnectionsApi.ProjectListInterconnections(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.InterconnectionsApi.ProjectListInterconnections(context.Background(), projectId).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test InterconnectionsApiService UpdateInterconnection", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.InterconnectionsApi.UpdateInterconnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InterconnectionsApiService UpdateVirtualCircuit", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InterconnectionsApi.UpdateVirtualCircuit(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_invitations_test.go b/services/metalv1/test/api_invitations_test.go new file mode 100644 index 00000000..2c3dcdd2 --- /dev/null +++ b/services/metalv1/test/api_invitations_test.go @@ -0,0 +1,59 @@ +/* +Metal API + +Testing InvitationsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_InvitationsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test InvitationsApiService AcceptInvitation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InvitationsApi.AcceptInvitation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InvitationsApiService DeclineInvitation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.InvitationsApi.DeclineInvitation(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InvitationsApiService FindInvitationById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InvitationsApi.FindInvitationById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_invoices_test.go b/services/metalv1/test/api_invoices_test.go new file mode 100644 index 00000000..f2c76d6a --- /dev/null +++ b/services/metalv1/test/api_invoices_test.go @@ -0,0 +1,48 @@ +/* +Metal API + +Testing InvoicesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_InvoicesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test InvoicesApiService FindOrganizationInvoices", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InvoicesApi.FindOrganizationInvoices(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test InvoicesApiService GetInvoiceById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.InvoicesApi.GetInvoiceById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_ip_addresses_test.go b/services/metalv1/test/api_ip_addresses_test.go new file mode 100644 index 00000000..3d9c382b --- /dev/null +++ b/services/metalv1/test/api_ip_addresses_test.go @@ -0,0 +1,106 @@ +/* +Metal API + +Testing IPAddressesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_IPAddressesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test IPAddressesApiService DeleteIPAddress", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.IPAddressesApi.DeleteIPAddress(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService FindIPAddressById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.IPAddressesApi.FindIPAddressById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService FindIPAddressCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.IPAddressesApi.FindIPAddressCustomdata(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService FindIPAvailabilities", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.IPAddressesApi.FindIPAvailabilities(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService FindIPReservations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.IPAddressesApi.FindIPReservations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService RequestIPReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.IPAddressesApi.RequestIPReservation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test IPAddressesApiService UpdateIPAddress", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.IPAddressesApi.UpdateIPAddress(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_licenses_test.go b/services/metalv1/test/api_licenses_test.go new file mode 100644 index 00000000..cecc822c --- /dev/null +++ b/services/metalv1/test/api_licenses_test.go @@ -0,0 +1,83 @@ +/* +Metal API + +Testing LicensesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_LicensesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test LicensesApiService CreateLicense", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.LicensesApi.CreateLicense(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test LicensesApiService DeleteLicense", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.LicensesApi.DeleteLicense(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test LicensesApiService FindLicenseById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.LicensesApi.FindLicenseById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test LicensesApiService FindProjectLicenses", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.LicensesApi.FindProjectLicenses(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test LicensesApiService UpdateLicense", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.LicensesApi.UpdateLicense(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_memberships_test.go b/services/metalv1/test/api_memberships_test.go new file mode 100644 index 00000000..5cb89167 --- /dev/null +++ b/services/metalv1/test/api_memberships_test.go @@ -0,0 +1,59 @@ +/* +Metal API + +Testing MembershipsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_MembershipsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MembershipsApiService DeleteMembership", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.MembershipsApi.DeleteMembership(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MembershipsApiService FindMembershipById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MembershipsApi.FindMembershipById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MembershipsApiService UpdateMembership", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MembershipsApi.UpdateMembership(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_metal_gateways_test.go b/services/metalv1/test/api_metal_gateways_test.go new file mode 100644 index 00000000..4e7667f8 --- /dev/null +++ b/services/metalv1/test/api_metal_gateways_test.go @@ -0,0 +1,100 @@ +/* +Metal API + +Testing MetalGatewaysApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_MetalGatewaysApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MetalGatewaysApiService CreateMetalGateway", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.MetalGatewaysApi.CreateMetalGateway(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MetalGatewaysApiService CreateMetalGatewayElasticIp", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MetalGatewaysApi.CreateMetalGatewayElasticIp(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MetalGatewaysApiService DeleteMetalGateway", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MetalGatewaysApi.DeleteMetalGateway(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MetalGatewaysApiService FindMetalGatewayById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MetalGatewaysApi.FindMetalGatewayById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MetalGatewaysApiService FindMetalGatewaysByProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.MetalGatewaysApi.FindMetalGatewaysByProject(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.MetalGatewaysApi.FindMetalGatewaysByProject(context.Background(), projectId).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test MetalGatewaysApiService GetMetalGatewayElasticIps", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MetalGatewaysApi.GetMetalGatewayElasticIps(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_metros_test.go b/services/metalv1/test/api_metros_test.go new file mode 100644 index 00000000..b3d1d509 --- /dev/null +++ b/services/metalv1/test/api_metros_test.go @@ -0,0 +1,46 @@ +/* +Metal API + +Testing MetrosApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_MetrosApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MetrosApiService FindMetros", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MetrosApi.FindMetros(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test MetrosApiService GetMetro", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.MetrosApi.GetMetro(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_operating_systems_test.go b/services/metalv1/test/api_operating_systems_test.go new file mode 100644 index 00000000..3ff386a7 --- /dev/null +++ b/services/metalv1/test/api_operating_systems_test.go @@ -0,0 +1,44 @@ +/* +Metal API + +Testing OperatingSystemsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_OperatingSystemsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OperatingSystemsApiService FindOperatingSystemVersion", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OperatingSystemsApi.FindOperatingSystemVersion(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OperatingSystemsApiService FindOperatingSystems", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OperatingSystemsApi.FindOperatingSystems(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_organizations_test.go b/services/metalv1/test/api_organizations_test.go new file mode 100644 index 00000000..56437d8e --- /dev/null +++ b/services/metalv1/test/api_organizations_test.go @@ -0,0 +1,206 @@ +/* +Metal API + +Testing OrganizationsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_OrganizationsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OrganizationsApiService CreateOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OrganizationsApi.CreateOrganization(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService CreateOrganizationInvitation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.CreateOrganizationInvitation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService CreateOrganizationProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.CreateOrganizationProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService CreatePaymentMethod", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.CreatePaymentMethod(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService DeleteOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.OrganizationsApi.DeleteOrganization(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOperatingSystemsByOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOperatingSystemsByOrganization(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizationById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizationById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizationCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.OrganizationsApi.FindOrganizationCustomdata(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizationInvitations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizationInvitations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizationPaymentMethods", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizationPaymentMethods(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizationProjects", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizationProjects(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.OrganizationsApi.FindOrganizationProjects(context.Background(), id).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test OrganizationsApiService FindOrganizationTransfers", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizationTransfers(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService FindOrganizations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OrganizationsApi.FindOrganizations(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.OrganizationsApi.FindOrganizations(context.Background()).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test OrganizationsApiService FindPlansByOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.FindPlansByOrganization(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OrganizationsApiService UpdateOrganization", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.OrganizationsApi.UpdateOrganization(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_otps_test.go b/services/metalv1/test/api_otps_test.go new file mode 100644 index 00000000..e40c20c0 --- /dev/null +++ b/services/metalv1/test/api_otps_test.go @@ -0,0 +1,64 @@ +/* +Metal API + +Testing OTPsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_OTPsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test OTPsApiService FindEnsureOtp", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var otp string + + httpRes, err := apiClient.OTPsApi.FindEnsureOtp(context.Background(), otp).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OTPsApiService FindRecoveryCodes", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OTPsApi.FindRecoveryCodes(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OTPsApiService ReceiveCodes", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.OTPsApi.ReceiveCodes(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test OTPsApiService RegenerateCodes", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.OTPsApi.RegenerateCodes(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_password_reset_tokens_test.go b/services/metalv1/test/api_password_reset_tokens_test.go new file mode 100644 index 00000000..bc5cab6b --- /dev/null +++ b/services/metalv1/test/api_password_reset_tokens_test.go @@ -0,0 +1,43 @@ +/* +Metal API + +Testing PasswordResetTokensApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_PasswordResetTokensApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PasswordResetTokensApiService CreatePasswordResetToken", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.PasswordResetTokensApi.CreatePasswordResetToken(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PasswordResetTokensApiService ResetPassword", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PasswordResetTokensApi.ResetPassword(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_payment_methods_test.go b/services/metalv1/test/api_payment_methods_test.go new file mode 100644 index 00000000..24d2613b --- /dev/null +++ b/services/metalv1/test/api_payment_methods_test.go @@ -0,0 +1,59 @@ +/* +Metal API + +Testing PaymentMethodsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_PaymentMethodsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PaymentMethodsApiService DeletePaymentMethod", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.PaymentMethodsApi.DeletePaymentMethod(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PaymentMethodsApiService FindPaymentMethodById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PaymentMethodsApi.FindPaymentMethodById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PaymentMethodsApiService UpdatePaymentMethod", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PaymentMethodsApi.UpdatePaymentMethod(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_plans_test.go b/services/metalv1/test/api_plans_test.go new file mode 100644 index 00000000..a657fb42 --- /dev/null +++ b/services/metalv1/test/api_plans_test.go @@ -0,0 +1,46 @@ +/* +Metal API + +Testing PlansApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_PlansApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PlansApiService FindPlans", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PlansApi.FindPlans(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PlansApiService FindPlansByProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PlansApi.FindPlansByProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_ports_test.go b/services/metalv1/test/api_ports_test.go new file mode 100644 index 00000000..5258949a --- /dev/null +++ b/services/metalv1/test/api_ports_test.go @@ -0,0 +1,194 @@ +/* +Metal API + +Testing PortsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_PortsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PortsApiService AssignNativeVlan", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.AssignNativeVlan(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService AssignPort", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.AssignPort(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService BondPort", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.BondPort(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService ConvertLayer2", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.ConvertLayer2(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService ConvertLayer3", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.ConvertLayer3(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService CreatePortVlanAssignmentBatch", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.CreatePortVlanAssignmentBatch(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService DeleteNativeVlan", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.DeleteNativeVlan(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService DisbondPort", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.DisbondPort(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService FindPortById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.FindPortById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService FindPortVlanAssignmentBatchByPortIdAndBatchId", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + var batchId string + + resp, httpRes, err := apiClient.PortsApi.FindPortVlanAssignmentBatchByPortIdAndBatchId(context.Background(), id, batchId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService FindPortVlanAssignmentBatches", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.FindPortVlanAssignmentBatches(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService FindPortVlanAssignmentByPortIdAndAssignmentId", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + var assignmentId string + + resp, httpRes, err := apiClient.PortsApi.FindPortVlanAssignmentByPortIdAndAssignmentId(context.Background(), id, assignmentId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService FindPortVlanAssignments", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.FindPortVlanAssignments(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test PortsApiService UnassignPort", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.PortsApi.UnassignPort(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_projects_test.go b/services/metalv1/test/api_projects_test.go new file mode 100644 index 00000000..f0e7306f --- /dev/null +++ b/services/metalv1/test/api_projects_test.go @@ -0,0 +1,154 @@ +/* +Metal API + +Testing ProjectsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_ProjectsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ProjectsApiService CreateProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ProjectsApi.CreateProject(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService CreateProjectInvitation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.ProjectsApi.CreateProjectInvitation(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService CreateTransferRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.ProjectsApi.CreateTransferRequest(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService DeleteProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.ProjectsApi.DeleteProject(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindIPReservationCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + var id string + + httpRes, err := apiClient.ProjectsApi.FindIPReservationCustomdata(context.Background(), projectId, id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindProjectById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.ProjectsApi.FindProjectById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindProjectCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.ProjectsApi.FindProjectCustomdata(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindProjectInvitations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.ProjectsApi.FindProjectInvitations(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindProjectMemberships", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.ProjectsApi.FindProjectMemberships(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test ProjectsApiService FindProjects", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ProjectsApi.FindProjects(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.ProjectsApi.FindProjects(context.Background()).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test ProjectsApiService UpdateProject", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.ProjectsApi.UpdateProject(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_self_service_reservations_test.go b/services/metalv1/test/api_self_service_reservations_test.go new file mode 100644 index 00000000..eca9eca2 --- /dev/null +++ b/services/metalv1/test/api_self_service_reservations_test.go @@ -0,0 +1,61 @@ +/* +Metal API + +Testing SelfServiceReservationsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_SelfServiceReservationsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SelfServiceReservationsApiService CreateSelfServiceReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.SelfServiceReservationsApi.CreateSelfServiceReservation(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SelfServiceReservationsApiService FindSelfServiceReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + var projectId string + + resp, httpRes, err := apiClient.SelfServiceReservationsApi.FindSelfServiceReservation(context.Background(), id, projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SelfServiceReservationsApiService FindSelfServiceReservations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var projectId string + + resp, httpRes, err := apiClient.SelfServiceReservationsApi.FindSelfServiceReservations(context.Background(), projectId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_spot_market_test.go b/services/metalv1/test/api_spot_market_test.go new file mode 100644 index 00000000..3c85c8ef --- /dev/null +++ b/services/metalv1/test/api_spot_market_test.go @@ -0,0 +1,101 @@ +/* +Metal API + +Testing SpotMarketApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_SpotMarketApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SpotMarketApiService CreateSpotMarketRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SpotMarketApi.CreateSpotMarketRequest(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService DeleteSpotMarketRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.SpotMarketApi.DeleteSpotMarketRequest(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService FindMetroSpotMarketPrices", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SpotMarketApi.FindMetroSpotMarketPrices(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService FindSpotMarketPrices", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SpotMarketApi.FindSpotMarketPrices(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService FindSpotMarketPricesHistory", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SpotMarketApi.FindSpotMarketPricesHistory(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService FindSpotMarketRequestById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SpotMarketApi.FindSpotMarketRequestById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SpotMarketApiService ListSpotMarketRequests", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SpotMarketApi.ListSpotMarketRequests(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_ssh_keys_test.go b/services/metalv1/test/api_ssh_keys_test.go new file mode 100644 index 00000000..eab2986e --- /dev/null +++ b/services/metalv1/test/api_ssh_keys_test.go @@ -0,0 +1,115 @@ +/* +Metal API + +Testing SSHKeysApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_SSHKeysApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SSHKeysApiService CreateProjectSSHKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysApi.CreateProjectSSHKey(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService CreateSSHKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SSHKeysApi.CreateSSHKey(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService DeleteSSHKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.SSHKeysApi.DeleteSSHKey(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService FindDeviceSSHKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysApi.FindDeviceSSHKeys(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService FindProjectSSHKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysApi.FindProjectSSHKeys(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService FindSSHKeyById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysApi.FindSSHKeyById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService FindSSHKeys", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.SSHKeysApi.FindSSHKeys(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test SSHKeysApiService UpdateSSHKey", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.SSHKeysApi.UpdateSSHKey(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_support_request_test.go b/services/metalv1/test/api_support_request_test.go new file mode 100644 index 00000000..491bfce5 --- /dev/null +++ b/services/metalv1/test/api_support_request_test.go @@ -0,0 +1,33 @@ +/* +Metal API + +Testing SupportRequestApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_SupportRequestApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test SupportRequestApiService RequestSuppert", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.SupportRequestApi.RequestSuppert(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_transfer_requests_test.go b/services/metalv1/test/api_transfer_requests_test.go new file mode 100644 index 00000000..0383cf80 --- /dev/null +++ b/services/metalv1/test/api_transfer_requests_test.go @@ -0,0 +1,58 @@ +/* +Metal API + +Testing TransferRequestsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_TransferRequestsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test TransferRequestsApiService AcceptTransferRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.TransferRequestsApi.AcceptTransferRequest(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test TransferRequestsApiService DeclineTransferRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.TransferRequestsApi.DeclineTransferRequest(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test TransferRequestsApiService FindTransferRequestById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.TransferRequestsApi.FindTransferRequestById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_two_factor_auth_test.go b/services/metalv1/test/api_two_factor_auth_test.go new file mode 100644 index 00000000..c5a5a608 --- /dev/null +++ b/services/metalv1/test/api_two_factor_auth_test.go @@ -0,0 +1,60 @@ +/* +Metal API + +Testing TwoFactorAuthApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_TwoFactorAuthApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test TwoFactorAuthApiService DisableTfaApp", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.TwoFactorAuthApi.DisableTfaApp(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test TwoFactorAuthApiService DisableTfaSms", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.TwoFactorAuthApi.DisableTfaSms(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test TwoFactorAuthApiService EnableTfaApp", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.TwoFactorAuthApi.EnableTfaApp(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test TwoFactorAuthApiService EnableTfaSms", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.TwoFactorAuthApi.EnableTfaSms(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_usages_test.go b/services/metalv1/test/api_usages_test.go new file mode 100644 index 00000000..0ba81629 --- /dev/null +++ b/services/metalv1/test/api_usages_test.go @@ -0,0 +1,48 @@ +/* +Metal API + +Testing UsagesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_UsagesApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsagesApiService FindDeviceUsages", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.UsagesApi.FindDeviceUsages(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsagesApiService FindProjectUsage", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.UsagesApi.FindProjectUsage(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_user_verification_tokens_test.go b/services/metalv1/test/api_user_verification_tokens_test.go new file mode 100644 index 00000000..5285f56c --- /dev/null +++ b/services/metalv1/test/api_user_verification_tokens_test.go @@ -0,0 +1,42 @@ +/* +Metal API + +Testing UserVerificationTokensApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_UserVerificationTokensApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UserVerificationTokensApiService ConsumeVerificationRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.UserVerificationTokensApi.ConsumeVerificationRequest(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UserVerificationTokensApiService CreateValidationRequest", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.UserVerificationTokensApi.CreateValidationRequest(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_userdata_test.go b/services/metalv1/test/api_userdata_test.go new file mode 100644 index 00000000..53197313 --- /dev/null +++ b/services/metalv1/test/api_userdata_test.go @@ -0,0 +1,33 @@ +/* +Metal API + +Testing UserdataApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_UserdataApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UserdataApiService ValidateUserdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + httpRes, err := apiClient.UserdataApi.ValidateUserdata(context.Background()).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_users_test.go b/services/metalv1/test/api_users_test.go new file mode 100644 index 00000000..8f569f17 --- /dev/null +++ b/services/metalv1/test/api_users_test.go @@ -0,0 +1,101 @@ +/* +Metal API + +Testing UsersApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_UsersApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsersApiService CreateUser", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.CreateUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsersApiService FindCurrentUser", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.FindCurrentUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsersApiService FindInvitations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.FindInvitations(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsersApiService FindUserById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.UsersApi.FindUserById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsersApiService FindUserCustomdata", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.UsersApi.FindUserCustomdata(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test UsersApiService FindUsers", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.FindUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + resp, err = apiClient.UsersApi.FindUsers(context.Background()).ExecuteWithPagination() + require.Nil(t, err) + require.NotNil(t, resp) + }) + + t.Run("Test UsersApiService UpdateCurrentUser", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.UpdateCurrentUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_vlans_test.go b/services/metalv1/test/api_vlans_test.go new file mode 100644 index 00000000..8aa2ac15 --- /dev/null +++ b/services/metalv1/test/api_vlans_test.go @@ -0,0 +1,72 @@ +/* +Metal API + +Testing VLANsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_VLANsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test VLANsApiService CreateVirtualNetwork", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VLANsApi.CreateVirtualNetwork(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VLANsApiService DeleteVirtualNetwork", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VLANsApi.DeleteVirtualNetwork(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VLANsApiService FindVirtualNetworks", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VLANsApi.FindVirtualNetworks(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VLANsApiService GetVirtualNetwork", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VLANsApi.GetVirtualNetwork(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/test/api_vrfs_test.go b/services/metalv1/test/api_vrfs_test.go new file mode 100644 index 00000000..ffba098b --- /dev/null +++ b/services/metalv1/test/api_vrfs_test.go @@ -0,0 +1,216 @@ +/* +Metal API + +Testing VRFsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package metalv1 + +import ( + "context" + "testing" + + openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_metalv1_VRFsApiService(t *testing.T) { + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test VRFsApiService BgpDynamicNeighborsIdGet", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.BgpDynamicNeighborsIdGet(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService CreateBgpDynamicNeighbor", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.CreateBgpDynamicNeighbor(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService CreateVrf", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.CreateVrf(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService CreateVrfRoute", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.CreateVrfRoute(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService DeleteBgpDynamicNeighborById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.DeleteBgpDynamicNeighborById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService DeleteVrf", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + httpRes, err := apiClient.VRFsApi.DeleteVrf(context.Background(), id).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService DeleteVrfRouteById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.DeleteVrfRouteById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService FindVrfById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.FindVrfById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService FindVrfIpReservation", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var vrfId string + var id string + + resp, httpRes, err := apiClient.VRFsApi.FindVrfIpReservation(context.Background(), vrfId, id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService FindVrfIpReservations", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.FindVrfIpReservations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService FindVrfRouteById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.FindVrfRouteById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService FindVrfs", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.FindVrfs(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService GetBgpDynamicNeighbors", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.GetBgpDynamicNeighbors(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService GetVrfRoutes", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.GetVrfRoutes(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService UpdateVrf", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.UpdateVrf(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) + + t.Run("Test VRFsApiService UpdateVrfRouteById", func(t *testing.T) { + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.VRFsApi.UpdateVrfRouteById(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + }) +} diff --git a/services/metalv1/utils.go b/services/metalv1/utils.go new file mode 100644 index 00000000..885106ba --- /dev/null +++ b/services/metalv1/utils.go @@ -0,0 +1,348 @@ +/* +Metal API + +# Introduction Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . # Common Parameters The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. ## Pagination Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. ## Sorting Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). ## Filtering Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 ``` Only IP addresses with the `type` field set to `public_ipv4` will be returned. ## Searching Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. To search resources you can use the `search` query parameter. ## Include and Exclude For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. ```json { ... \"project\": { \"href\": \"/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd\" } } ``` If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. For example: ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=projects ``` The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=emails,projects,memberships ``` You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): ```sh curl -H 'X-Auth-Token: my_authentication_token' \\ https://api.equinix.com/metal/v1/user?include=memberships.projects ``` To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + +API version: 1.0.0 +Contact: support@equinixmetal.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package metalv1 + +import ( + "encoding/json" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} diff --git a/spec/services/metalv1/.keep b/spec/services/metalv1/.keep new file mode 100644 index 00000000..e69de29b diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml new file mode 100644 index 00000000..0ff7e3c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/DeviceSearch.yaml @@ -0,0 +1,5 @@ +description: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. +in: query +name: search +schema: + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml new file mode 100644 index 00000000..dc844437 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Exclude.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to exclude. Excluded objects will return only the href + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. +in: query +name: exclude +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml new file mode 100644 index 00000000..715b84d9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Include.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to include. Included objects will return their full + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + nested objects. +in: query +name: include +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml new file mode 100644 index 00000000..98b2cf73 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/Page.yaml @@ -0,0 +1,9 @@ +description: Page to return +in: query +name: page +schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml new file mode 100644 index 00000000..1d262157 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/PerPage.yaml @@ -0,0 +1,9 @@ +description: Items returned per page +in: query +name: per_page +schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml b/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml new file mode 100644 index 00000000..f2e0a162 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/parameters/ProjectName.yaml @@ -0,0 +1,5 @@ +description: Filter results by name. +in: query +name: name +schema: + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml new file mode 100644 index 00000000..8a836571 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/InterconnectionCreateInput.yaml @@ -0,0 +1,9 @@ +content: + application/json: + schema: + oneOf: + - $ref: '../schemas/DedicatedPortCreateInput.yaml' + - $ref: '../schemas/VlanFabricVcCreateInput.yaml' + - $ref: '../schemas/VrfFabricVcCreateInput.yaml' +description: Dedicated port or shared interconnection (also known as Fabric VC) creation request +required: true diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml new file mode 100644 index 00000000..876f949e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/InvitationInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/InvitationInput.yaml' +description: Invitation to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml new file mode 100644 index 00000000..c9e68501 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/PortAssignInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/PortAssignInput.yaml' +description: 'Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: ''1001'').' +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..b93aa52a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/requestBodies/SSHKeyCreateInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/SSHKeyCreateInput.yaml' +description: ssh key to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml new file mode 100644 index 00000000..7cbab354 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Address.yaml @@ -0,0 +1,20 @@ +properties: + address: + type: string + address2: + type: string + city: + type: string + coordinates: + $ref: './Coordinates.yaml' + country: + type: string + state: + type: string + zip_code: + type: string +required: +- address +- zip_code +- country +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml new file mode 100644 index 00000000..fdd3bcde --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Attribute.yaml @@ -0,0 +1,17 @@ +properties: + namespace: + readOnly: true + type: string + description: Attribute namespace + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + data: + $ref: "./AttributeData.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml new file mode 100644 index 00000000..bba3c908 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AttributeData.yaml @@ -0,0 +1,17 @@ +properties: + latest: + readOnly: true + type: boolean + description: Boolean flag to know if the firmware set is the latest for the model and vendor + model: + readOnly: true + type: string + description: Model on which this firmware set can be applied + vendor: + readOnly: true + type: string + description: Vendor on which this firmware set can be applied + plan: + readOnly: true + type: string + description: Plan where the firmware set can be applied diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml new file mode 100644 index 00000000..8a43219c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthToken.yaml @@ -0,0 +1,26 @@ +properties: + created_at: + format: date-time + type: string + description: + description: Available only for API keys + type: string + id: + format: uuid + type: string + project: + allOf: + - $ref: './Project.yaml' + - description: Available only for project tokens + read_only: + type: boolean + token: + type: string + updated_at: + format: date-time + type: string + user: + allOf: + - $ref: './User.yaml' + - description: Available only for user tokens +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml new file mode 100644 index 00000000..203a139e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + read_only: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml new file mode 100644 index 00000000..c99752f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/AuthTokenList.yaml @@ -0,0 +1,6 @@ +properties: + api_keys: + items: + $ref: './AuthToken.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml new file mode 100644 index 00000000..a06baae8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BGPSessionInput.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + description: Address family for BGP session. + enum: + - ipv4 + - ipv6 + example: ipv4 + type: string + default_route: + default: false + description: Set the default route policy. + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml new file mode 100644 index 00000000..919aa209 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Batch.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + devices: + items: + $ref: './Href.yaml' + type: array + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + quantity: + type: integer + state: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml new file mode 100644 index 00000000..0da8f68b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BatchesList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './Batch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml new file mode 100644 index 00000000..0947e2f2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfig.yaml @@ -0,0 +1,61 @@ +properties: + asn: + description: Autonomous System Number. ASN is required with Global BGP. With Local + BGP the private ASN, 65000, is assigned. + example: 65000 + format: int32 + type: integer + created_at: + format: date-time + type: string + deployment_type: + description: | + In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. + enum: + - global + - local + example: local + type: string + href: + type: string + id: + format: uuid + type: string + max_prefix: + default: 10 + description: The maximum number of route filters allowed per server + type: integer + md5: + description: (Optional) Password for BGP session in plaintext (not a checksum) + nullable: true + type: string + project: + $ref: './Href.yaml' + ranges: + description: The IP block ranges associated to the ASN (Populated in Global BGP + only) + items: + $ref: './GlobalBgpRange.yaml' + type: array + requested_at: + format: date-time + type: string + route_object: + description: Specifies AS-MACRO (aka AS-SET) to use when building client route + filters + type: string + sessions: + description: The direct connections between neighboring routers that want to exchange + routing information. + items: + $ref: './BgpSession.yaml' + type: array + status: + description: Status of the BGP Config. Status "requested" is valid only with the + "global" deployment_type. + enum: + - requested + - enabled + - disabled + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml new file mode 100644 index 00000000..9cd1aa01 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpConfigRequestInput.yaml @@ -0,0 +1,30 @@ +properties: + asn: + type: integer + minimum: 0 + maximum: 4294967295 + description: Autonomous System Number for local BGP deployment. + example: 65000 + deployment_type: + description: Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers. + type: string + example: local + enum: + - local + - global + md5: + type: string + description: | + The plaintext password to share between BGP neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + use_case: + description: A use case explanation (necessary for global BGP request review). + type: string +required: +- deployment_type +- asn +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml new file mode 100644 index 00000000..02135006 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighbor.yaml @@ -0,0 +1,43 @@ +properties: + id: + description: The unique identifier for the resource + format: uuid + readOnly: true + type: string + example: aea82f16-57ec-412c-9523-b7f2b27635b2 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + example: 12345 + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + metal_gateway: + $ref: './VrfMetalGateway.yaml' + state: + readOnly: true + type: string + enum: + - active + - deleting + - pending + - ready + href: + type: string + readOnly: true + example: /bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2 + created_at: + format: date-time + readOnly: true + type: string + created_by: + $ref: './UserLimited.yaml' + updated_at: + format: date-time + readOnly: true + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml new file mode 100644 index 00000000..c53701f3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + example: 12345 + tags: + items: + type: string + type: array +required: +- bgp_neighbor_range +- bgp_neighbor_asn diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml new file mode 100644 index 00000000..69e368a3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpDynamicNeighborList.yaml @@ -0,0 +1,8 @@ +properties: + bgp_dynamic_neighbors: + items: + $ref: './BgpDynamicNeighbor.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml new file mode 100644 index 00000000..8914ad1a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpNeighborData.yaml @@ -0,0 +1,61 @@ +properties: + address_family: + description: Address Family for IP Address. Accepted values are 4 or 6 + example: 4 + format: int32 + type: integer + customer_as: + description: The customer's ASN. In a local BGP deployment, this will be an internal + ASN used to route within the data center. For a global BGP deployment, this + will be the your own ASN, configured when you set up BGP for your project. + example: 65000 + format: int32 + type: integer + customer_ip: + description: The device's IP address. For an IPv4 BGP session, this is typically + the private bond0 address for the device. + example: 10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6) + type: string + md5_enabled: + description: True if an MD5 password is configured for the project. + type: boolean + md5_password: + description: The MD5 password configured for the project, if set. + type: string + multihop: + description: True when the BGP session should be configured as multihop. + type: boolean + peer_as: + description: The Peer ASN to use when configuring BGP on your device. + example: 65530 + format: int32 + type: integer + peer_ips: + description: A list of one or more IP addresses to use for the Peer IP section + of your BGP configuration. For non-multihop sessions, this will typically be + a single gateway address for the device. For multihop sessions, it will be a + list of IPs. + example: + - 169.254.255.1 + - 169.254.255.2 + items: + type: string + type: array + routes_in: + description: A list of project subnets + example: + - exact: true + route: 10.32.16.0/31 + items: + $ref: "./BgpRoute.yaml" + type: array + routes_out: + description: A list of outgoing routes. Only populated if the BGP session has + default route enabled. + example: + - exact: true + route: 0.0.0.0/0 + items: + $ref: "./BgpRoute.yaml" + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml new file mode 100644 index 00000000..18d325c3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpRoute.yaml @@ -0,0 +1,6 @@ +properties: + exact: + type: boolean + route: + example: 10.32.16.0/31 + type: string diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml new file mode 100644 index 00000000..db8baf83 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSession.yaml @@ -0,0 +1,41 @@ +properties: + address_family: + enum: + - ipv4 + - ipv6 + type: string + created_at: + format: date-time + type: string + default_route: + type: boolean + device: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + learned_routes: + items: + description: IPv4 or IPv6 range + example: 10.32.16.0/31 + type: string + type: array + status: + description: ' The status of the BGP Session. Multiple status values may be reported + when the device is connected to multiple switches, one value per switch. Each + status will start with "unknown" and progress to "up" or "down" depending on + the connected device. Subsequent "unknown" values indicate a problem acquiring + status from the switch. ' + enum: + - unknown + - up + - down + type: string + updated_at: + format: date-time + type: string +required: +- address_family +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml new file mode 100644 index 00000000..78bcbcb6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionList.yaml @@ -0,0 +1,6 @@ +properties: + bgp_sessions: + items: + $ref: './BgpSession.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml new file mode 100644 index 00000000..11bc4c5e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BgpSessionNeighbors.yaml @@ -0,0 +1,7 @@ +properties: + bgp_neighbors: + description: A list of BGP session neighbor data + items: + $ref: './BgpNeighborData.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml new file mode 100644 index 00000000..da6a03d7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/BondPortData.yaml @@ -0,0 +1,9 @@ +properties: + id: + description: ID of the bonding port + type: string + format: uuid + name: + description: Name of the port interface for the bond ("bond0") + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml new file mode 100644 index 00000000..e970ec63 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityInfo.yaml @@ -0,0 +1,10 @@ +properties: + available: + type: boolean + facility: + type: string + plan: + type: string + quantity: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml new file mode 100644 index 00000000..530332a2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerFacilityList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerFacilityInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml new file mode 100644 index 00000000..2fb51ba2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroInfo.yaml @@ -0,0 +1,15 @@ +properties: + available: + description: Returns true if there is enough capacity in the metro to fulfill + the quantity set. Returns false if there is not enough. + type: boolean + metro: + description: The metro ID or code sent to check capacity. + type: string + plan: + description: The plan ID or slug sent to check capacity. + type: string + quantity: + description: The number of servers sent to check capacity. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml new file mode 100644 index 00000000..9ec1ecc1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityCheckPerMetroList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerMetroInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml new file mode 100644 index 00000000..c1a02be0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityInput.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './ServerInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml new file mode 100644 index 00000000..e187f6f9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityLevelPerBaremetal.yaml @@ -0,0 +1,4 @@ +properties: + level: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml new file mode 100644 index 00000000..ecc3f627 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityList.yaml @@ -0,0 +1,4 @@ +properties: + capacity: + $ref: './CapacityReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml new file mode 100644 index 00000000..7af91e6b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CapacityReport.yaml @@ -0,0 +1,5 @@ +additionalProperties: + type: object + additionalProperties: + $ref: './CapacityLevelPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml new file mode 100644 index 00000000..efce1ccc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Component.yaml @@ -0,0 +1,55 @@ +properties: + uuid: + readOnly: true + type: string + description: Component UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + vendor: + readOnly: true + type: string + description: Component vendor + example: "equinix" + model: + readOnly: true + type: array + description: List of models where this component version can be applied + items: + type: string + example: romed8hm3 + filename: + readOnly: true + type: string + description: name of the file + version: + readOnly: true + type: string + description: Version of the component + example: 1.5.0 + component: + readOnly: true + type: string + description: Component type + example: bmc + checksum: + readOnly: true + type: string + description: File checksum + upstream_url: + readOnly: true + type: string + description: Location of the file + repository_url: + readOnly: true + type: string + description: Location of the file in the repository + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml new file mode 100644 index 00000000..036c6627 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Coordinates.yaml @@ -0,0 +1,6 @@ +properties: + latitude: + type: string + longitude: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml new file mode 100644 index 00000000..5aa749bd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CreateEmailInput.yaml @@ -0,0 +1,6 @@ +properties: + address: + type: string +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml new file mode 100644 index 00000000..84e9138c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/CreateSelfServiceReservationRequest.yaml @@ -0,0 +1,23 @@ +properties: + item: + items: + $ref: './SelfServiceReservationItemRequest.yaml' + type: array + notes: + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + start_date: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml new file mode 100644 index 00000000..bfd4f814 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DedicatedPortCreateInput.yaml @@ -0,0 +1,53 @@ +properties: + billing_account_name: + description: The billing account name of the Equinix Fabric account. + type: string + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. + type: string + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a dedicated port, the value of this field should be 'dedicated'. + type: string + enum: + - dedicated + use_case: + description: The intended use case of the dedicated port. + type: string +required: +- name +- metro +- type +- redundancy +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml new file mode 100644 index 00000000..8e3eb270 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Device.yaml @@ -0,0 +1,181 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + bonding_mode: + type: integer + created_at: + format: date-time + type: string + created_by: + allOf: + - $ref: './UserLite.yaml' + - description: The user that created the device. + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + facility: + $ref: './Facility.yaml' + firmware_set_id: + description: The UUID of the firmware set to associate with the device. + format: uuid + type: string + hardware_reservation: + $ref: './Href.yaml' + hostname: + type: string + href: + type: string + id: + format: uuid + type: string + image_url: + type: string + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array + ipxe_script_url: + type: string + iqn: + type: string + locked: + type: boolean + description: Prevents accidental deletion of this resource when set to true. + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + network_frozen: + type: boolean + description: Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. + network_ports: + description: + By default, servers at Equinix Metal are configured in a “bonded” mode + using LACP (Link Aggregation Control Protocol). Each 2-NIC server is + configured with a single bond (namely bond0) with both interfaces eth0 + and eth1 as members of the bond in a default Layer 3 mode. Some device + plans may have a different number of ports and bonds available. + type: array + items: + $ref: './Port.yaml' + operating_system: + $ref: './OperatingSystem.yaml' + actions: + description: Actions supported by the device instance. + items: + properties: + type: + type: string + name: + type: string + type: object + type: array + plan: + $ref: './Plan.yaml' + project: + allOf: + - $ref: './Href.yaml' + - description: Full version of project object when included + project_lite: + allOf: + - $ref: './Href.yaml' + - description: Lite version of project object when included + provisioning_events: + items: + $ref: './Event.yaml' + type: array + provisioning_percentage: + description: Only visible while device provisioning + format: float + type: number + root_password: + description: Root password is automatically generated when server is provisioned + and it is removed after 24 hours + type: string + short_id: + type: string + spot_instance: + description: Whether or not the device is a spot instance. + type: boolean + spot_price_max: + description: |- + The maximum price per hour you are willing to pay to keep this spot + instance. If you are outbid, the termination will be set allowing two + minutes before shutdown. + format: float + type: number + ssh_keys: + items: + $ref: './Href.yaml' + type: array + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + storage: + $ref: './Storage.yaml' + switch_uuid: + description: |- + Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + tags: + items: + type: string + type: array + termination_time: + description: |- + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + updated_at: + format: date-time + type: string + user: + type: string + userdata: + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + sos: + description: Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml new file mode 100644 index 00000000..671b5974 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceActionInput.yaml @@ -0,0 +1,30 @@ +type: object +required: +- type +properties: + type: + description: Action to perform. See Device.actions for possible actions. + type: string + enum: + - power_on + - power_off + - reboot + - rescue + - reinstall + force_delete: + description: May be required to perform actions under certain conditions + type: boolean + deprovision_fast: + description: When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. + type: boolean + preserve_data: + description: When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. + type: boolean + operating_system: + description: When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) + type: string + example: ubuntu_22_04 + ipxe_script_url: + description: When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) + type: string + diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml new file mode 100644 index 00000000..655100bb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInFacilityInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './FacilityInput.yaml' +- $ref: './DeviceCreateInput.yaml' \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml new file mode 100644 index 00000000..90c69ecd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInMetroInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './MetroInput.yaml' +- $ref: './DeviceCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml new file mode 100644 index 00000000..a5e47e26 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceCreateInput.yaml @@ -0,0 +1,213 @@ +properties: + always_pxe: + default: false + description: |- + When true, devices with a `custom_ipxe` OS will always boot to iPXE. The + default setting of false ensures that iPXE will be used on only the + first boot. + type: boolean + billing_cycle: + description: The billing cycle of the device. + enum: + - hourly + - daily + - monthly + - yearly + type: string + customdata: + description: |- + Customdata is an arbitrary JSON value that can be accessed via the + metadata service. + default: {} + type: object + additionalProperties: true + description: + description: |- + Any description of the device or how it will be used. This may be used + to inform other API consumers with project access. + type: string + features: + description: |- + The features attribute allows you to optionally specify what features your server should have. + + In the API shorthand syntax, all features listed are `required`: + + ``` + { "features": ["tpm"] } + ``` + + Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: + + ``` + { "features": { "tpm": "required", "raid": "preferred" } } + ``` + + The request will only fail if there are no available servers matching the required `tpm` criteria. + items: + type: string + type: array + hardware_reservation_id: + default: "" + description: |- + The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. + + See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + example: next-available + type: string + hostname: + description: The hostname to use within the operating system. The same hostname + may be used on multiple devices within a project. + type: string + ip_addresses: + default: + - address_family: 4 + public: true + - address_family: 4 + public: false + - address_family: 6 + public: true + description: |- + The `ip_addresses attribute will allow you to specify the addresses you want created with your device. + + The default value configures public IPv4, public IPv6, and private IPv4. + + Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. + + Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. + + For example, to only configure your server with a private IPv4 address, you can send `{ "ip_addresses": [{ "address_family": 4, "public": false }] }`. + + It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. + + For example, `{ "ip_addresses": [..., {"address_family": 4, "public": true, "ip_reservations": ["uuid1", "uuid2"]}] }` + + To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + items: + $ref: './IPAddress.yaml' + type: array + ipxe_script_url: + description: |- + When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. + + See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/ + type: string + locked: + default: false + description: Whether the device should be locked, preventing accidental deletion. + type: boolean + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + no_ssh_keys: + default: false + description: Overrides default behaviour of attaching all of the organization + members ssh keys and project ssh keys to device if no specific keys specified + type: boolean + operating_system: + description: The slug of the operating system to provision. Check the Equinix + Metal operating system documentation for rules that may be imposed per operating + system, including restrictions on IP address options and device plans. + type: string + plan: + description: The slug of the device plan to provision. + type: string + example: "c3.large.x86" + private_ipv4_subnet_size: + default: 28 + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. + format: int32 + type: integer + x-deprecated: true + project_ssh_keys: + description: |+ + A list of UUIDs identifying the device parent project + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + default: 31 + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. Your project must have addresses available for a non-default + request. + format: int32 + type: integer + x-deprecated: true + spot_instance: + type: boolean + description: Create a spot instance. Spot instances are created with a maximum + bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + spot_price_max: + format: float + type: number + example: 1.23 + description: The maximum amount to bid for a spot instance. + ssh_keys: + description: | + A list of new or existing project ssh_keys + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + These keys are added in addition to any keys defined by + `project_ssh_keys` and `user_ssh_keys`. + items: + $ref: './SSHKeyInput.yaml' + type: array + storage: + $ref: './Storage.yaml' + tags: + items: + type: string + type: array + termination_time: + description: | + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + user_ssh_keys: + description: | + A list of UUIDs identifying the users + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + The users must be members of the project or organization. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + userdata: + description: |- + The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. + + See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + type: string + externalDocs: + url: https://metal.equinix.com/developers/docs/servers/user-data/ +required: +- plan +- operating_system diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml new file mode 100644 index 00000000..7396b72d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceHealthRollup.yaml @@ -0,0 +1,16 @@ +properties: + health_rollup: + readOnly: true + type: string + description: Health Status + enum: + - ok + - warning + - critical + updated_at: + readOnly: true + type: string + format: date-time + description: Last update of health status. +type: object +description: Represents a Device Health Status diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml new file mode 100644 index 00000000..ca171496 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceList.yaml @@ -0,0 +1,8 @@ +properties: + devices: + items: + $ref: './Device.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml new file mode 100644 index 00000000..933136da --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUpdateInput.yaml @@ -0,0 +1,36 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + hostname: + type: string + firmware_set_id: + type: string + ipxe_script_url: + type: string + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + spot_instance: + type: boolean + description: Can be set to false to convert a spot-market instance to on-demand. + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/spot-market/#converting-a-spot-market-server-to-on-demand + tags: + items: + type: string + type: array + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml new file mode 100644 index 00000000..6968295c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsage.yaml @@ -0,0 +1,8 @@ +properties: + quantity: + type: string + total: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml new file mode 100644 index 00000000..d266838b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/DeviceUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './DeviceUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml new file mode 100644 index 00000000..3a8b9237 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Disk.yaml @@ -0,0 +1,10 @@ +properties: + device: + type: string + wipeTable: + type: boolean + partitions: + items: + $ref: './Partition.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml new file mode 100644 index 00000000..9b420b33 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Email.yaml @@ -0,0 +1,13 @@ +properties: + address: + type: string + default: + type: boolean + href: + type: string + id: + format: uuid + type: string + verified: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml new file mode 100644 index 00000000..7563066d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/EmailInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + default: + type: boolean +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml new file mode 100644 index 00000000..c8bde23b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Entitlement.yaml @@ -0,0 +1,32 @@ +properties: + description: + type: string + feature_access: + type: object + href: + type: string + id: + format: uuid + type: string + instance_quota: + type: object + ip_quota: + type: object + name: + type: string + project_quota: + default: 0 + type: integer + slug: + type: string + volume_limits: + type: object + volume_quota: + type: object + weight: + type: integer +required: +- id +- slug +- weight +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml new file mode 100644 index 00000000..f940b13d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Error.yaml @@ -0,0 +1,13 @@ +description: Error responses are included with 4xx and 5xx HTTP responses from the + API service. Either "error" or "errors" will be set. +properties: + error: + description: A description of the error that caused the request to fail. + type: string + errors: + description: A list of errors that contributed to the request failing. + items: + description: An error message that contributed to the request failing. + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml new file mode 100644 index 00000000..9f4effd2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Event.yaml @@ -0,0 +1,26 @@ +properties: + body: + type: string + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + interpolated: + type: string + relationships: + items: + $ref: './Href.yaml' + type: array + state: + type: string + type: + type: string + modified_by: + type: object + ip: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml new file mode 100644 index 00000000..75b2d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/EventList.yaml @@ -0,0 +1,8 @@ +properties: + events: + items: + $ref: './Event.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml new file mode 100644 index 00000000..e1559ea3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FabricServiceToken.yaml @@ -0,0 +1,48 @@ +properties: + expires_at: + description: The expiration date and time of the Fabric service token. Once a + service token is expired, it is no longer redeemable. + format: date-time + type: string + id: + description: |- + The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. + For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections + to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will + represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or + Virtual Device to Equinix Metal. + format: uuid + type: string + max_allowed_speed: + description: |- + The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either + an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one + of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs + (Fabric Billed), this will default to 10Gbps. + type: integer + example: 10000000000 + role: + description: Either primary or secondary, depending on which interconnection the service token is associated to. + enum: + - primary + - secondary + type: string + service_token_type: + description: Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested. + enum: + - a_side + - z_side + type: string + state: + description: |- + The state of the service token that corresponds with the service + token state on Fabric. An 'inactive' state refers to a token that has not been + redeemed yet on the Fabric side, an 'active' state refers to a token that has + already been redeemed, and an 'expired' state refers to a token that has reached + its expiry time. + enum: + - inactive + - active + - expired + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml new file mode 100644 index 00000000..dd0203c4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Facility.yaml @@ -0,0 +1,37 @@ +properties: + address: + $ref: './Address.yaml' + code: + type: string + features: + example: + - baremetal + - backend_transfer + - global_ipv4 + items: + enum: + - baremetal + - backend_transfer + - layer_2 + - global_ipv4 + - ibx + type: string + type: array + id: + format: uuid + type: string + ip_ranges: + description: IP ranges registered in facility. Can be used for GeoIP location + example: + - 2604:1380::/36 + - 147.75.192.0/21 + items: + type: string + type: array + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml new file mode 100644 index 00000000..bd9b215c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityInput.yaml @@ -0,0 +1,20 @@ +required: + - facility +properties: + facility: + deprecated: true + description: |- + The datacenter where the device should be created. + + Either metro or facility must be provided. + + The API will accept either a single facility `{ "facility": "f1" }`, or it can be instructed to create the device in the best available datacenter `{ "facility": "any" }`. + + Additionally it is possible to set a prioritized location selection. For example `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + anyOf: + - type: array + items: + type: string + example: ["sv15"] + - type: string + example: "any" \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml new file mode 100644 index 00000000..f7a4af1a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FacilityList.yaml @@ -0,0 +1,6 @@ +properties: + facilities: + items: + $ref: './Facility.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml new file mode 100644 index 00000000..d309cba1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Filesystem.yaml @@ -0,0 +1,4 @@ +properties: + mount: + $ref: './Mount.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml new file mode 100644 index 00000000..2d8bf7cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSet.yaml @@ -0,0 +1,36 @@ +properties: + uuid: + readOnly: true + type: string + description: Firmware Set UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + name: + readOnly: true + type: string + description: Firmware Set Name + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + attributes: + type: array + description: Represents a list of attributes + items: + $ref: "./Attribute.yaml" + component_firmware: + type: array + description: List of components versions + items: + $ref: "./Component.yaml" +required: + - uuid + - name +type: object +description: Represents a Firmware Set diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml new file mode 100644 index 00000000..7e9fe5ee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetList.yaml @@ -0,0 +1,4 @@ +type: array +description: Represents a list of FirmwareSets +items: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml new file mode 100644 index 00000000..47d81795 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetListResponse.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents collection of Firmware Sets +properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + $ref: "./FirmwareSetList.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml new file mode 100644 index 00000000..adb43e43 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/FirmwareSetResponse.yaml @@ -0,0 +1,5 @@ +type: object +description: Represents single Firmware set response +properties: + record: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml new file mode 100644 index 00000000..ac2eaa3b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRange.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + type: integer + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + range: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml new file mode 100644 index 00000000..a0bd661e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/GlobalBgpRangeList.yaml @@ -0,0 +1,6 @@ +properties: + global_bgp_ranges: + items: + $ref: './GlobalBgpRange.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml new file mode 100644 index 00000000..59aa31ff --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservation.yaml @@ -0,0 +1,46 @@ +properties: + created_at: + format: date-time + type: string + custom_rate: + description: Amount that will be charged for every billing_cycle. + example: 1050.5 + format: float + type: number + device: + $ref: './Device.yaml' + facility: + $ref: './Facility.yaml' + href: + type: string + id: + format: uuid + type: string + need_of_service: + description: Whether this Device requires assistance from Equinix Metal. + type: boolean + plan: + $ref: './Plan.yaml' + project: + $ref: './Project.yaml' + provisionable: + description: Whether the reserved server is provisionable or not. Spare devices + can't be provisioned unless they are activated first. + type: boolean + short_id: + description: Short version of the ID. + format: string + type: string + spare: + description: Whether the Hardware Reservation is a spare. Spare Hardware Reservations + are used when a Hardware Reservations requires service from Equinix Metal + type: boolean + switch_uuid: + description: Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + termination_time: + description: Expiration date for the reservation. + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml new file mode 100644 index 00000000..1ffd5b75 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/HardwareReservationList.yaml @@ -0,0 +1,8 @@ +properties: + hardware_reservations: + items: + $ref: './HardwareReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml new file mode 100644 index 00000000..bbe7e220 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Href.yaml @@ -0,0 +1,6 @@ +properties: + href: + type: string +required: +- href +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml new file mode 100644 index 00000000..90e98687 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAddress.yaml @@ -0,0 +1,27 @@ +properties: + address_family: + description: Address Family for IP Address + enum: + - 4 + - 6 + example: 4 + format: int32 + type: integer + cidr: + description: Cidr Size for the IP Block created. Valid values depends on + the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 + for IPv6 addresses) + example: 28 + format: int32 + type: integer + ip_reservations: + description: UUIDs of any IP reservations to use when assigning IPs + items: + type: string + type: array + public: + default: true + description: Address Type for IP Address + example: false + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml new file mode 100644 index 00000000..efce269a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignment.yaml @@ -0,0 +1,57 @@ +properties: + address: + type: string + address_family: + type: integer + assigned_to: + $ref: './Href.yaml' + cidr: + type: integer + created_at: + format: date-time + type: string + enabled: + type: boolean + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP address is in + netmask: + type: string + network: + type: string + parent_block: + $ref: './ParentBlock.yaml' + public: + type: boolean + state: + type: string + enum: + - pending + - active + - deleting + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + Describes the current configuration state of this IP on the network. + next_hop: + type: string + format: ipv4 + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml new file mode 100644 index 00000000..90efc5ee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + customdata: + type: object +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml new file mode 100644 index 00000000..94f11aeb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml new file mode 100644 index 00000000..47556d84 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAssignmentUpdateInput.yaml @@ -0,0 +1,10 @@ +properties: + details: + type: string + customdata: + type: object + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml new file mode 100644 index 00000000..1bb6642f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPAvailabilitiesList.yaml @@ -0,0 +1,6 @@ +properties: + available: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml new file mode 100644 index 00000000..848adb57 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservation.yaml @@ -0,0 +1,83 @@ +properties: + addon: + type: boolean + address: + type: string + address_family: + type: integer + assignments: + items: + $ref: './IPAssignment.yaml' + type: array + available: + type: string + bill: + type: boolean + cidr: + type: integer + created_at: + format: date-time + type: string + customdata: + type: object + enabled: + type: boolean + details: + type: string + facility: + allOf: + - $ref: './Facility.yaml' + - description: The facility the IP reservation is in. If the facility the IP reservation + was requested in is in a metro, a metro value will also be set, and the subsequent + IP reservation can be used on a metro level. Can be null if requesting an + IP reservation in a metro. + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metal_gateway: + $ref: './MetalGatewayLite.yaml' + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP reservation is in. As long as the IP reservation + has a metro, it can be used on a metro level. Can be null if requesting an + IP reservation in a facility that is not in a metro. + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + project_lite: + $ref: './Href.yaml' + requested_by: + $ref: './Href.yaml' + public: + type: boolean + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - global_ipv4 + - public_ipv4 + - private_ipv4 + - public_ipv6 +type: object +additionalProperties: false +required: + - type diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml new file mode 100644 index 00000000..56393f25 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationList.yaml @@ -0,0 +1,10 @@ +properties: + ip_addresses: + items: + anyOf: + - $ref: './IPReservation.yaml' + - $ref: './VrfIpReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml new file mode 100644 index 00000000..d76c68fe --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/IPReservationRequestInput.yaml @@ -0,0 +1,27 @@ +properties: + comments: + type: string + customdata: + type: object + details: + type: string + facility: + type: string + fail_on_approval_required: + type: boolean + metro: + description: The code of the metro you are requesting the IP reservation in. + example: SV + type: string + quantity: + type: integer + tags: + items: + type: string + type: array + type: + type: string +required: +- type +- quantity +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml new file mode 100644 index 00000000..97c166be --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InstancesBatchCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + batches: + items: + allOf: + - properties: + hostnames: + items: + type: string + type: array + quantity: + type: integer + description: The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. + - oneOf: + - $ref: 'DeviceCreateInMetroInput.yaml' + - $ref: 'DeviceCreateInFacilityInput.yaml' + type: array +type: object + diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml new file mode 100644 index 00000000..191a4414 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Interconnection.yaml @@ -0,0 +1,78 @@ +properties: + contact_email: + type: string + description: + type: string + facility: + $ref: './Href.yaml' + id: + format: uuid + type: string + metro: + allOf: + - $ref: './Metro.yaml' + description: |- + The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, + this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports + as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), + this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + organization: + $ref: './Href.yaml' + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array + description: For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). + redundancy: + type: string + enum: + - primary + - redundant + description: Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. + service_tokens: + items: + $ref: './FabricServiceToken.yaml' + type: array + description: For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. + There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. + speed: + description: For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). + type: integer + example: 10000000000 + status: + type: string + tags: + items: + type: string + type: array + token: + format: uuid + type: string + description: This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. + type: + type: string + enum: + - shared + - dedicated + description: The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + requested_by: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml new file mode 100644 index 00000000..5683309b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionList.yaml @@ -0,0 +1,8 @@ +properties: + interconnections: + items: + $ref: './Interconnection.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml new file mode 100644 index 00000000..be1d7f52 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPort.yaml @@ -0,0 +1,39 @@ +properties: + id: + format: uuid + type: string + organization: + $ref: './Href.yaml' + role: + description: Either 'primary' or 'secondary'. + type: string + enum: + - primary + - secondary + status: + type: string + description: For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, + this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the + service token associated is expired. + enum: + - requested + - active + - deleting + - expired + - delete_failed + switch_id: + description: A switch 'short ID' + type: string + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array + name: + type: string + speed: + type: integer + link_status: + type: string + href: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml new file mode 100644 index 00000000..6c86e0c1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionPortList.yaml @@ -0,0 +1,6 @@ +properties: + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml new file mode 100644 index 00000000..75a29f7d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InterconnectionUpdateInput.yaml @@ -0,0 +1,26 @@ +properties: + contact_email: + type: string + description: + type: string + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + redundancy: + description: Updating from 'redundant' to 'primary' will remove a secondary port, + while updating from 'primary' to 'redundant' will add one. + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml new file mode 100644 index 00000000..fb587f0f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Invitation.yaml @@ -0,0 +1,37 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + invitation: + $ref: './Href.yaml' + invited_by: + $ref: './Href.yaml' + invitee: + type: string + format: email + nonce: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml new file mode 100644 index 00000000..3461ddcb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationInput.yaml @@ -0,0 +1,26 @@ +properties: + invitee: + type: string + format: email + message: + type: string + organization_id: + type: string + format: uuid + projects_ids: + items: + type: string + format: uuid + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array +required: +- invitee +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml new file mode 100644 index 00000000..5077f623 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvitationList.yaml @@ -0,0 +1,6 @@ +properties: + invitations: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml new file mode 100644 index 00000000..ec764a0e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Invoice.yaml @@ -0,0 +1,41 @@ +properties: + amount: + format: float + type: number + balance: + format: float + type: number + created_on: + format: date + type: string + credit_amount: + format: float + type: number + credits_applied: + format: float + type: number + currency: + example: USD + type: string + due_on: + format: date + type: string + id: + format: uuid + type: string + items: + items: + $ref: './LineItem.yaml' + type: array + number: + type: string + project: + $ref: './ProjectIdName.yaml' + reference_number: + type: string + status: + type: string + target_date: + format: date + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml new file mode 100644 index 00000000..16410460 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/InvoiceList.yaml @@ -0,0 +1,6 @@ +properties: + invoices: + items: + $ref: './Invoice.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml new file mode 100644 index 00000000..d16812b6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/License.yaml @@ -0,0 +1,15 @@ +properties: + description: + type: string + id: + format: uuid + type: string + license_key: + type: string + licensee_product: + $ref: './Href.yaml' + project: + $ref: './Href.yaml' + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml new file mode 100644 index 00000000..f1bec3dd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseCreateInput.yaml @@ -0,0 +1,8 @@ +properties: + description: + type: string + licensee_product_id: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml new file mode 100644 index 00000000..a74cf2f0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseList.yaml @@ -0,0 +1,6 @@ +properties: + licenses: + items: + $ref: './License.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml new file mode 100644 index 00000000..11c51efa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LicenseUpdateInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml new file mode 100644 index 00000000..82ae67ad --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/LineItem.yaml @@ -0,0 +1,18 @@ +properties: + amount: + format: float + type: number + currency: + type: string + description: + type: string + details: + type: string + plan: + $ref: './Plan.yaml' + unit: + type: string + unit_price: + format: float + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml new file mode 100644 index 00000000..9adde1ac --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Membership.yaml @@ -0,0 +1,21 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + roles: + items: + type: string + type: array + updated_at: + format: date-time + type: string + user: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml new file mode 100644 index 00000000..6054927a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipInput.yaml @@ -0,0 +1,6 @@ +properties: + role: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml new file mode 100644 index 00000000..81d7735b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MembershipList.yaml @@ -0,0 +1,6 @@ +properties: + memberships: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml new file mode 100644 index 00000000..88a52dc1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Meta.yaml @@ -0,0 +1,18 @@ +properties: + first: + $ref: './Href.yaml' + last: + $ref: './Href.yaml' + next: + $ref: './Href.yaml' + previous: + $ref: './Href.yaml' + self: + $ref: './Href.yaml' + total: + type: integer + current_page: + type: integer + last_page: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml new file mode 100644 index 00000000..4c2d5e62 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Metadata.yaml @@ -0,0 +1,99 @@ +properties: + class: + type: string + customdata: + default: {} + type: object + additionalProperties: true + facility: + description: The facility code of the instance + type: string + hostname: + type: string + id: + format: uuid + type: string + iqn: + type: string + metro: + description: The metro code of the instance + type: string + network: + properties: + addresses: + items: + type: string + type: array + interfaces: + items: + type: object + type: array + network: + properties: + bonding: + properties: + link_aggregation: + type: string + mac: + type: string + mode: + type: integer + type: object + type: object + type: object + operating_system: + type: object + plan: + description: The plan slug of the instance + type: string + private_subnets: + description: An array of the private subnets + items: + type: string + type: array + reserved: + type: boolean + specs: + description: The specs of the plan version of the instance + type: object + ssh_keys: + items: + type: string + type: array + switch_short_id: + type: string + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + tags: + items: + type: string + type: array + volumes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml new file mode 100644 index 00000000..ed0eb307 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGateway.yaml @@ -0,0 +1,32 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './IPReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml new file mode 100644 index 00000000..e4be2e54 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayCreateInput.yaml @@ -0,0 +1,20 @@ +properties: + ip_reservation_id: + description: The UUID of an IP reservation that belongs to the same project as + where the metal gateway will be created in. This field is required unless the + private IPv4 subnet size is specified. + format: uuid + type: string + private_ipv4_subnet_size: + description: |- + The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. + Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. + type: integer + virtual_network_id: + description: The UUID of a metro virtual network that belongs to the same project + as where the metal gateway will be created in. + format: uuid + type: string +required: +- virtual_network_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml new file mode 100644 index 00000000..dea3a00c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayElasticIpCreateInput.yaml @@ -0,0 +1,24 @@ +properties: + address: + type: string + description: An IP address (or IP Address range) contained within one of the project's IP Reservations + example: "147.75.234.8/31" + next_hop: + type: string + format: ipv4 + description: An IP address contained within the Metal Gateways' IP Reservation range. + example: "192.168.12.13" + customdata: + type: object + additionalProperties: true + description: Optional User-defined JSON object value. + tags: + items: + type: string + type: array + description: Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. + example: [NY,prod,public] +required: +- address +- next_hop +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml new file mode 100644 index 00000000..3b66ccdc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayList.yaml @@ -0,0 +1,10 @@ +properties: + metal_gateways: + items: + anyOf: + - $ref: './MetalGateway.yaml' + - $ref: './VrfMetalGateway.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml new file mode 100644 index 00000000..ce42cc15 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetalGatewayLite.yaml @@ -0,0 +1,35 @@ +properties: + created_at: + format: date-time + type: string + gateway_address: + description: The gateway address with subnet CIDR value for this Metal Gateway. + For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 + would have a gateway address of 10.1.2.1/27. + type: string + example: 10.1.2.1/27 + href: + type: string + id: + format: uuid + type: string + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + vlan: + description: 'The VLAN id of the Virtual Network record associated to this Metal + Gateway.' + type: integer + example: 1001 +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml new file mode 100644 index 00000000..c98a13f8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Metro.yaml @@ -0,0 +1,11 @@ +properties: + code: + type: string + country: + type: string + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml new file mode 100644 index 00000000..0c6ebac5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetroInput.yaml @@ -0,0 +1,9 @@ +required: + - metro +properties: + metro: + description: |- + Metro code or ID of where the instance should be provisioned in. + Either metro or facility must be provided. + type: string + example: sv \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml new file mode 100644 index 00000000..e3863ad4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/MetroList.yaml @@ -0,0 +1,6 @@ +properties: + metros: + items: + $ref: './Metro.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml new file mode 100644 index 00000000..916e3161 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Mount.yaml @@ -0,0 +1,12 @@ +properties: + device: + type: string + format: + type: string + point: + type: string + options: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml new file mode 100644 index 00000000..2be80d13 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/NewPassword.yaml @@ -0,0 +1,4 @@ +properties: + new_password: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml new file mode 100644 index 00000000..eb027d83 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystem.yaml @@ -0,0 +1,35 @@ +properties: + distro: + type: string + distro_label: + type: string + id: + format: uuid + type: string + licensed: + description: Licenced OS is priced according to pricing property + type: boolean + name: + type: string + preinstallable: + description: Servers can be already preinstalled with OS in order to shorten provision + time. + type: boolean + pricing: + description: This object contains price per time unit and optional multiplier + value if licence price depends on hardware plan or components (e.g. number of + cores) + type: object + provisionable_on: + items: + type: string + type: array + slug: + type: string + version: + type: string + default_operating_system: + description: Default operating system for the distro. + readOnly: true + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml new file mode 100644 index 00000000..01793610 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OperatingSystemList.yaml @@ -0,0 +1,6 @@ +properties: + operating_systems: + items: + $ref: './OperatingSystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml new file mode 100644 index 00000000..534c0b51 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Organization.yaml @@ -0,0 +1,49 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + created_at: + format: date-time + type: string + credit_amount: + format: float + type: number + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + id: + format: uuid + type: string + logo: + type: string + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + projects: + items: + $ref: './Href.yaml' + type: array + terms: + type: integer + twitter: + type: string + updated_at: + format: date-time + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml new file mode 100644 index 00000000..3f46526c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationInput.yaml @@ -0,0 +1,25 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + logo: + description: The logo for the organization; must be base64-encoded image data + format: byte + type: string + name: + type: string + twitter: + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml new file mode 100644 index 00000000..43d0c9ec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/OrganizationList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + organizations: + items: + $ref: './Organization.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml new file mode 100644 index 00000000..0eeeed3e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ParentBlock.yaml @@ -0,0 +1,10 @@ +properties: + cidr: + type: integer + href: + type: string + netmask: + type: string + network: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml new file mode 100644 index 00000000..f0190354 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Partition.yaml @@ -0,0 +1,9 @@ +properties: + label: + type: string + number: + type: integer + format: int32 + size: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml new file mode 100644 index 00000000..1ead6a67 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethod.yaml @@ -0,0 +1,37 @@ +properties: + billing_address: + $ref: './PaymentMethodBillingAddress.yaml' + card_type: + type: string + cardholder_name: + type: string + created_at: + format: date-time + type: string + created_by_user: + $ref: './Href.yaml' + default: + type: boolean + email: + type: string + expiration_month: + type: string + expiration_year: + type: string + id: + format: uuid + type: string + name: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + type: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml new file mode 100644 index 00000000..e9a84861 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodBillingAddress.yaml @@ -0,0 +1,8 @@ +properties: + country_code_alpha2: + type: string + postal_code: + type: string + street_address: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml new file mode 100644 index 00000000..662f1eb7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodCreateInput.yaml @@ -0,0 +1,11 @@ +properties: + default: + type: boolean + name: + type: string + nonce: + type: string +required: +- name +- nonce +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml new file mode 100644 index 00000000..f6318e40 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodList.yaml @@ -0,0 +1,6 @@ +properties: + payment_methods: + items: + $ref: './PaymentMethod.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml new file mode 100644 index 00000000..01092b0e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PaymentMethodUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + billing_address: + type: object + cardholder_name: + type: string + default: + type: boolean + expiration_month: + type: string + expiration_year: + type: integer + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml new file mode 100644 index 00000000..0b5f1d52 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Plan.yaml @@ -0,0 +1,140 @@ +properties: + available_in: + description: Shows which facilities the plan is available in, and the facility-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Facility + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + available_in_metros: + description: Shows which metros the plan is available in, and the metro-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Metro + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + categories: + description: Categories of the plan, like compute or storage. A Plan can belong to multiple categories. + items: + type: string + type: array + class: + type: string + example: m3.large.x86 + description: + type: string + deployment_types: + items: + type: string + enum: + - on_demand + - spot_market + type: array + minItems: 0 + uniqueItems: true + id: + format: uuid + type: string + legacy: + description: Deprecated. Always return false + type: boolean + x-deprecated: true + line: + type: string + name: + type: string + pricing: + type: object + slug: + type: string + example: m3.large.x86 + specs: + type: object + properties: + cpus: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + memory: + type: object + properties: + total: + type: string + drives: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + enum: + - HDD + - SSD + - NVME + size: + type: string + example: 3.84TB + category: + type: string + enum: + - boot + - cache + - storage + nics: + type: array + items: + type: object + properties: + count: + type: integer + example: 2 + type: + type: string + enum: + - 1Gbps + - 10Gbps + - 25Gbps + features: + type: object + properties: + raid: + type: boolean + txt: + type: boolean + uefi: + type: boolean + type: + description: The plan type + type: string + enum: + - standard + - workload_optimized + - custom +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml new file mode 100644 index 00000000..a22e4dec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PlanList.yaml @@ -0,0 +1,6 @@ +properties: + plans: + items: + $ref: './Plan.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml new file mode 100644 index 00000000..bceaf31b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Port.yaml @@ -0,0 +1,40 @@ +description: Port is a hardware port associated with a reserved or instantiated hardware device. +properties: + bond: + $ref: './BondPortData.yaml' + data: + $ref: './PortData.yaml' + disbond_operation_supported: + description: Indicates whether or not the bond can be broken on the port (when + applicable). + type: boolean + href: + type: string + id: + format: uuid + type: string + name: + type: string + example: bond0 + type: + description: Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports + type: string + enum: + - NetworkPort + - NetworkBondPort + network_type: + description: Composite network type of the bond + type: string + enum: + - 'layer2-bonded' + - 'layer2-individual' + - 'layer3' + - 'hybrid' + - 'hybrid-bonded' + native_virtual_network: + $ref: './VirtualNetwork.yaml' + virtual_networks: + items: + $ref: './Href.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml new file mode 100644 index 00000000..2e08fd80 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortAssignInput.yaml @@ -0,0 +1,8 @@ +properties: + vnid: + description: > + Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself. + type: string + example: "1001" +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml new file mode 100644 index 00000000..175e77c7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortConvertLayer3Input.yaml @@ -0,0 +1,11 @@ +properties: + request_ips: + items: + properties: + address_family: + type: integer + public: + type: boolean + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml new file mode 100644 index 00000000..adf41a01 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortData.yaml @@ -0,0 +1,8 @@ +properties: + mac: + description: MAC address is set for NetworkPort ports + type: string + bonded: + description: Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml new file mode 100644 index 00000000..889b3486 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignment.yaml @@ -0,0 +1,24 @@ +properties: + created_at: + format: date-time + type: string + id: + format: uuid + type: string + native: + type: boolean + port: + $ref: './Href.yaml' + state: + enum: + - assigned + - unassigning + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './Href.yaml' + vlan: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml new file mode 100644 index 00000000..0d5e8a2b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatch.yaml @@ -0,0 +1,45 @@ +properties: + created_at: + format: date-time + type: string + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + port: + $ref: './Port.yaml' + quantity: + type: integer + state: + enum: + - queued + - in_progress + - completed + - failed + type: string + updated_at: + format: date-time + type: string + vlan_assignments: + items: + properties: + id: + format: uuid + type: string + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: integer + type: object + type: array + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml new file mode 100644 index 00000000..a6bc0925 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + vlan_assignments: + items: + properties: + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: string + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml new file mode 100644 index 00000000..af95e08f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentBatchList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './PortVlanAssignmentBatch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml new file mode 100644 index 00000000..d058582e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/PortVlanAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + vlan_assignments: + items: + $ref: './PortVlanAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml new file mode 100644 index 00000000..3ee880b0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Project.yaml @@ -0,0 +1,62 @@ +properties: + bgp_config: + $ref: './Href.yaml' + created_at: + format: date-time + type: string + customdata: + type: object + devices: + items: + $ref: './Href.yaml' + type: array + id: + format: uuid + type: string + invitations: + items: + $ref: './Href.yaml' + type: array + max_devices: + type: object + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + network_status: + type: object + organization: + $ref: './Organization.yaml' + payment_method: + $ref: './Href.yaml' + ssh_keys: + items: + $ref: './Href.yaml' + type: array + updated_at: + format: date-time + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + type: + type: string + description: The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml new file mode 100644 index 00000000..e138c704 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateFromRootInput.yaml @@ -0,0 +1,28 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + organization_id: + format: uuid + type: string + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml new file mode 100644 index 00000000..5dd2966b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectCreateInput.yaml @@ -0,0 +1,25 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml new file mode 100644 index 00000000..3a06d9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectIdName.yaml @@ -0,0 +1,7 @@ +properties: + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml new file mode 100644 index 00000000..a4c8a58c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + projects: + items: + $ref: './Project.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml new file mode 100644 index 00000000..7acaad09 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUpdateInput.yaml @@ -0,0 +1,18 @@ +properties: + backend_transfer_enabled: + type: boolean + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml new file mode 100644 index 00000000..cec80ec2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsage.yaml @@ -0,0 +1,20 @@ +properties: + facility: + type: string + name: + type: string + plan: + type: string + plan_version: + type: string + price: + type: string + quantity: + type: string + total: + type: string + type: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml new file mode 100644 index 00000000..827d8ad2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ProjectUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './ProjectUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml new file mode 100644 index 00000000..c2a892f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Raid.yaml @@ -0,0 +1,10 @@ +properties: + devices: + items: + type: string + type: array + level: + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml new file mode 100644 index 00000000..40928232 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/RecoveryCodeList.yaml @@ -0,0 +1,6 @@ +properties: + recovery_codes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml new file mode 100644 index 00000000..135e59d0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKey.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + entity: + $ref: './Href.yaml' + fingerprint: + type: string + href: + type: string + id: + format: uuid + type: string + key: + type: string + label: + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..2aab7ffa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + instances_ids: + description: |- + List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging + to entity will be included + items: + format: uuid + type: string + type: array + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml new file mode 100644 index 00000000..fb5db698 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyInput.yaml @@ -0,0 +1,10 @@ +properties: + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml new file mode 100644 index 00000000..8a99546c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SSHKeyList.yaml @@ -0,0 +1,6 @@ +properties: + ssh_keys: + items: + $ref: './SSHKey.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml new file mode 100644 index 00000000..12e996eb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemRequest.yaml @@ -0,0 +1,15 @@ +properties: + amount: + format: float + type: number + metro_id: + format: uuid + type: string + plan_id: + format: uuid + type: string + quantity: + type: integer + term: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml new file mode 100644 index 00000000..06b2f9eb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationItemResponse.yaml @@ -0,0 +1,29 @@ +properties: + amount: + format: float + type: number + id: + type: string + metro_code: + type: string + metro_id: + format: uuid + type: string + metro_name: + type: string + plan_id: + format: uuid + type: string + plan_name: + type: string + plan_slug: + type: string + plan_categories: + type: array + items: + type: string + quantity: + type: integer + term: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml new file mode 100644 index 00000000..c0960915 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationList.yaml @@ -0,0 +1,6 @@ +properties: + reservations: + items: + $ref: './SelfServiceReservationResponse.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml new file mode 100644 index 00000000..60cbfb0b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SelfServiceReservationResponse.yaml @@ -0,0 +1,40 @@ +properties: + created_at: + format: date-time + type: string + item: + items: + $ref: './SelfServiceReservationItemResponse.yaml' + type: array + notes: + type: string + organization: + type: string + organization_id: + format: uuid + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + project: + type: string + project_id: + format: uuid + type: string + start_date: + format: date-time + type: string + status: + type: string + total_cost: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml new file mode 100644 index 00000000..83566aa5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/ServerInfo.yaml @@ -0,0 +1,14 @@ +properties: + facility: + deprecated: true + type: string + metro: + description: The metro ID or code to check the capacity in. + type: string + plan: + description: The plan ID or slug to check the capacity of. + type: string + quantity: + description: The number of servers to check the capacity of. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml new file mode 100644 index 00000000..1164d10c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotPricesReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml new file mode 100644 index 00000000..e0a9b36b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotMarketPricesPerMetroReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml new file mode 100644 index 00000000..3dae22bc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketPricesPerMetroReport.yaml @@ -0,0 +1,16 @@ +properties: + am: + $ref: './SpotPricesPerFacility.yaml' + ch: + $ref: './SpotPricesPerFacility.yaml' + da: + $ref: './SpotPricesPerFacility.yaml' + la: + $ref: './SpotPricesPerFacility.yaml' + ny: + $ref: './SpotPricesPerFacility.yaml' + sg: + $ref: './SpotPricesPerFacility.yaml' + sv: + $ref: './SpotPricesPerFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml new file mode 100644 index 00000000..bea87517 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequest.yaml @@ -0,0 +1,30 @@ +properties: + created_at: + format: date-time + type: string + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + instances: + $ref: './Href.yaml' + max_bid_price: + format: float + type: number + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the spot market request was created in + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml new file mode 100644 index 00000000..085397cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestCreateInput.yaml @@ -0,0 +1,76 @@ +properties: + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + deprecated: true + items: + format: uuid + type: string + type: array + instance_parameters: + properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + type: object + description: + type: string + features: + items: + type: string + type: array + hostname: + type: string + hostnames: + items: + type: string + type: array + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + no_ssh_keys: + type: boolean + operating_system: + type: string + plan: + type: string + private_ipv4_subnet_size: + type: integer + project_ssh_keys: + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + type: integer + tags: + items: + type: string + type: array + termination_time: + format: date-time + type: string + user_ssh_keys: + description: The UUIDs of users whose SSH keys should be included on the provisioned + device. + items: + format: uuid + type: string + type: array + userdata: + type: string + type: object + max_bid_price: + format: float + type: number + metro: + description: The metro ID or code the spot market request will be created in. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml new file mode 100644 index 00000000..3ed96cd0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotMarketRequestList.yaml @@ -0,0 +1,6 @@ +properties: + spot_market_requests: + items: + $ref: './SpotMarketRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml new file mode 100644 index 00000000..27674b98 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapoints.yaml @@ -0,0 +1,6 @@ +properties: + datapoints: + items: + $ref: './SpotPricesDatapointsList.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml new file mode 100644 index 00000000..038972f5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesDatapointsList.yaml @@ -0,0 +1,3 @@ +items: + type: number +type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml new file mode 100644 index 00000000..3a3c8522 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesHistoryReport.yaml @@ -0,0 +1,4 @@ +properties: + prices_history: + $ref: './SpotPricesDatapoints.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml new file mode 100644 index 00000000..6c9b0b0a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerBaremetal.yaml @@ -0,0 +1,5 @@ +properties: + price: + format: float + type: number +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml new file mode 100644 index 00000000..a0ba3def --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerFacility.yaml @@ -0,0 +1,20 @@ +properties: + baremetal_0: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_1: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_3: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_s: + $ref: './SpotPricesPerBaremetal.yaml' + c2.medium.x86: + $ref: './SpotPricesPerBaremetal.yaml' + m2.xlarge.x86: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml new file mode 100644 index 00000000..e72795c2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesPerNewFacility.yaml @@ -0,0 +1,4 @@ +properties: + baremetal_1e: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml new file mode 100644 index 00000000..15b59111 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SpotPricesReport.yaml @@ -0,0 +1,30 @@ +properties: + ams1: + $ref: './SpotPricesPerFacility.yaml' + atl1: + $ref: './SpotPricesPerNewFacility.yaml' + dfw1: + $ref: './SpotPricesPerNewFacility.yaml' + ewr1: + $ref: './SpotPricesPerFacility.yaml' + fra1: + $ref: './SpotPricesPerNewFacility.yaml' + iad1: + $ref: './SpotPricesPerNewFacility.yaml' + lax1: + $ref: './SpotPricesPerNewFacility.yaml' + nrt1: + $ref: './SpotPricesPerFacility.yaml' + ord1: + $ref: './SpotPricesPerNewFacility.yaml' + sea1: + $ref: './SpotPricesPerNewFacility.yaml' + sin1: + $ref: './SpotPricesPerNewFacility.yaml' + sjc1: + $ref: './SpotPricesPerFacility.yaml' + syd1: + $ref: './SpotPricesPerNewFacility.yaml' + yyz1: + $ref: './SpotPricesPerNewFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml new file mode 100644 index 00000000..a800531d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Storage.yaml @@ -0,0 +1,14 @@ +properties: + disks: + items: + $ref: './Disk.yaml' + type: array + raid: + items: + $ref: './Raid.yaml' + type: array + filesystems: + items: + $ref: './Filesystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml new file mode 100644 index 00000000..27a7a640 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/SupportRequestInput.yaml @@ -0,0 +1,20 @@ +properties: + device_id: + type: string + message: + type: string + priority: + enum: + - urgent + - high + - medium + - low + type: string + project_id: + type: string + subject: + type: string +required: +- subject +- message +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml new file mode 100644 index 00000000..86f4eb42 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequest.yaml @@ -0,0 +1,17 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + target_organization: + $ref: './Href.yaml' + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml new file mode 100644 index 00000000..21584bd9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestInput.yaml @@ -0,0 +1,5 @@ +properties: + target_organization_id: + format: uuid + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml new file mode 100644 index 00000000..2e22bdbb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/TransferRequestList.yaml @@ -0,0 +1,6 @@ +properties: + transfers: + items: + $ref: './TransferRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml new file mode 100644 index 00000000..01eec3c4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UpdateEmailInput.yaml @@ -0,0 +1,4 @@ +properties: + default: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml new file mode 100644 index 00000000..b81db710 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/User.yaml @@ -0,0 +1,54 @@ +properties: + avatar_thumb_url: + type: string + avatar_url: + type: string + created_at: + format: date-time + type: string + customdata: + type: object + default_organization_id: + type: string + format: uuid + default_project_id: + type: string + format: uuid + email: + type: string + emails: + items: + $ref: './Href.yaml' + type: array + first_name: + type: string + fraud_score: + type: string + full_name: + type: string + href: + type: string + id: + format: uuid + type: string + last_login_at: + format: date-time + type: string + last_name: + type: string + max_organizations: + type: integer + max_projects: + type: integer + phone_number: + type: string + short_id: + type: string + timezone: + type: string + two_factor_auth: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml new file mode 100644 index 00000000..b7d08229 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserCreateInput.yaml @@ -0,0 +1,45 @@ +properties: + avatar: + format: binary + type: string + company_name: + type: string + company_url: + type: string + customdata: + type: object + emails: + items: + $ref: './EmailInput.yaml' + type: array + first_name: + type: string + last_name: + type: string + level: + type: string + password: + type: string + phone_number: + type: string + social_accounts: + type: object + timezone: + type: string + title: + type: string + two_factor_auth: + type: string + verified_at: + format: date-time + type: string + invitation_id: + type: string + format: uuid + nonce: + type: string +required: +- first_name +- last_name +- emails +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml new file mode 100644 index 00000000..3e909c3c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserLimited.yaml @@ -0,0 +1,21 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + avatar_url: + description: Avatar URL of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string +required: + - id + - short_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml new file mode 100644 index 00000000..5ed5b73e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + users: + items: + $ref: './User.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml new file mode 100644 index 00000000..333edef4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserLite.yaml @@ -0,0 +1,38 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + created_at: + description: When the user was created + format: date-time + type: string + email: + description: Primary email address of the User + type: string + first_name: + description: First name of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string + last_name: + description: Last name of the User + type: string + short_id: + description: Short ID of the User + type: string + updated_at: + description: When the user details were last updated + format: date-time + type: string +required: +- id +- short_id +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml new file mode 100644 index 00000000..6ba885f6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/UserUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + customdata: + type: object + first_name: + type: string + last_name: + type: string + password: + type: string + phone_number: + type: string + timezone: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml new file mode 100644 index 00000000..8acfc608 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Userdata.yaml @@ -0,0 +1,4 @@ +properties: + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml new file mode 100644 index 00000000..d32c848c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VerifyEmail.yaml @@ -0,0 +1,7 @@ +properties: + user_token: + description: User verification token + type: string + writeOnly: true +required: + - user_token diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml new file mode 100644 index 00000000..2c12357e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuit.yaml @@ -0,0 +1,3 @@ +oneOf: +- $ref: './VlanVirtualCircuit.yaml' +- $ref: './VrfVirtualCircuit.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..d4b72f38 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitCreateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitCreateInput.yaml' + - $ref: 'VrfVirtualCircuitCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml new file mode 100644 index 00000000..03ecf33e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..5205301a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualCircuitUpdateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitUpdateInput.yaml' + - $ref: 'VrfVirtualCircuitUpdateInput.yaml' diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml new file mode 100644 index 00000000..cb0c698f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetwork.yaml @@ -0,0 +1,39 @@ +properties: + assigned_to: + $ref: './Href.yaml' + assigned_to_virtual_circuit: + description: True if the virtual network is attached to a virtual circuit. False + if not. + type: boolean + description: + type: string + facility: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + instances: + description: A list of instances with ports currently associated to this Virtual + Network. + items: + $ref: './Href.yaml' + type: array + metal_gateways: + description: A list of metal gateways currently associated to this Virtual Network. + items: + $ref: './MetalGatewayLite.yaml' + type: array + metro: + $ref: './Href.yaml' + metro_code: + description: The Metro code of the metro in which this Virtual Network is defined. + type: string + vxlan: + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml new file mode 100644 index 00000000..1a74eca6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkCreateInput.yaml @@ -0,0 +1,23 @@ +properties: + description: + type: string + facility: + deprecated: true + description: The UUID (or facility code) for the Facility in which to create this + Virtual network. + type: string + metro: + description: The UUID (or metro code) for the Metro in which to create this Virtual + Network. + type: string + vxlan: + description: VLAN ID between 2-3999. Must be unique for the project within the + Metro in which this Virtual Network is being created. If no value is specified, + the next-available VLAN ID in the range 1000-1999 will be automatically selected. + example: 1099 + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml new file mode 100644 index 00000000..8d3fd950 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VirtualNetworkList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_networks: + items: + $ref: './VirtualNetwork.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml new file mode 100644 index 00000000..a68635e0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanFabricVcCreateInput.yaml @@ -0,0 +1,61 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. + We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), + so the origin of the interconnection can be a different metro set here. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vlans: + description: A list of one or two metro-based VLANs that will be set on the virtual circuits of primary + and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. + VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml new file mode 100644 index 00000000..55324321 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuit.yaml @@ -0,0 +1,65 @@ +properties: + bill: + type: boolean + default: false + description: True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. + description: + type: string + id: + format: uuid + type: string + name: + type: string + nni_vlan: + type: integer + port: + $ref: './Href.yaml' + project: + $ref: './Href.yaml' + speed: + description: For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on + Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. + Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + type: integer + status: + type: string + description: The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated + to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. + For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. + Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, + it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, + or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the + virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_customer_vlan + - activating + - changing_vlan + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_vlan_failed + - deactivation_failed + - delete_failed + tags: + items: + type: string + type: array + type: + type: string + enum: + - vlan + virtual_network: + $ref: './Href.yaml' + vnid: + type: integer + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..d5f9c473 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitCreateInput.yaml @@ -0,0 +1,28 @@ +properties: + description: + type: string + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: integer + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project (sent as integer). + format: uuid + type: string +type: object +required: + - project_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..1d88bf77 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VlanVirtualCircuitUpdateInput.yaml @@ -0,0 +1,17 @@ +properties: + description: + type: string + name: + type: string + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project. + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml new file mode 100644 index 00000000..85f576ea --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/Vrf.yaml @@ -0,0 +1,52 @@ +properties: + id: + format: uuid + type: string + name: + type: string + description: + description: Optional field that can be set to describe the VRF + type: string + bill: + type: boolean + default: false + description: True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + local_asn: + description: A 4-byte ASN associated with the VRF. + type: integer + format: int32 + virtual_circuits: + description: Virtual circuits that are in the VRF + type: array + items: + $ref: './VrfVirtualCircuit.yaml' + ip_ranges: + $ref: './VrfIpRangeList.yaml' + project: + $ref: './Project.yaml' + metro: + $ref: './Metro.yaml' + created_by: + $ref: './User.yaml' + href: + type: string + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml new file mode 100644 index 00000000..081a63b6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfCreateInput.yaml @@ -0,0 +1,29 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeCreateInput.yaml' + local_asn: + type: integer + format: int32 + metro: + description: The UUID (or metro code) for the Metro in which to create this VRF. + type: string + name: + type: string + tags: + items: + type: string + type: array +required: +- metro +- name diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml new file mode 100644 index 00000000..cd026b18 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfFabricVcCreateInput.yaml @@ -0,0 +1,61 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. + We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), + so the origin of the interconnection can be a different metro set here. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vrfs: + description: This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on + creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, + while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + items: + format: uuid + type: string + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +- vrfs +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml new file mode 100644 index 00000000..6f69292b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeCreateInput.yaml @@ -0,0 +1,6 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml new file mode 100644 index 00000000..db7e7211 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeList.yaml @@ -0,0 +1,4 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml new file mode 100644 index 00000000..352c55bd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpRangeUpdateInput.yaml @@ -0,0 +1,10 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. + Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. + Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\'s associated Metal Gateways or Virtual Circuits. + If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. + Specifying a value of `[]` will remove all existing IP Ranges from the VRF. diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml new file mode 100644 index 00000000..f17bd109 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservation.yaml @@ -0,0 +1,59 @@ +properties: + address_family: + type: integer + cidr: + type: integer + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + details: + type: string + href: + type: string + id: + format: uuid + type: string + metal_gateway: + $ref: './MetalGatewayLite.yaml' + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + public: + type: boolean + management: + type: boolean + manageable: + type: boolean + customdata: + type: object + bill: + type: boolean + project_lite: + $ref: './Project.yaml' + address: + type: string + gateway: + type: string + metro: + $ref: './Metro.yaml' +required: + - vrf + - type +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml new file mode 100644 index 00000000..c96ccc19 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationCreateInput.yaml @@ -0,0 +1,30 @@ +properties: + cidr: + type: integer + example: 16 + description: The size of the VRF IP Reservation's subnet + customdata: + type: object + details: + type: string + network: + type: string + example: "10.1.2.0" + description: "The starting address for this VRF IP Reservation's subnet" + tags: + items: + type: string + type: array + type: + type: string + example: vrf + description: "Must be set to 'vrf'" + vrf_id: + type: string + format: uuid + description: The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. +required: + - cidr + - network + - type + - vrf_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml new file mode 100644 index 00000000..bd84ddc8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfIpReservationList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './VrfIpReservation.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml new file mode 100644 index 00000000..148036ed --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfList.yaml @@ -0,0 +1,6 @@ +properties: + vrfs: + items: + $ref: './Vrf.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml new file mode 100644 index 00000000..5864d01e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGateway.yaml @@ -0,0 +1,34 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './VrfIpReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' + vrf: + $ref: './Vrf.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml new file mode 100644 index 00000000..9e205084 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfMetalGatewayCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + ip_reservation_id: + description: The UUID an a VRF IP Reservation that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation + and the Virtual Network must reside in the same Metro. + format: uuid + type: string + virtual_network_id: + description: THe UUID of a Metro Virtual Network that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the Virtual Network + and the VRF IP Reservation must reside in the same metro. + format: uuid + type: string +required: + - ip_reservation_id + - virtual_network_id diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml new file mode 100644 index 00000000..88bdf509 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRoute.yaml @@ -0,0 +1,61 @@ +properties: + id: + description: The unique identifier for the newly-created resource + format: uuid + type: string + readOnly: true + example: e1ff9c2b-051a-4688-965f-153e274f77e0 + status: + description: The status of the route. Potential values are "pending", "active", "deleting", and "error", representing various lifecycle states of the route and whether or not it has been successfully configured on the network + type: string + readOnly: true + example: active + enum: + - pending + - active + - deleting + - error + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation + type: string + example: 0.0.0.0/0 + next_hop: + description: The next-hop IPv4 address for the route + type: string + format: ipv4 + example: 192.168.1.254 + type: + description: VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported + type: string + readOnly: true + example: static + enum: + - static + created_at: + format: date-time + type: string + readOnly: true + updated_at: + format: date-time + type: string + readOnly: true + metal_gateway: + description: A link to the Metal Gateway to which this VRF Route is associated + readOnly: true + $ref: './VrfMetalGateway.yaml' + virtual_network: + description: A link to the Virtual Network to which this VRF Route is associated, through the Metal Gateway + readOnly: true + $ref: './VirtualNetwork.yaml' + vrf: + description: A link to the VRF within which this route exists + readOnly: true + $ref: './Vrf.yaml' + href: + type: string + readOnly: true + example: /routes/e1ff9c2b-051a-4688-965f-153e274f77e0 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml new file mode 100644 index 00000000..b9e672fb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteCreateInput.yaml @@ -0,0 +1,17 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array +required: +- prefix +- next_hop diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml new file mode 100644 index 00000000..1c9f021e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteList.yaml @@ -0,0 +1,8 @@ +properties: + routes: + items: + $ref: './VrfRoute.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml new file mode 100644 index 00000000..db195555 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfRouteUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml new file mode 100644 index 00000000..4dd5a4e3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfUpdateInput.yaml @@ -0,0 +1,24 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeUpdateInput.yaml' + local_asn: + type: integer + format: int32 + description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. + name: + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml new file mode 100644 index 00000000..2bb47b5b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuit.yaml @@ -0,0 +1,90 @@ +required: +- vrf +properties: + customer_ip: + description: >- + An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + id: + format: uuid + type: string + md5: + description: >- + The MD5 password for the BGP peering in plaintext (not a checksum). + type: string + metal_ip: + description: >- + An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + port: + $ref: './Href.yaml' + nni_vlan: + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + project: + $ref: './Href.yaml' + speed: + description: integer representing bps speed + type: integer + status: + type: string + description: >- + The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. + However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once + the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found + the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or + metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on + creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF + Virtual Circuit has any of its peering details updated. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_peering_details + - activating + - changing_peering_details + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_peering_details_failed + - deactivation_failed + - delete_failed + subnet: + description: >- + The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..19381664 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitCreateInput.yaml @@ -0,0 +1,65 @@ +properties: + customer_ip: + description: An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + nullable: true + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: integer + subnet: + description: The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array + vrf: + description: The UUID of the VRF that will be associated with the Virtual Circuit. + format: uuid + type: string +type: object +required: +- nni_vlan +- peer_asn +- project_id +- subnet +- vrf diff --git a/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..4058c7c0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/components/schemas/VrfVirtualCircuitUpdateInput.yaml @@ -0,0 +1,48 @@ +properties: + customer_ip: + description: >- + An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: >- + An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + subnet: + description: >- + The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.fetched/openapi3.yaml b/spec/services/metalv1/oas3.fetched/openapi3.yaml new file mode 100644 index 00000000..9822cd39 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/openapi3.yaml @@ -0,0 +1,1128 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Metal API + contact: + email: support@equinixmetal.com + name: Equinix Metal API Team + description: | + # Introduction + Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. + + The API allows you to programmatically interact with all + of your Equinix Metal resources, including devices, networks, addresses, organizations, + projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. + + The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . + + # Common Parameters + + The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. + + ## Pagination + + Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. + + The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. + + ## Sorting + + Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). + + ## Filtering + + Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. + + For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 + ``` + + Only IP addresses with the `type` field set to `public_ipv4` will be returned. + + ## Searching + + Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. + + To search resources you can use the `search` query parameter. + + ## Include and Exclude + + For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. + + ```json + { + ... + "project": { + "href": "/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd" + } + } + ``` + + If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. + + For example: + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=projects + ``` + + The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. + + To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=emails,projects,memberships + ``` + + You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=memberships.projects + ``` + + To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + license: + name: Equinix Metal + url: https://metal.equinix.com/legal/ + termsOfService: https://metal.equinix.com/legal/ +security: + - x_auth_token: [] +servers: + - url: https://api.equinix.com/metal/v1 +components: + parameters: + DeviceSearch: + $ref: './components/parameters/DeviceSearch.yaml' + ProjectName: + $ref: './components/parameters/ProjectName.yaml' + Page: + $ref: './components/parameters/Page.yaml' + PerPage: + $ref: './components/parameters/PerPage.yaml' + Include: + $ref: './components/parameters/Include.yaml' + Exclude: + $ref: './components/parameters/Exclude.yaml' + requestBodies: + InterconnectionCreateInput: + $ref: './components/requestBodies/InterconnectionCreateInput.yaml' + InvitationInput: + $ref: './components/requestBodies/InvitationInput.yaml' + PortAssignInput: + $ref: './components/requestBodies/PortAssignInput.yaml' + SSHKeyCreateInput: + $ref: './components/requestBodies/SSHKeyCreateInput.yaml' + schemas: + Address: + $ref: './components/schemas/Address.yaml' + Attribute: + $ref: './components/schemas/Attribute.yaml' + AttributeData: + $ref: './components/schemas/AttributeData.yaml' + AuthToken: + $ref: './components/schemas/AuthToken.yaml' + AuthTokenInput: + $ref: './components/schemas/AuthTokenInput.yaml' + AuthTokenList: + $ref: './components/schemas/AuthTokenList.yaml' + BGPSessionInput: + $ref: './components/schemas/BGPSessionInput.yaml' + Batch: + $ref: './components/schemas/Batch.yaml' + BatchesList: + $ref: './components/schemas/BatchesList.yaml' + BgpConfig: + $ref: './components/schemas/BgpConfig.yaml' + BgpConfigRequestInput: + $ref: './components/schemas/BgpConfigRequestInput.yaml' + BgpDynamicNeighbor: + $ref: './components/schemas/BgpDynamicNeighbor.yaml' + BgpDynamicNeighborCreateInput: + $ref: './components/schemas/BgpDynamicNeighborCreateInput.yaml' + BgpDynamicNeighborList: + $ref: './components/schemas/BgpDynamicNeighborList.yaml' + BgpNeighborData: + $ref: './components/schemas/BgpNeighborData.yaml' + BgpSession: + $ref: './components/schemas/BgpSession.yaml' + BgpSessionList: + $ref: './components/schemas/BgpSessionList.yaml' + BgpSessionNeighbors: + $ref: './components/schemas/BgpSessionNeighbors.yaml' + CapacityCheckPerFacilityInfo: + $ref: './components/schemas/CapacityCheckPerFacilityInfo.yaml' + CapacityCheckPerFacilityList: + $ref: './components/schemas/CapacityCheckPerFacilityList.yaml' + CapacityCheckPerMetroInfo: + $ref: './components/schemas/CapacityCheckPerMetroInfo.yaml' + CapacityCheckPerMetroList: + $ref: './components/schemas/CapacityCheckPerMetroList.yaml' + CapacityInput: + $ref: './components/schemas/CapacityInput.yaml' + CapacityLevelPerBaremetal: + $ref: './components/schemas/CapacityLevelPerBaremetal.yaml' + CapacityList: + $ref: './components/schemas/CapacityList.yaml' + CapacityReport: + $ref: './components/schemas/CapacityReport.yaml' + Component: + $ref: './components/schemas/Component.yaml' + Coordinates: + $ref: './components/schemas/Coordinates.yaml' + CreateEmailInput: + $ref: './components/schemas/CreateEmailInput.yaml' + CreateSelfServiceReservationRequest: + $ref: './components/schemas/CreateSelfServiceReservationRequest.yaml' + DedicatedPortCreateInput: + $ref: './components/schemas/DedicatedPortCreateInput.yaml' + Device: + $ref: './components/schemas/Device.yaml' + DeviceCreateInput: + $ref: './components/schemas/DeviceCreateInput.yaml' + DeviceHealthRollup: + $ref: './components/schemas/DeviceHealthRollup.yaml' + DeviceCreateInFacilityInput: + $ref: './components/schemas/DeviceCreateInFacilityInput.yaml' + DeviceCreateInMetroInput: + $ref: './components/schemas/DeviceCreateInMetroInput.yaml' + DeviceList: + $ref: './components/schemas/DeviceList.yaml' + DeviceUpdateInput: + $ref: './components/schemas/DeviceUpdateInput.yaml' + DeviceUsage: + $ref: './components/schemas/DeviceUsage.yaml' + DeviceUsageList: + $ref: './components/schemas/DeviceUsageList.yaml' + Email: + $ref: './components/schemas/Email.yaml' + EmailInput: + $ref: './components/schemas/EmailInput.yaml' + Entitlement: + $ref: './components/schemas/Entitlement.yaml' + Error: + $ref: './components/schemas/Error.yaml' + Event: + $ref: './components/schemas/Event.yaml' + EventList: + $ref: './components/schemas/EventList.yaml' + FabricServiceToken: + $ref: './components/schemas/FabricServiceToken.yaml' + Facility: + $ref: './components/schemas/Facility.yaml' + FacilityInput: + $ref: './components/schemas/FacilityInput.yaml' + FacilityList: + $ref: './components/schemas/FacilityList.yaml' + FirmwareSet: + $ref: './components/schemas/FirmwareSet.yaml' + FirmwareSetList: + $ref: './components/schemas/FirmwareSetList.yaml' + FirmwareSetListResponse: + $ref: './components/schemas/FirmwareSetListResponse.yaml' + FirmwareSetResponse: + $ref: './components/schemas/FirmwareSetResponse.yaml' + GlobalBgpRange: + $ref: './components/schemas/GlobalBgpRange.yaml' + GlobalBgpRangeList: + $ref: './components/schemas/GlobalBgpRangeList.yaml' + HardwareReservation: + $ref: './components/schemas/HardwareReservation.yaml' + HardwareReservationList: + $ref: './components/schemas/HardwareReservationList.yaml' + Href: + $ref: './components/schemas/Href.yaml' + IPAddress: + $ref: './components/schemas/IPAddress.yaml' + IPAssignment: + $ref: './components/schemas/IPAssignment.yaml' + IPAssignmentInput: + $ref: './components/schemas/IPAssignmentInput.yaml' + IPAssignmentList: + $ref: './components/schemas/IPAssignmentList.yaml' + IPAvailabilitiesList: + $ref: './components/schemas/IPAvailabilitiesList.yaml' + IPReservation: + $ref: './components/schemas/IPReservation.yaml' + IPReservationList: + $ref: './components/schemas/IPReservationList.yaml' + IPReservationRequestInput: + $ref: './components/schemas/IPReservationRequestInput.yaml' + InstancesBatchCreateInput: + $ref: './components/schemas/InstancesBatchCreateInput.yaml' + Interconnection: + $ref: './components/schemas/Interconnection.yaml' + InterconnectionList: + $ref: './components/schemas/InterconnectionList.yaml' + InterconnectionPort: + $ref: './components/schemas/InterconnectionPort.yaml' + InterconnectionPortList: + $ref: './components/schemas/InterconnectionPortList.yaml' + InterconnectionUpdateInput: + $ref: './components/schemas/InterconnectionUpdateInput.yaml' + Invitation: + $ref: './components/schemas/Invitation.yaml' + InvitationInput: + $ref: './components/schemas/InvitationInput.yaml' + InvitationList: + $ref: './components/schemas/InvitationList.yaml' + Invoice: + $ref: './components/schemas/Invoice.yaml' + InvoiceList: + $ref: './components/schemas/InvoiceList.yaml' + License: + $ref: './components/schemas/License.yaml' + LicenseCreateInput: + $ref: './components/schemas/LicenseCreateInput.yaml' + LicenseList: + $ref: './components/schemas/LicenseList.yaml' + LicenseUpdateInput: + $ref: './components/schemas/LicenseUpdateInput.yaml' + LineItem: + $ref: './components/schemas/LineItem.yaml' + Membership: + $ref: './components/schemas/Membership.yaml' + MembershipInput: + $ref: './components/schemas/MembershipInput.yaml' + MembershipList: + $ref: './components/schemas/MembershipList.yaml' + Meta: + $ref: './components/schemas/Meta.yaml' + Metadata: + $ref: './components/schemas/Metadata.yaml' + MetalGateway: + $ref: './components/schemas/MetalGateway.yaml' + MetalGatewayCreateInput: + $ref: './components/schemas/MetalGatewayCreateInput.yaml' + MetalGatewayElasticIpCreateInput: + $ref: './components/schemas/MetalGatewayElasticIpCreateInput.yaml' + MetalGatewayList: + $ref: './components/schemas/MetalGatewayList.yaml' + MetalGatewayLite: + $ref: './components/schemas/MetalGatewayLite.yaml' + Metro: + $ref: './components/schemas/Metro.yaml' + MetroInput: + $ref: './components/schemas/MetroInput.yaml' + MetroList: + $ref: './components/schemas/MetroList.yaml' + NewPassword: + $ref: './components/schemas/NewPassword.yaml' + OperatingSystem: + $ref: './components/schemas/OperatingSystem.yaml' + OperatingSystemList: + $ref: './components/schemas/OperatingSystemList.yaml' + Organization: + $ref: './components/schemas/Organization.yaml' + OrganizationInput: + $ref: './components/schemas/OrganizationInput.yaml' + OrganizationList: + $ref: './components/schemas/OrganizationList.yaml' + ParentBlock: + $ref: './components/schemas/ParentBlock.yaml' + PaymentMethod: + $ref: './components/schemas/PaymentMethod.yaml' + PaymentMethodBillingAddress: + $ref: './components/schemas/PaymentMethodBillingAddress.yaml' + PaymentMethodCreateInput: + $ref: './components/schemas/PaymentMethodCreateInput.yaml' + PaymentMethodList: + $ref: './components/schemas/PaymentMethodList.yaml' + PaymentMethodUpdateInput: + $ref: './components/schemas/PaymentMethodUpdateInput.yaml' + Plan: + $ref: './components/schemas/Plan.yaml' + PlanList: + $ref: './components/schemas/PlanList.yaml' + Port: + $ref: './components/schemas/Port.yaml' + PortAssignInput: + $ref: './components/schemas/PortAssignInput.yaml' + PortConvertLayer3Input: + $ref: './components/schemas/PortConvertLayer3Input.yaml' + PortVlanAssignment: + $ref: './components/schemas/PortVlanAssignment.yaml' + PortVlanAssignmentBatch: + $ref: './components/schemas/PortVlanAssignmentBatch.yaml' + PortVlanAssignmentBatchCreateInput: + $ref: './components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + PortVlanAssignmentBatchList: + $ref: './components/schemas/PortVlanAssignmentBatchList.yaml' + PortVlanAssignmentList: + $ref: './components/schemas/PortVlanAssignmentList.yaml' + Project: + $ref: './components/schemas/Project.yaml' + ProjectCreateFromRootInput: + $ref: './components/schemas/ProjectCreateFromRootInput.yaml' + ProjectCreateInput: + $ref: './components/schemas/ProjectCreateInput.yaml' + ProjectIdName: + $ref: './components/schemas/ProjectIdName.yaml' + ProjectList: + $ref: './components/schemas/ProjectList.yaml' + ProjectUpdateInput: + $ref: './components/schemas/ProjectUpdateInput.yaml' + ProjectUsage: + $ref: './components/schemas/ProjectUsage.yaml' + ProjectUsageList: + $ref: './components/schemas/ProjectUsageList.yaml' + RecoveryCodeList: + $ref: './components/schemas/RecoveryCodeList.yaml' + SSHKey: + $ref: './components/schemas/SSHKey.yaml' + SSHKeyCreateInput: + $ref: './components/schemas/SSHKeyCreateInput.yaml' + SSHKeyInput: + $ref: './components/schemas/SSHKeyInput.yaml' + SSHKeyList: + $ref: './components/schemas/SSHKeyList.yaml' + SelfServiceReservationItemRequest: + $ref: './components/schemas/SelfServiceReservationItemRequest.yaml' + SelfServiceReservationItemResponse: + $ref: './components/schemas/SelfServiceReservationItemResponse.yaml' + SelfServiceReservationList: + $ref: './components/schemas/SelfServiceReservationList.yaml' + SelfServiceReservationResponse: + $ref: './components/schemas/SelfServiceReservationResponse.yaml' + ServerInfo: + $ref: './components/schemas/ServerInfo.yaml' + SpotMarketPricesList: + $ref: './components/schemas/SpotMarketPricesList.yaml' + SpotMarketPricesPerMetroList: + $ref: './components/schemas/SpotMarketPricesPerMetroList.yaml' + SpotMarketPricesPerMetroReport: + $ref: './components/schemas/SpotMarketPricesPerMetroReport.yaml' + SpotMarketRequest: + $ref: './components/schemas/SpotMarketRequest.yaml' + SpotMarketRequestCreateInput: + $ref: './components/schemas/SpotMarketRequestCreateInput.yaml' + SpotMarketRequestList: + $ref: './components/schemas/SpotMarketRequestList.yaml' + SpotPricesDatapoints: + $ref: './components/schemas/SpotPricesDatapoints.yaml' + SpotPricesDatapointsList: + $ref: './components/schemas/SpotPricesDatapointsList.yaml' + SpotPricesHistoryReport: + $ref: './components/schemas/SpotPricesHistoryReport.yaml' + SpotPricesPerBaremetal: + $ref: './components/schemas/SpotPricesPerBaremetal.yaml' + SpotPricesPerFacility: + $ref: './components/schemas/SpotPricesPerFacility.yaml' + SpotPricesPerNewFacility: + $ref: './components/schemas/SpotPricesPerNewFacility.yaml' + SpotPricesReport: + $ref: './components/schemas/SpotPricesReport.yaml' + SupportRequestInput: + $ref: './components/schemas/SupportRequestInput.yaml' + TransferRequest: + $ref: './components/schemas/TransferRequest.yaml' + TransferRequestInput: + $ref: './components/schemas/TransferRequestInput.yaml' + TransferRequestList: + $ref: './components/schemas/TransferRequestList.yaml' + UpdateEmailInput: + $ref: './components/schemas/UpdateEmailInput.yaml' + User: + $ref: './components/schemas/User.yaml' + UserCreateInput: + $ref: './components/schemas/UserCreateInput.yaml' + Userdata: + $ref: './components/schemas/Userdata.yaml' + UserLimited: + $ref: './components/schemas/UserLimited.yaml' + UserList: + $ref: './components/schemas/UserList.yaml' + UserLite: + $ref: './components/schemas/UserLite.yaml' + UserUpdateInput: + $ref: './components/schemas/UserUpdateInput.yaml' + VerifyEmail: + $ref: './components/schemas/VerifyEmail.yaml' + VirtualCircuit: + $ref: './components/schemas/VirtualCircuit.yaml' + VirtualCircuitCreateInput: + $ref: './components/schemas/VirtualCircuitCreateInput.yaml' + VirtualCircuitList: + $ref: './components/schemas/VirtualCircuitList.yaml' + VirtualCircuitUpdateInput: + $ref: './components/schemas/VirtualCircuitUpdateInput.yaml' + VirtualNetwork: + $ref: './components/schemas/VirtualNetwork.yaml' + VirtualNetworkCreateInput: + $ref: './components/schemas/VirtualNetworkCreateInput.yaml' + VirtualNetworkList: + $ref: './components/schemas/VirtualNetworkList.yaml' + VlanFabricVcCreateInput: + $ref: './components/schemas/VlanFabricVcCreateInput.yaml' + VlanVirtualCircuit: + $ref: './components/schemas/VlanVirtualCircuit.yaml' + VlanVirtualCircuitCreateInput: + $ref: './components/schemas/VlanVirtualCircuitCreateInput.yaml' + VlanVirtualCircuitUpdateInput: + $ref: './components/schemas/VlanVirtualCircuitUpdateInput.yaml' + Vrf: + $ref: './components/schemas/Vrf.yaml' + VrfCreateInput: + $ref: './components/schemas/VrfCreateInput.yaml' + VrfFabricVcCreateInput: + $ref: './components/schemas/VrfFabricVcCreateInput.yaml' + VrfIpRangeCreateInput: + $ref: './components/schemas/VrfIpRangeCreateInput.yaml' + VrfIpRangeList: + $ref: './components/schemas/VrfIpRangeList.yaml' + VrfIpRangeUpdateInput: + $ref: './components/schemas/VrfIpRangeUpdateInput.yaml' + VrfIpReservation: + $ref: './components/schemas/VrfIpReservation.yaml' + VrfIpReservationCreateInput: + $ref: './components/schemas/VrfIpReservationCreateInput.yaml' + VrfIpReservationList: + $ref: './components/schemas/VrfIpReservationList.yaml' + VrfList: + $ref: './components/schemas/VrfList.yaml' + VrfMetalGateway: + $ref: './components/schemas/VrfMetalGateway.yaml' + VrfMetalGatewayCreateInput: + $ref: './components/schemas/VrfMetalGatewayCreateInput.yaml' + VrfRoute: + $ref: './components/schemas/VrfRoute.yaml' + VrfRouteCreateInput: + $ref: './components/schemas/VrfRouteCreateInput.yaml' + VrfRouteUpdateInput: + $ref: './components/schemas/VrfRouteUpdateInput.yaml' + VrfRouteList: + $ref: './components/schemas/VrfRouteList.yaml' + VrfUpdateInput: + $ref: './components/schemas/VrfUpdateInput.yaml' + VrfVirtualCircuit: + $ref: './components/schemas/VrfVirtualCircuit.yaml' + VrfVirtualCircuitCreateInput: + $ref: './components/schemas/VrfVirtualCircuitCreateInput.yaml' + VrfVirtualCircuitUpdateInput: + $ref: './components/schemas/VrfVirtualCircuitUpdateInput.yaml' + securitySchemes: + x_auth_token: + in: header + name: X-Auth-Token + type: apiKey + x-displayName: X-Auth-Token + description: |+ + HTTP header containing the User or Project API key that will be used to authenticate the request. +paths: + /api-keys/{id}: + $ref: ./paths/api-keys/id.yaml + /batches/{id}: + $ref: ./paths/batches/id.yaml + /bgp/sessions/{id}: + $ref: ./paths/bgp/sessions/id.yaml + /bgp-dynamic-neighbors/{id}: + $ref: ./paths/bgp-dynamic-neighbors/id.yaml + /capacity: + $ref: ./paths/capacity.yaml + /capacity/metros: + $ref: ./paths/capacity/metros.yaml + /connections/{connection_id}: + $ref: ./paths/connections/connection_id.yaml + /connections/{connection_id}/events: + $ref: ./paths/connections/connection_id/events.yaml + /connections/{connection_id}/ports: + $ref: ./paths/connections/connection_id/ports.yaml + /connections/{connection_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/virtual-circuits.yaml + /connections/{connection_id}/ports/{id}: + $ref: ./paths/connections/connection_id/ports/id.yaml + /connections/{connection_id}/ports/{id}/events: + $ref: ./paths/connections/connection_id/ports/id/events.yaml + /connections/{connection_id}/ports/{port_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/ports/port_id/virtual-circuits.yaml + /devices/{id}: + $ref: ./paths/devices/id.yaml + /devices/{id}/actions: + $ref: ./paths/devices/id/actions.yaml + /devices/{id}/bandwidth: + $ref: ./paths/devices/id/bandwidth.yaml + /devices/{id}/bgp/neighbors: + $ref: ./paths/devices/id/bgp/neighbors.yaml + /devices/{id}/bgp/sessions: + $ref: ./paths/devices/id/bgp/sessions.yaml + /devices/{id}/customdata: + $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/screenshot: + $ref: ./paths/devices/id/diagnostics/screenshot.yaml + /devices/{id}/diagnostics/health/rollup: + $ref: ./paths/devices/id/diagnostics/health/rollup.yaml + /devices/{id}/events: + $ref: ./paths/devices/id/events.yaml + /devices/{id}/firmware-sets: + $ref: ./paths/devices/id/firmware-sets.yaml + /devices/{id}/ips: + $ref: ./paths/devices/id/ips.yaml + /devices/{id}/metadata: + $ref: ./paths/devices/id/metadata.yaml + /devices/{id}/ssh-keys: + $ref: ./paths/devices/id/ssh-keys.yaml + /devices/{id}/traffic: + $ref: ./paths/devices/id/traffic.yaml + /devices/{id}/usages: + $ref: ./paths/devices/id/usages.yaml + /devices/{id}/userdata: + $ref: ./paths/devices/id/userdata.yaml + /devices/{instance_id}/ips/{id}/customdata: + $ref: ./paths/devices/instance_id/ips/id/customdata.yaml + /emails: + $ref: ./paths/emails.yaml + /emails/{id}: + $ref: ./paths/emails/id.yaml + /events: + $ref: ./paths/events.yaml + /events/{id}: + $ref: ./paths/events/id.yaml + /facilities: + $ref: ./paths/facilities.yaml + /hardware-reservations/{id}: + $ref: ./paths/hardware-reservations/id.yaml + /hardware-reservations/{id}/activate: + $ref: ./paths/hardware-reservations/id/activate.yaml + /hardware-reservations/{id}/move: + $ref: ./paths/hardware-reservations/id/move.yaml + /incidents: + $ref: ./paths/incidents.yaml + /invitations: + $ref: ./paths/invitations.yaml + /invitations/{id}: + $ref: ./paths/invitations/id.yaml + /invoices/{id}: + $ref: ./paths/invoices/id.yaml + /ips/{id}: + $ref: ./paths/ips/id.yaml + /ips/{id}/available: + $ref: ./paths/ips/id/available.yaml + /ips/{id}/customdata: + $ref: ./paths/ips/id/customdata.yaml + /licenses/{id}: + $ref: ./paths/licenses/id.yaml + /locations/metros: + $ref: ./paths/locations/metros.yaml + /locations/metros/{id}: + $ref: ./paths/locations/metros/id.yaml + /market/spot/prices: + $ref: ./paths/market/spot/prices.yaml + /market/spot/prices/history: + $ref: ./paths/market/spot/prices/history.yaml + /market/spot/prices/metros: + $ref: ./paths/market/spot/prices/metros.yaml + /memberships/{id}: + $ref: ./paths/memberships/id.yaml + /metal-gateways/{id}: + $ref: ./paths/metal-gateways/id.yaml + /metal-gateways/{id}/bgp-dynamic-neighbors: + $ref: ./paths/metal-gateways/id/bgp-dynamic-neighbors.yaml + /metal-gateways/{id}/ips: + $ref: ./paths/metal-gateways/id/ips.yaml + /operating-system-versions: + $ref: ./paths/operating-system-versions.yaml + /operating-systems: + $ref: ./paths/operating-systems.yaml + /organizations: + $ref: ./paths/organizations.yaml + /organizations/{id}: + $ref: ./paths/organizations/id.yaml + /organizations/{id}/capacity: + $ref: ./paths/organizations/id/capacity.yaml + /organizations/{id}/capacity/metros: + $ref: ./paths/organizations/id/capacity/metros.yaml + /organizations/{id}/customdata: + $ref: ./paths/organizations/id/customdata.yaml + /organizations/{id}/devices: + $ref: ./paths/organizations/id/devices.yaml + /organizations/{id}/events: + $ref: ./paths/organizations/id/events.yaml + /organizations/{id}/facilities: + $ref: ./paths/organizations/id/facilities.yaml + /organizations/{id}/firmware-sets: + $ref: ./paths/organizations/id/firmware-sets.yaml + /organizations/{id}/invitations: + $ref: ./paths/organizations/id/invitations.yaml + /organizations/{id}/invoices: + $ref: ./paths/organizations/id/invoices.yaml + /organizations/{id}/operating-systems: + $ref: ./paths/organizations/id/operating-systems.yaml + /organizations/{id}/payment-methods: + $ref: ./paths/organizations/id/payment-methods.yaml + /organizations/{id}/plans: + $ref: ./paths/organizations/id/plans.yaml + /organizations/{id}/projects: + $ref: ./paths/organizations/id/projects.yaml + /organizations/{id}/transfers: + $ref: ./paths/organizations/id/transfers.yaml + /organizations/{organization_id}/connections: + $ref: ./paths/organizations/organization_id/connections.yaml + /payment-methods/{id}: + $ref: ./paths/payment-methods/id.yaml + /plans: + $ref: ./paths/plans.yaml + /ports/{id}: + $ref: ./paths/ports/id.yaml + /ports/{id}/assign: + $ref: ./paths/ports/id/assign.yaml + /ports/{id}/bond: + $ref: ./paths/ports/id/bond.yaml + /ports/{id}/convert/layer-2: + $ref: ./paths/ports/id/convert/layer-2.yaml + /ports/{id}/convert/layer-3: + $ref: ./paths/ports/id/convert/layer-3.yaml + /ports/{id}/disbond: + $ref: ./paths/ports/id/disbond.yaml + /ports/{id}/native-vlan: + $ref: ./paths/ports/id/native-vlan.yaml + /ports/{id}/unassign: + $ref: ./paths/ports/id/unassign.yaml + /ports/{id}/vlan-assignments: + $ref: ./paths/ports/id/vlan-assignments.yaml + /ports/{id}/vlan-assignments/{assignment_id}: + $ref: ./paths/ports/id/vlan-assignments/assignment_id.yaml + /ports/{id}/vlan-assignments/batches: + $ref: ./paths/ports/id/vlan-assignments/batches.yaml + /ports/{id}/vlan-assignments/batches/{batch_id}: + $ref: ./paths/ports/id/vlan-assignments/batches/batch_id.yaml + /projects: + $ref: ./paths/projects.yaml + /projects/{id}: + $ref: ./paths/projects/id.yaml + /projects/{id}/api-keys: + $ref: ./paths/projects/id/api-keys.yaml + /projects/{id}/batches: + $ref: ./paths/projects/id/batches.yaml + /projects/{id}/bgp-config: + $ref: ./paths/projects/id/bgp-config.yaml + /projects/{id}/bgp-configs: + $ref: ./paths/projects/id/bgp-configs.yaml + /projects/{id}/bgp/sessions: + $ref: ./paths/projects/id/bgp/sessions.yaml + /projects/{id}/customdata: + $ref: ./paths/projects/id/customdata.yaml + /projects/{id}/devices: + $ref: ./paths/projects/id/devices.yaml + /projects/{id}/devices/batch: + $ref: ./paths/projects/id/devices/batch.yaml + /projects/{id}/events: + $ref: ./paths/projects/id/events.yaml + /projects/{id}/facilities: + $ref: ./paths/projects/id/facilities.yaml + /projects/{id}/firmware-sets: + $ref: ./paths/projects/id/firmware-sets.yaml + /projects/{id}/global-bgp-ranges: + $ref: ./paths/projects/id/global-bgp-ranges.yaml + /projects/{id}/hardware-reservations: + $ref: ./paths/projects/id/hardware-reservations.yaml + /projects/{id}/ips: + $ref: ./paths/projects/id/ips.yaml + /projects/{id}/licenses: + $ref: ./paths/projects/id/licenses.yaml + /projects/{id}/plans: + $ref: ./paths/projects/id/plans.yaml + /projects/{id}/spot-market-requests: + $ref: ./paths/projects/id/spot-market-requests.yaml + /projects/{id}/ssh-keys: + $ref: ./paths/projects/id/ssh-keys.yaml + /projects/{id}/transfers: + $ref: ./paths/projects/id/transfers.yaml + /projects/{id}/usages: + $ref: ./paths/projects/id/usages.yaml + /projects/{id}/virtual-networks: + $ref: ./paths/projects/id/virtual-networks.yaml + /projects/{id}/vrfs: + $ref: ./paths/projects/id/vrfs.yaml + /projects/{project_id}/connections: + $ref: ./paths/projects/project_id/connections.yaml + /projects/{project_id}/invitations: + $ref: ./paths/projects/project_id/invitations.yaml + /projects/{project_id}/ips/{id}/customdata: + $ref: ./paths/projects/project_id/ips/id/customdata.yaml + /projects/{project_id}/memberships: + $ref: ./paths/projects/project_id/memberships.yaml + /projects/{project_id}/metal-gateways: + $ref: ./paths/projects/project_id/metal-gateways.yaml + /projects/{project_id}/self-service/reservations: + $ref: ./paths/projects/project_id/self-service/reservations.yaml + /projects/{project_id}/self-service/reservations/{id}: + $ref: ./paths/projects/project_id/self-service/reservations/id.yaml + /reset-password: + $ref: ./paths/reset-password.yaml + /routes/{id}: + $ref: ./paths/routes/id.yaml + /routes/{id}/events: + $ref: ./paths/routes/id/events.yaml + /spot-market-requests/{id}: + $ref: ./paths/spot-market-requests/id.yaml + /ssh-keys: + $ref: ./paths/ssh-keys.yaml + /ssh-keys/{id}: + $ref: ./paths/ssh-keys/id.yaml + /support-requests: + $ref: ./paths/support-requests.yaml + /transfers/{id}: + $ref: ./paths/transfers/id.yaml + /user: + $ref: ./paths/user.yaml + /user/api-keys: + $ref: ./paths/user/api-keys.yaml + /user/api-keys/{id}: + $ref: ./paths/user/api-keys/id.yaml + /user/otp/app: + $ref: ./paths/user/otp/app.yaml + /user/otp/recovery-codes: + $ref: ./paths/user/otp/recovery-codes.yaml + /user/otp/sms: + $ref: ./paths/user/otp/sms.yaml + /user/otp/sms/receive: + $ref: ./paths/user/otp/sms/receive.yaml + /user/otp/verify/{otp}: + $ref: ./paths/user/otp/verify/otp.yaml + /userdata/validate: + $ref: ./paths/userdata/validate.yaml + /users: + $ref: ./paths/users.yaml + /users/{id}: + $ref: ./paths/users/id.yaml + /users/{id}/customdata: + $ref: ./paths/users/id/customdata.yaml + /verify-email: + $ref: ./paths/verify-email.yaml + /virtual-circuits/{id}/events: + $ref: ./paths/virtual-circuits/id/events.yaml + /virtual-circuits/{id}: + $ref: ./paths/virtual-circuits/id.yaml + /virtual-networks/{id}: + $ref: ./paths/virtual-networks/id.yaml + /vrfs/{id}: + $ref: ./paths/vrfs/id.yaml + /vrfs/{id}/ips: + $ref: ./paths/vrfs/id/ips.yaml + /vrfs/{vrf_id}/ips/{id}: + $ref: ./paths/vrfs/vrf_id/ips/id.yaml + /vrfs/{id}/routes: + $ref: ./paths/vrfs/id/routes.yaml +tags: + - description: |+ + Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header. + + + + User API keys can be obtained by creating them in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey) endpoint. + + Project API keys can also be obtained by creating them in the Equinix Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey) endpoint. Project API keys are scoped to a single project and can only be used to access resources within that project. + + For example, to use an authenticated API token, you would make a request like the following: + + ```bash + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user/api-keys + ``` + + Applications can take advantage of the Equinix Metal API and API keys to perform any of the actions that can be performed in the Equinix Metal Portal. For example, you can use the API to create and manage devices, projects, and other resources. + + API keys can be deleted without affecting any of the resources created with them. Access to applications using the API can be revoked by deleting the API key used to authenticate the application. + name: Authentication + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/#api-keys + - description: | + Equinix Metal uses conventional HTTP response codes to indicate the success or failure of an API request. + + In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Equinix Metal's servers (these are rare). + + | Code | Summary + | ---------------------------------- | ------------------------------------------------------ + | 200 OK | Everything worked as expected. + | 201 Create | Everything worked as expected, the resource was created. + | 422 Bad Request | The request was unacceptable, often due to missing a required parameter. + | 401 Unauthorized | No valid API key provided. + | 404 Not Found | The requested resource doesn't exist. + | 500, 502, 503, 504 - Server Errors | Something went wrong on Equinix Metal's end. (These are rare.) + + Errors (4xx, 5xx) reported by the API will include a JSON error response. This response will be structured as one of the following: + + ```json + {"error": "the error message"} + ``` + + or + + ```json + {"errors": ["one error", "another error"} + ``` + + The JSON response is not guaranteed so check the HTTP status message. JSON may not be included if the error is reported by an API intermediary, like a loadbalancer service. + name: Errors + - description: > + Manage device batches. See project endpoints to list batches for a + particular project. Check out the product docs to learn more about [Batch + Deployment](https://metal.equinix.com/developers/docs/deploy/batch-deployment/). + name: Batches + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/batch-deployment/ + - description: > + Manage BGP configs and sessions. See device endpoints to create and list BGP + sessions for a particular device. Check out the product docs to learn more + about [Local and Global + BGP](https://metal.equinix.com/developers/docs/networking/local-global-bgp/). + name: BGP + externalDocs: + url: https://metal.equinix.com/developers/docs/bgp/bgp-on-equinix-metal/ + - description: > + Capacity Management. Check out the product docs to learn more about + [Capacity](https://metal.equinix.com/developers/docs/locations/capacity/). + name: Capacity + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/capacity/ + - description: > + Network Interconnections. See Instructions to create Network + Interconnections at Check out the product docs to learn more about [Equinix + Fabric](https://metal.equinix.com/developers/docs/networking/fabric/). + name: Interconnections + externalDocs: + url: https://metal.equinix.com/developers/docs/equinix-interconnect/introduction/ + - description: > + Device Management. Check out the product docs to learn more about [Server + Devices](https://metal.equinix.com/developers/docs/servers/). + name: Devices + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/on-demand/ + - description: Email Management + name: Emails + - description: Event Management + name: Events + - description: > + Facility Management. Check out the product docs to learn more about + [Facilities](https://metal.equinix.com/developers/docs/locations/). + name: Facilities + - description: > + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Firmware Sets + - description: > + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Console Log Details + - description: > + Global BGP Range Management + name: GlobalBgpRanges + externalDocs: + url: https://metal.equinix.com/developers/docs/bgp/global-bgp/ + - description: > + Hardware Reservation Management. Check out the product docs to learn more + about [Reserved + Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/). + name: HardwareReservations + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/reserved/ + - description: > + Incident Management + name: Incidents + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/maintenance/ + - description: > + Manage invitations. See project endpoints to create a new invitation. Check + out the product docs to learn more about + [Invitations](https://metal.equinix.com/developers/docs/accounts/). + name: Invitations + - description: > + Manage IP addresses. See device and project endpoints to list and create IP + assignments for a particular project or device. Check out the product docs + to learn more about [the basic networking + features](https://metal.equinix.com/developers/docs/networking/standard-ips/). + name: IPAddresses + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/ + - description: > + Manage licenses. See project endpoints to list and create licenses for a + particular project. + name: Licenses + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/licensed/ + - description: > + Membership Management (Project). Check out the product docs to learn more + about [Membership](https://metal.equinix.com/developers/docs/accounts/). + name: Memberships + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/#inviting-a-user-to-a-project + - description: > + Device Metadata + name: Metadata + externalDocs: + url: https://metal.equinix.com/developers/docs/server-metadata/metadata/ + - description: > + Metal Gateway Management.Check out the product docs to learn more about + [Metal + Gateways](https://metal.equinix.com/developers/docs/networking/metal-gateway/). + name: MetalGateways + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/metal-gateway/ + - description: Metro Management. Check out the product docs to learn more about [Metros](https://metal.equinix.com/developers/docs/locations/metros/). + name: Metros + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/metros/ + - description: > + Operating System Management. Check out the product docs to learn more about + [Operating Systems + choices](https://metal.equinix.com/developers/docs/operating-systems/). + name: OperatingSystems + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/supported/ + - description: + Organizations Management. Check out the product docs to learn more + about [Organizations](https://metal.equinix.com/developers/docs/accounts/). + name: Organizations + - description: > + OTP Management. Check out the product docs to learn more about [OTP](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ + name: OTPs + - description: > + Password Reset Token Management + name: PasswordResetTokens + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/#security-settings + - description: > + Payment Method Management + name: PaymentMethods + externalDocs: + url: https://metal.equinix.com/developers/docs/billing/payment-methods/ + - description: > + Plan Management (Device). Check out the product docs to learn more + about [Device Plans](https://metal.equinix.com/developers/docs/servers/). + name: Plans + - description: > + Port ManagementCheck out the product docs to learn more about [Port + configurations](https://metal.equinix.com/developers/docs/layer2-networking/overview/). + name: Ports + externalDocs: + url: https://metal.equinix.com/developers/docs/layer2-networking/overview/ + - description: > + Project Management. Check out the product docs to learn more about + [Projects](https://metal.equinix.com/developers/docs/accounts/projects/). + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/ + name: Projects + - description: > + Self Service Reservations + name: SelfServiceReservations + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/reserved/ + - description: > + Spot Market Pricing and Requests Management. Check out the product docs to learn more + about [Spot Market + features](https://metal.equinix.com/developers/docs/deploy/spot-market/). + name: SpotMarket + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/spot-market/ + - description: > + Manage SSH keys. See project endpoints to list and create project-level SSH + keys. + name: SSHKeys + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/ssh-keys/ + - description: > + Support request + name: SupportRequest + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/support/ + - description: > + Project Transfer Requests Management + name: TransferRequests + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/#transferring-a-project + - description: > + Two Factor Authentication Management. Check out the product docs to learn + more about + [2FA](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). + name: TwoFactorAuth + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ + - description: Usage Management + name: Usages + externalDocs: + url: https://metal.equinix.com/developers/docs/billing/checking-usage/ + - description: > + Userdata Management + name: Userdata + externalDocs: + url: https://metal.equinix.com/developers/docs/server-metadata/user-data/ + - description: > + User Management + name: Users + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/ + - description: > + User Verification Token Management + name: UserVerificationTokens + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/organizations/#managing-team-members + - description: > + Manage virtual networks (VLANs). See project endpoints to list and create + virtual networks. Check out the product docs to learn more about + [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/). + name: VLANs + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/layer2/ + - description: > + Volume Management (Block Storage). Notice: Block storage support will + be deprecated soon. Please check here: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ + for more details. + name: Volumes + externalDocs: + url: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ + - description: > + VRF Management. A VRF is a project-scoped virtual router resource that defines a collection of customer-managed IP blocks that can be used in BGP peering on one or more virtual networks. Metal Gateways and Interconnection Virtual Circuits can take advantage of VRFs to enable Layer 3 routing with bespoke network ranges. Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: VRFs +x-tagGroups: + - name: Accounts and Organization + tags: + - Authentication + - Emails + - Invitations + - Memberships + - Organizations + - OTPs + - PasswordResetTokens + - PaymentMethods + - Projects + - SSHKeys + - SupportRequest + - TransferRequests + - TwoFactorAuth + - Users + - UserVerificationTokens + - name: Services and Billing + tags: + - Events + - Facilities + - Incidents + - Invoices + - Licenses + - Metros + - Plans + - Usages + - name: Servers + tags: + - Devices + - Batches + - Capacity + - HardwareReservations + - OperatingSystems + - Ports + - SelfServiceReservations + - SpotMarket + - Userdata + - Volumes + - name: Networking + tags: + - BGP + - Interconnections + - IPAddresses + - MetalGateways + - VLANs + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml new file mode 100644 index 00000000..10caea95 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the API key. + operationId: deleteAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml b/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml new file mode 100644 index 00000000..6a97f0b2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/batches/id.yaml @@ -0,0 +1,69 @@ +delete: + description: Deletes the Batch. + operationId: deleteBatch + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Delete all instances created from this batch + in: query + name: remove_associated_instances + schema: + default: false + type: boolean + responses: + "204": + description: no content + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the Batch + tags: + - Batches +get: + description: Returns a Batch + operationId: findBatchById + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Batch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a Batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml b/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml new file mode 100644 index 00000000..fcef32cd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/bgp-dynamic-neighbors/id.yaml @@ -0,0 +1,77 @@ +delete: + summary: Delete a VRF BGP Dynamic Neighbor + description: Trigger the removal of a BGP Neighbor range from a VRF + operationId: deleteBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a BGP Dynamic Neighbor + description: Return a single BGP Dynamic Neighbor resource + operation: findBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml b/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml new file mode 100644 index 00000000..d34f2ae8 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/bgp/sessions/id.yaml @@ -0,0 +1,124 @@ +delete: + description: Deletes the BGP session. + operationId: deleteBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the BGP session + tags: + - BGP +get: + description: Returns a BGP session + operationId: findBgpSessionById + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpSession.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a BGP session + tags: + - BGP +put: + description: Updates the BGP session by either enabling or disabling the default + route functionality. + operationId: updateBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + type: boolean + description: Default route + required: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the BGP session + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/capacity.yaml b/spec/services/metalv1/oas3.fetched/paths/capacity.yaml new file mode 100644 index 00000000..904cdd4c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/capacity.yaml @@ -0,0 +1,69 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findCapacityForFacility + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity + tags: + - Capacity +post: + deprecated: true + description: Validates if a deploy can be fulfilled. + operationId: checkCapacityForFacility + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CapacityInput.yaml' + description: Facility to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityCheckPerFacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml new file mode 100644 index 00000000..bac69d22 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/capacity/metros.yaml @@ -0,0 +1,68 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findCapacityForMetro + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + dc: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity for metros + tags: + - Capacity +post: + description: Validates if a deploy can be fulfilled in a metro. + operationId: checkCapacityForMetro + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityInput.yaml' + description: Metro to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityCheckPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity for a metro + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml new file mode 100644 index 00000000..1fdf9236 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id.yaml @@ -0,0 +1,112 @@ +delete: + description: Delete a interconnection, its associated ports and virtual circuits. + operationId: deleteInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete interconnection + tags: + - Interconnections +get: + description: Get the details of a interconnection + operationId: getInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get interconnection + tags: + - Interconnections +put: + description: Update the details of a interconnection + operationId: updateInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/InterconnectionUpdateInput.yaml' + description: Updated interconnection details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update interconnection + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml new file mode 100644 index 00000000..8d2121bc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the interconnection events + operationId: findInterconnectionEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml new file mode 100644 index 00000000..11b270ec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports.yaml @@ -0,0 +1,33 @@ +get: + description: List the ports associated to an interconnection. + operationId: listInterconnectionPorts + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionPortList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's ports + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml new file mode 100644 index 00000000..540efd28 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id.yaml @@ -0,0 +1,42 @@ +get: + description: Get the details of an interconnection port. + operationId: getInterconnectionPort + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + - $ref: '../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/InterconnectionPort.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Get a interconnection port + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml new file mode 100644 index 00000000..8cafd50a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/id/events.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of the interconnection port events + operationId: findInterconnectionPortEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Interconnection Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + - $ref: '../../../../../components/parameters/Page.yaml' + - $ref: '../../../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection port events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml new file mode 100644 index 00000000..7d87e987 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml @@ -0,0 +1,92 @@ +get: + description: List the virtual circuit record(s) associatiated with a particular + interconnection port. + operationId: listInterconnectionPortVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection port's virtual circuits + tags: + - Interconnections +post: + description: Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify + a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, + along with the NNI VLAN value. + operationId: createInterconnectionPortVirtualCircuit + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitCreateInput.yaml' + description: Virtual Circuit details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Create a new Virtual Circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml new file mode 100644 index 00000000..ac0c891c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/connections/connection_id/virtual-circuits.yaml @@ -0,0 +1,33 @@ +get: + description: List the virtual circuit record(s) associated with a particular interconnection id. + operationId: listInterconnectionVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's virtual circuits + tags: + - Interconnections \ No newline at end of file diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml new file mode 100644 index 00000000..1eb2ed9e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id.yaml @@ -0,0 +1,144 @@ +delete: + description: Deletes a device and deprovisions it in our datacenter. + operationId: deleteDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Force the deletion of the device, by detaching any storage volume + still active. + in: query + name: force_delete + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete the device + tags: + - Devices +get: + description: |- + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. + State value can be one of: active inactive queued or provisioning + operationId: findDeviceById + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a device + tags: + - Devices +put: + description: Updates the device. + operationId: updateDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/DeviceUpdateInput.yaml' + description: Device to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml new file mode 100644 index 00000000..ba60b9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/actions.yaml @@ -0,0 +1,44 @@ +post: + description: 'Performs an action for the given device. Possible actions include: + power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue + OS.)' + operationId: performAction + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceActionInput.yaml' + description: Action to perform + required: true + responses: + "202": + description: accepted + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Perform an action + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml new file mode 100644 index 00000000..91524c96 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bandwidth.yaml @@ -0,0 +1,41 @@ +get: + description: Retrieve an instance bandwidth for a given period of time. + operationId: findInstanceBandwidth + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an instance bandwidth + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml new file mode 100644 index 00000000..e2711c96 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/neighbors.yaml @@ -0,0 +1,41 @@ +get: + description: Provides a summary of the BGP neighbor data associated to the BGP sessions + for this device. + operationId: getBgpNeighborData + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionNeighbors.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve BGP neighbor data for this device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml new file mode 100644 index 00000000..131fcef5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/bgp/sessions.yaml @@ -0,0 +1,81 @@ +get: + description: Provides a listing of available BGP sessions for the device. + operationId: findBgpSessions + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all BGP sessions + tags: + - Devices +post: + description: Creates a BGP session. + operationId: createBgpSession + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/BGPSessionInput.yaml' + description: BGP session to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSession.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a BGP session + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml new file mode 100644 index 00000000..1b3c0266 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this instance in json format + operationId: findDeviceCustomdata + parameters: + - description: Instance UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an instance + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml new file mode 100644 index 00000000..4d66456f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/health/rollup.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's Health Status + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../../../components/schemas/DeviceHealthRollup.yaml' + "401": + $ref: '../../../../../components/schemas/Error.yaml' + "404": + $ref: '../../../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml new file mode 100644 index 00000000..67c2d147 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/diagnostics/screenshot.yaml @@ -0,0 +1,39 @@ +get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + tags: + - Console Log Details + responses: + "200": + description: An image file + content: + application/jpeg: + schema: + type: string + format: binary + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "501": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not implemented for device diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml new file mode 100644 index 00000000..62a179c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events pertaining to a specific device + operationId: findDeviceEvents + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml new file mode 100644 index 00000000..b3eca50a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/firmware-sets.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's associated Firmware Set + description: Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml new file mode 100644 index 00000000..af8637c0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/ips.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all ip assignments for a device. + operationId: findIPAssignments + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip assignments + tags: + - Devices +post: + description: Creates an ip assignment for a device. + operationId: createIPAssignment + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentInput.yaml' + description: IPAssignment to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignment.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an ip assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml new file mode 100644 index 00000000..d3fce7cc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/metadata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device metadata + operationId: findDeviceMetadataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metadata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve metadata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml new file mode 100644 index 00000000..73fb19d6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/ssh-keys.yaml @@ -0,0 +1,33 @@ +get: + description: Returns a collection of the device's ssh keys. + operationId: findDeviceSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: Search string + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a device's ssh keys + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml new file mode 100644 index 00000000..b766b01c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/traffic.yaml @@ -0,0 +1,84 @@ +get: + description: Returns traffic for a specific device. + operationId: findTraffic + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Traffic direction + in: query + name: direction + required: true + schema: + enum: + - inbound + - outbound + type: string + - description: Traffic interval + in: query + name: interval + schema: + enum: + - minute + - hour + - day + - week + - month + - year + - hour_of_day + - day_of_week + - day_of_month + - month_of_year + type: string + - description: Traffic bucket + in: query + name: bucket + schema: + enum: + - internal + - external + type: string + - name: timeframe + in: query + schema: + properties: + ended_at: + format: date-time + type: string + started_at: + format: date-time + type: string + required: + - started_at + - ended_at + type: object + style: deepObject + explode: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device traffic + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml new file mode 100644 index 00000000..6ad450c9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a device. + operationId: findDeviceUsages + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for device + tags: + - Usages diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml new file mode 100644 index 00000000..63aedafe --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/id/userdata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device userdata + operationId: findDeviceUserdataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Userdata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve userdata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml new file mode 100644 index 00000000..080b675a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/devices/instance_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Assignment in json + format + operationId: findIPAssignmentCustomdata + parameters: + - description: Instance UUID + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + - description: Ip Assignment UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/emails.yaml b/spec/services/metalv1/oas3.fetched/paths/emails.yaml new file mode 100644 index 00000000..3e3e1b8e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/emails.yaml @@ -0,0 +1,32 @@ +post: + description: Add a new email address to the current user. + operationId: createEmail + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CreateEmailInput.yaml' + description: Email to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Email.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml b/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml new file mode 100644 index 00000000..6c42e43b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/emails/id.yaml @@ -0,0 +1,126 @@ +delete: + description: Deletes the email. + operationId: deleteEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the email + tags: + - Emails +get: + description: Provides one of the user’s emails. + operationId: findEmailById + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an email + tags: + - Emails +put: + description: Updates the email. + operationId: updateEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/UpdateEmailInput.yaml' + description: email to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.fetched/paths/events.yaml b/spec/services/metalv1/oas3.fetched/paths/events.yaml new file mode 100644 index 00000000..6e5042d7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/events.yaml @@ -0,0 +1,24 @@ +get: + description: Returns a list of the current user’s events + operationId: findEvents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve current user's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/events/id.yaml b/spec/services/metalv1/oas3.fetched/paths/events/id.yaml new file mode 100644 index 00000000..f89b640e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/events/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single event if the user has access + operationId: findEventById + parameters: + - description: Event UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an event + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/facilities.yaml new file mode 100644 index 00000000..871a4d40 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/facilities.yaml @@ -0,0 +1,50 @@ +get: + deprecated: true + description: Provides a listing of available datacenters where you can provision + Packet devices. + operationId: findFacilities + parameters: + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + enum: + - address + - labels + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + default: + - address + items: + enum: + - address + - labels + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all facilities + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml new file mode 100644 index 00000000..f060e73d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single hardware reservation + operationId: findHardwareReservationById + parameters: + - description: HardwareReservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml new file mode 100644 index 00000000..2a828934 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/activate.yaml @@ -0,0 +1,50 @@ +post: + description: Activate a spare hardware reservation + operationId: activateHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + description: + type: string + description: Note to attach to the reservation + required: false + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Activate a spare hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml new file mode 100644 index 00000000..53b7e969 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/hardware-reservations/id/move.yaml @@ -0,0 +1,51 @@ +post: + description: Move a hardware reservation to another project + operationId: moveHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + project_id: + format: uuid + type: string + description: Destination Project UUID + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Move a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/incidents.yaml b/spec/services/metalv1/oas3.fetched/paths/incidents.yaml new file mode 100644 index 00000000..f71ba426 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/incidents.yaml @@ -0,0 +1,18 @@ +get: + description: Retrieve the number of incidents. + operationId: findIncidents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the number of incidents + tags: + - Incidents diff --git a/spec/services/metalv1/oas3.fetched/paths/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/invitations.yaml new file mode 100644 index 00000000..31edf02d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invitations.yaml @@ -0,0 +1,35 @@ +get: + description: Returns all invitations in current user. + operationId: findInvitations + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + summary: Retrieve current user invitations + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml new file mode 100644 index 00000000..675fb307 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invitations/id.yaml @@ -0,0 +1,116 @@ +delete: + description: Decline an invitation. + operationId: declineInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline an invitation + tags: + - Invitations +get: + description: Returns a single invitation. (It include the `invitable` to maintain + backward compatibility but will be removed soon) + operationId: findInvitationById + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invitation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View an invitation + tags: + - Invitations +put: + description: Accept an invitation. + operationId: acceptInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept an invitation + tags: + - Invitations diff --git a/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml b/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml new file mode 100644 index 00000000..78152311 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/invoices/id.yaml @@ -0,0 +1,33 @@ +get: + description: Returns the invoice identified by the provided id + operationId: getInvoiceById + parameters: + - description: Invoice UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invoice.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an invoice + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml new file mode 100644 index 00000000..db4cc052 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id.yaml @@ -0,0 +1,137 @@ +delete: + description: | + This call can be used to un-assign an IP assignment or delete + an IP reservation. + + Un-assign an IP address record. + Use the assignment UUID you + get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. + + Delete an IP reservation. + Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + operationId: deleteIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Unassign an ip address + tags: + - IPAddresses +get: + description: Returns a single ip address if the user has access. + operationId: findIPAddressById + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an ip address + tags: + - IPAddresses +patch: + description: Update details about an ip address + operationId: updateIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/IPAssignmentUpdateInput.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update an ip address + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml new file mode 100644 index 00000000..dcf4a6f0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id/available.yaml @@ -0,0 +1,155 @@ +get: + description: Provides a list of IP resevations for a single project. + operationId: findIPAvailabilities + parameters: + - description: IP Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Size of subnets in bits + in: query + name: cidr + required: true + schema: + enum: + - "20" + - "21" + - "22" + - "23" + - "24" + - "25" + - "26" + - "27" + - "28" + - "29" + - "30" + - "31" + - "32" + - "33" + - "34" + - "35" + - "36" + - "37" + - "38" + - "39" + - "40" + - "41" + - "42" + - "43" + - "44" + - "45" + - "46" + - "47" + - "48" + - "49" + - "50" + - "51" + - "52" + - "53" + - "54" + - "55" + - "56" + - "57" + - "58" + - "59" + - "60" + - "61" + - "62" + - "63" + - "64" + - "65" + - "66" + - "67" + - "68" + - "69" + - "70" + - "71" + - "72" + - "73" + - "74" + - "75" + - "76" + - "77" + - "78" + - "79" + - "80" + - "81" + - "82" + - "83" + - "84" + - "85" + - "86" + - "87" + - "88" + - "89" + - "90" + - "91" + - "92" + - "93" + - "94" + - "95" + - "96" + - "97" + - "98" + - "99" + - "100" + - "101" + - "102" + - "103" + - "104" + - "105" + - "106" + - "107" + - "108" + - "109" + - "110" + - "111" + - "112" + - "113" + - "114" + - "115" + - "116" + - "117" + - "118" + - "119" + - "120" + - "121" + - "122" + - "123" + - "124" + - "125" + - "126" + - "127" + - "128" + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAvailabilitiesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all available subnets of a particular reservation + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml new file mode 100644 index 00000000..f44ebd3a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ips/id/customdata.yaml @@ -0,0 +1,36 @@ +get: + description: Provides the custom metadata stored for this IP Reservation or IP Assignment + in json format + operationId: findIPAddressCustomdata + parameters: + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation or IP Assignment + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml b/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml new file mode 100644 index 00000000..5ac742c9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/licenses/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes a license. + operationId: deleteLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the license + tags: + - Licenses +get: + description: Returns a license + operationId: findLicenseById + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a license + tags: + - Licenses +put: + description: Updates the license. + operationId: updateLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/LicenseUpdateInput.yaml' + description: License to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the license + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml new file mode 100644 index 00000000..1e86e985 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/locations/metros.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available metros + operationId: findMetros + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/MetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all metros + tags: + - Metros diff --git a/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml b/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml new file mode 100644 index 00000000..217cc637 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/locations/metros/id.yaml @@ -0,0 +1,27 @@ +get: + description: Show the details for a metro, including name, code, and country. + operationId: getMetro + parameters: + - description: Metro UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metro.yaml' + description: ok + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a specific Metro's details + tags: + - Metros diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml new file mode 100644 index 00000000..94a2674c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices. + operationId: findSpotMarketPrices + parameters: + - description: Facility to check spot market prices + in: query + name: facility + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketPricesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml new file mode 100644 index 00000000..a0702301 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/history.yaml @@ -0,0 +1,58 @@ +get: + description: |- + Get spot market prices for a given plan and facility in a fixed period of time + + *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + operationId: findSpotMarketPricesHistory + parameters: + - description: Facility to check spot market prices + in: query + name: facility + required: true + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + required: true + schema: + type: string + - description: Metro to check spot market price history + in: query + name: metro + schema: + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotPricesHistoryReport.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get spot market prices for a given period of time + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml new file mode 100644 index 00000000..969f108e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/market/spot/prices/metros.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices for all metros. + operationId: findMetroSpotMarketPrices + parameters: + - description: Metro to filter spot market prices + in: query + name: metro + schema: + type: string + - description: Plan to filter spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotMarketPricesPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices for metros + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml b/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml new file mode 100644 index 00000000..535bc738 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/memberships/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the membership. + operationId: deleteMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the membership + tags: + - Memberships +get: + description: Returns a single membership. + operationId: findMembershipById + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a membership + tags: + - Memberships +put: + description: Updates the membership. + operationId: updateMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/MembershipInput.yaml' + description: Membership to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the membership + tags: + - Memberships diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml new file mode 100644 index 00000000..87fd86aa --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id.yaml @@ -0,0 +1,74 @@ +delete: + description: Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + operationId: deleteMetalGateway + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + description: accepted + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Deletes the metal gateway + tags: + - MetalGateways +get: + description: Returns a specific metal gateway + operationId: findMetalGatewayById + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Returns the metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml new file mode 100644 index 00000000..fa11a461 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml @@ -0,0 +1,94 @@ +post: + summary: Create a VRF BGP Dynamic Neighbor range + description: | + Create a VRF BGP Dynamic Neighbor range. + + BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createBgpDynamicNeighbor + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/BgpDynamicNeighborCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighbor.yaml' + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - VRFs + +get: + description: Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + operationId: getBgpDynamicNeighbors + summary: List BGP Dynamic Neighbors + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighborList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml new file mode 100644 index 00000000..78787aea --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/metal-gateways/id/ips.yaml @@ -0,0 +1,94 @@ +post: + summary: Create a Metal Gateway Elastic IP + description: | + Create a new Elastic IP on this Metal Gateway. + + Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. + + Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createMetalGatewayElasticIp + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/MetalGatewayElasticIpCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignment.yaml" + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - MetalGateways + +get: + summary: List Metal Gateway Elastic IPs + description: Returns the list of Elastic IPs assigned to this Metal Gateway + operationId: getMetalGatewayElasticIps + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignmentList.yaml" + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml b/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml new file mode 100644 index 00000000..538b224f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/operating-system-versions.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available operating system versions. + operationId: findOperatingSystemVersion + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating system versions + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml b/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml new file mode 100644 index 00000000..3afe2ed9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/operating-systems.yaml @@ -0,0 +1,20 @@ +get: + description: Provides a listing of available operating systems to provision your + new device with. + operationId: findOperatingSystems + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating systems + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations.yaml new file mode 100644 index 00000000..0a21aaf9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations.yaml @@ -0,0 +1,84 @@ +get: + description: Returns a list of organizations that are accessible to the current + user. + operationId: findOrganizations + parameters: + - description: Include, exclude or show only personal organizations. + in: query + name: personal + schema: + enum: + - include + - exclude + - only + type: string + - description: Include, exclude or show only organizations that have no projects. + in: query + name: without_projects + schema: + enum: + - include + - exclude + - only + type: string + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all organizations + tags: + - Organizations +post: + description: Creates an organization. + operationId: createOrganization + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationInput.yaml' + description: Organization to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Organization.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml new file mode 100644 index 00000000..98d59577 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id.yaml @@ -0,0 +1,125 @@ +delete: + description: Deletes the organization. + operationId: deleteOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the organization + tags: + - Organizations +get: + description: Returns a single organization's details, if the user is authorized + to view it. + operationId: findOrganizationById + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an organization's details + tags: + - Organizations +put: + description: Updates the organization. + operationId: updateOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/OrganizationInput.yaml' + description: Organization to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml new file mode 100644 index 00000000..87b47ea6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findOrganizationCapacityPerFacility + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Facility for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml new file mode 100644 index 00000000..76a114cb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/capacity/metros.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findOrganizationCapacityPerMetro + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + dc: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Metro for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml new file mode 100644 index 00000000..e0a0c2b0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this organization in json format + operationId: findOrganizationCustomdata + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml new file mode 100644 index 00000000..6bced0ec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/devices.yaml @@ -0,0 +1,88 @@ +get: + description: Provides a collection of devices for a given organization. + operationId: findOrganizationDevices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of an organization + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml new file mode 100644 index 00000000..cd713da2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events for a single organization + operationId: findOrganizationEvents + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml new file mode 100644 index 00000000..cf47c1a4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given organization + operationId: findFacilitiesByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the organization + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml new file mode 100644 index 00000000..35f49edf --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Organization's Firmware Sets + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml new file mode 100644 index 00000000..3897f3bd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invitations.yaml @@ -0,0 +1,92 @@ +get: + description: Returns all invitations in an organization. + operationId: findOrganizationInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization invitations + tags: + - Organizations +post: + description: |- + In order to add a user to an organization, they must first be invited. + To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + operationId: createOrganizationInvitation + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml new file mode 100644 index 00000000..17cd9630 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/invoices.yaml @@ -0,0 +1,48 @@ +get: + description: Returns all invoices for an organization + operationId: findOrganizationInvoices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number + in: query + name: page + schema: + type: integer + - description: per page + in: query + name: per_page + schema: + type: integer + - description: filter by status + in: query + name: status + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvoiceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all invoices for an organization + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml new file mode 100644 index 00000000..edba6f62 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/operating-systems.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a listing of available operating systems for the given organization + operationId: findOperatingSystemsByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all operating systems visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml new file mode 100644 index 00000000..029d3c61 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/payment-methods.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all payment methods of an organization. + operationId: findOrganizationPaymentMethods + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all payment methods of an organization + tags: + - Organizations +post: + description: Creates a payment method. + operationId: createPaymentMethod + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodCreateInput.yaml' + description: Payment Method to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethod.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a payment method for the given organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml new file mode 100644 index 00000000..12557edf --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given organization + operationId: findPlansByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml new file mode 100644 index 00000000..004a17e2 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/projects.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a collection of projects that belong to the organization. + operationId: findOrganizationProjects + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/ProjectName.yaml' + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects of an organization + tags: + - Organizations +post: + description: Creates a new project for the organization + operationId: createOrganizationProject + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectCreateInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project for the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml new file mode 100644 index 00000000..a24b6af1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/id/transfers.yaml @@ -0,0 +1,34 @@ +get: + description: Provides a collection of project transfer requests from or to the organization. + operationId: findOrganizationTransfers + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all project transfer requests from or to an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml b/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml new file mode 100644 index 00000000..2f266f80 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/organizations/organization_id/connections.yaml @@ -0,0 +1,79 @@ +get: + description: List the connections belonging to the organization + operationId: organizationListInterconnections + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List organization connections + tags: + - Interconnections +post: + description: Creates a new interconnection request. A Project ID must be specified in + the request body for connections on shared ports. + operationId: createOrganizationInterconnection + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml b/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml new file mode 100644 index 00000000..dfd41e8d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/payment-methods/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Deletes the payment method. + operationId: deletePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the payment method + tags: + - PaymentMethods +get: + description: Returns a payment method + operationId: findPaymentMethodById + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a payment method + tags: + - PaymentMethods +put: + description: Updates the payment method. + operationId: updatePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethodUpdateInput.yaml' + description: Payment Method to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the payment method + tags: + - PaymentMethods diff --git a/spec/services/metalv1/oas3.fetched/paths/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/plans.yaml new file mode 100644 index 00000000..1f04891e --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/plans.yaml @@ -0,0 +1,52 @@ +get: + description: Provides a listing of available plans to provision your device on. + operationId: findPlans + parameters: + - description: Filter plans by its category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter plans by its plan type + in: query + name: type + schema: + type: string + enum: + - standard + - workload_optimized + - custom + example: standard + - description: Filter plans by slug + in: query + name: slug + schema: + type: string + example: c3.small.x86 + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all plans + tags: + - Plans diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml new file mode 100644 index 00000000..d1785435 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id.yaml @@ -0,0 +1,34 @@ +get: + description: Returns a port + operationId: findPortById + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml new file mode 100644 index 00000000..b24d19ed --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/assign.yaml @@ -0,0 +1,48 @@ +post: + description: Assign a hardware port to a virtual network. + operationId: assignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a port to virtual network + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml new file mode 100644 index 00000000..2fa1326a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/bond.yaml @@ -0,0 +1,51 @@ +post: + description: Enabling bonding for one or all ports + operationId: bondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: enable both ports + in: query + name: bulk_enable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Enabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml new file mode 100644 index 00000000..f25e6845 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-2.yaml @@ -0,0 +1,49 @@ +post: + description: Converts a bond port to Layer 2. IP assignments of the port will be + removed. + operationId: convertLayer2 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 2 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml new file mode 100644 index 00000000..681642bb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/convert/layer-3.yaml @@ -0,0 +1,52 @@ +post: + description: Converts a bond port to Layer 3. VLANs must first be unassigned. + operationId: convertLayer3 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortConvertLayer3Input.yaml' + description: IPs to request + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 3 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml new file mode 100644 index 00000000..c824d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/disbond.yaml @@ -0,0 +1,51 @@ +post: + description: Disabling bonding for one or all ports + operationId: disbondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: disable both ports + in: query + name: bulk_disable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Disabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml new file mode 100644 index 00000000..a23eb6fd --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/native-vlan.yaml @@ -0,0 +1,89 @@ +delete: + description: Removes the native VLAN from this port + operationId: deleteNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Remove native VLAN + tags: + - Ports +post: + description: Sets a virtual network on this port as a "native VLAN". The VLAN must + have already been assigned using the using the "Assign a port to a virtual network" + operation. + operationId: assignNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself (ex: ''1001'').' + in: query + name: vnid + required: true + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a native VLAN + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml new file mode 100644 index 00000000..f115290d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/unassign.yaml @@ -0,0 +1,48 @@ +post: + description: Unassign a port for a hardware. + operationId: unassignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Unassign a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml new file mode 100644 index 00000000..fe5e8bec --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments.yaml @@ -0,0 +1,53 @@ +get: + description: Show the port's current VLAN assignments, including if this VLAN is + set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + operationId: findPortVlanAssignments + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PortVlanAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List Current VLAN assignments for a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml new file mode 100644 index 00000000..2c8acbce --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/assignment_id.yaml @@ -0,0 +1,60 @@ +get: + description: Show the details of a specific Port-VLAN assignment, including the + current state and if the VLAN is set as native. + operationId: findPortVlanAssignmentByPortIdAndAssignmentId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Assignment ID + in: path + name: assignment_id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignment.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Show a particular Port VLAN assignment's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml new file mode 100644 index 00000000..2e4b864b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches.yaml @@ -0,0 +1,95 @@ +get: + description: Show all the VLAN assignment batches that have been created for managing + this port's VLAN assignments + operationId: findPortVlanAssignmentBatches + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: List the VLAN Assignment Batches for a port + tags: + - Ports +post: + description: Create a new asynchronous batch request which handles adding and/or + removing the VLANs to which the port is assigned. + operationId: createPortVlanAssignmentBatch + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + description: VLAN Assignment batch details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new Port-VLAN Assignment management batch + tags: + - Ports + diff --git a/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml new file mode 100644 index 00000000..30ba91c7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ports/id/vlan-assignments/batches/batch_id.yaml @@ -0,0 +1,48 @@ +get: + description: Returns the details of an existing Port-VLAN Assignment batch, including + the list of VLANs to assign or unassign, and the current state of the batch. + operationId: findPortVlanAssignmentBatchByPortIdAndBatchId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Batch ID + in: path + name: batch_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VLAN Assignment Batch's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.fetched/paths/projects.yaml b/spec/services/metalv1/oas3.fetched/paths/projects.yaml new file mode 100644 index 00000000..e9c147a9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects.yaml @@ -0,0 +1,62 @@ +get: + description: Returns a collection of projects that the current user is a member + of. + operationId: findProjects + parameters: + - $ref: '../components/parameters/ProjectName.yaml' + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects + tags: + - Projects +post: + description: Creates a new project for the user default organization. If the user + don't have an organization, a new one will be created. + operationId: createProject + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/ProjectCreateFromRootInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml new file mode 100644 index 00000000..24a89814 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the project. + operationId: deleteProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the project + tags: + - Projects +get: + description: Returns a single project if the user has access + operationId: findProjectById + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a project + tags: + - Projects +put: + description: Updates the project. + operationId: updateProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/ProjectUpdateInput.yaml' + description: Project to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml new file mode 100644 index 00000000..34630a7d --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/api-keys.yaml @@ -0,0 +1,81 @@ +get: + description: Returns all API keys for a specific project. + operationId: findProjectAPIKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all API keys for the project. + tags: + - Authentication +post: + description: Creates an API key for a project. + operationId: createProjectAPIKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenInput.yaml' + description: API Key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key for a project. + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml new file mode 100644 index 00000000..017ac903 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/batches.yaml @@ -0,0 +1,40 @@ +get: + description: Returns all batches for the given project + operationId: findBatchesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BatchesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all batches by project + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml new file mode 100644 index 00000000..1698a5b5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-config.yaml @@ -0,0 +1,47 @@ +get: + description: Returns a bgp config + operationId: findBgpConfigByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfig.yaml' + description: | + ok + + When BGP configuration is not enabled empty structure is returned. + When BGP configuration is disabled after being enabled BGP configuration data is returned with status disabled. + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: | + not found + + The project was not found. + summary: Retrieve a bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml new file mode 100644 index 00000000..38957771 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp-configs.yaml @@ -0,0 +1,49 @@ +post: + description: Requests to enable bgp configuration for a project. + operationId: requestBgpConfig + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfigRequestInput.yaml' + description: BGP config Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml new file mode 100644 index 00000000..5a7e9bcb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/bgp/sessions.yaml @@ -0,0 +1,33 @@ +get: + description: Provides a listing of available BGP sessions for the project. + operationId: findProjectBgpSessions + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all BGP sessions for project + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml new file mode 100644 index 00000000..3c665d13 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this project in json format + operationId: findProjectCustomdata + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml new file mode 100644 index 00000000..fb2e85af --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices.yaml @@ -0,0 +1,152 @@ +get: + description: Provides a collection of devices for a given project. + operationId: findProjectDevices + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of a project + tags: + - Devices +post: + description: |- + Creates a new device and provisions it in the specified location. + + Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + operationId: createDevice + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/DeviceCreateInMetroInput.yaml' + - $ref: '../../../components/schemas/DeviceCreateInFacilityInput.yaml' + description: Device to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Device.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml new file mode 100644 index 00000000..a0351123 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/devices/batch.yaml @@ -0,0 +1,53 @@ +post: + description: |- + Creates new devices in batch and provisions them in our datacenter. + operationId: createDeviceBatch + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/InstancesBatchCreateInput.yaml' + description: Batches to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BatchesList.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a devices batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml new file mode 100644 index 00000000..233f1f91 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of events for a single project + operationId: findProjectEvents + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project's events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml new file mode 100644 index 00000000..8c32b31b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given project + operationId: findFacilitiesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the project + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml new file mode 100644 index 00000000..694e4798 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Project's Firmware Sets + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml new file mode 100644 index 00000000..1da5ddf5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/global-bgp-ranges.yaml @@ -0,0 +1,39 @@ +get: + description: Returns all global bgp ranges for a project + operationId: findGlobalBgpRanges + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/GlobalBgpRangeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all global bgp ranges + tags: + - BGP diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml new file mode 100644 index 00000000..5d95c144 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/hardware-reservations.yaml @@ -0,0 +1,64 @@ +get: + description: Provides a collection of hardware reservations for a given project. + operationId: findProjectHardwareReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by facility code, plan name, project name, reservation short ID or device hostname + in: query + name: query + schema: + type: string + - description: Filter by hardware reservation state + in: query + name: state + schema: + enum: + - active + - spare + - need_of_service + type: string + - description: Filter hardware reservation that is provisionable + in: query + name: provisionable + schema: + enum: + - only + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all hardware reservations for a given project + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml new file mode 100644 index 00000000..93765eee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/ips.yaml @@ -0,0 +1,128 @@ +get: + description: Provides a paginated list of IP reservations for a single project. + operationId: findIPReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter project IP reservations by reservation type + in: query + name: types + schema: + items: + type: string + enum: + - global_ipv4 + - private_ipv4 + - public_ipv4 + - public_ipv6 + - vrf + type: array + style: form + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Items returned per page + in: query + name: per_page + schema: + default: 250 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip reservations + tags: + - IPAddresses +post: + description: Request more IP space for a project in order to have additional IP + addresses to assign to devices. If the request is within the max quota, an IP + reservation will be created. If the project will exceed its IP quota, a request + will be submitted for review, and will return an IP Reservation with a `state` + of `pending`. You can automatically have the request fail with HTTP status 422 + instead of triggering the review process by providing the `fail_on_approval_required` + parameter set to `true` in the request. + operationId: requestIPReservation + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservationRequestInput.yaml' + - $ref: '../../../components/schemas/VrfIpReservationCreateInput.yaml' + description: IP Reservation Request to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservation.yaml' + - $ref: '../../../components/schemas/VrfIpReservation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting IP reservations + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml new file mode 100644 index 00000000..d70c4d49 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/licenses.yaml @@ -0,0 +1,97 @@ +get: + description: Provides a collection of licenses for a given project. + operationId: findProjectLicenses + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all licenses + tags: + - Licenses +post: + description: Creates a new license for the given project + operationId: createLicense + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseCreateInput.yaml' + description: License to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/License.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a License + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml new file mode 100644 index 00000000..f7088cda --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given project + operationId: findPlansByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the project + tags: + - Plans diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml new file mode 100644 index 00000000..9452307b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/spot-market-requests.yaml @@ -0,0 +1,88 @@ +get: + description: View all spot market requests for a given project. + operationId: listSpotMarketRequests + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List spot market requests + tags: + - SpotMarket +post: + description: |- + Creates a new spot market request. + + Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + + The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + + The request will fail if there are no available servers matching your criteria. Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a preferred value (see the example request below). + + The request will not fail if we have no servers with that feature in our inventory. + operationId: createSpotMarketRequest + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestCreateInput.yaml' + description: Spot Market Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml new file mode 100644 index 00000000..5aebe140 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/ssh-keys.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a collection of the project's ssh keys. + operationId: findProjectSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: query + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a project's ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createProjectSSHKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyCreateInput.yaml' + description: ssh key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the given project + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml new file mode 100644 index 00000000..cf38cf5b --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/transfers.yaml @@ -0,0 +1,54 @@ +post: + deprecated: true + description: Organization owners can transfer their projects to other organizations. + operationId: createTransferRequest + parameters: + - description: UUID of the project to be transferred + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestInput.yaml' + description: Transfer Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a transfer request + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml new file mode 100644 index 00000000..53d02794 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a project. + operationId: findProjectUsage + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for project + tags: + - Usages diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml new file mode 100644 index 00000000..d6c86c5f --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/virtual-networks.yaml @@ -0,0 +1,106 @@ +get: + description: Provides a list of virtual networks for a single project. + operationId: findVirtualNetworks + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Facility ID (uuid) or Facility Code + deprecated: true + in: query + name: facility + schema: + type: string + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all virtual networks + tags: + - VLANs +post: + description: Creates an virtual network. + operationId: createVirtualNetwork + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkCreateInput.yaml' + description: Virtual Network to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetwork.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml new file mode 100644 index 00000000..426dd045 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/id/vrfs.yaml @@ -0,0 +1,88 @@ +get: + description: Returns the list of VRFs for a single project. + operationId: findVrfs + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRFs in the project + tags: + - VRFs +post: + description: Creates a new VRF in the specified project + operationId: createVrf + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfCreateInput.yaml' + description: VRF to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Vrf.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new VRF in the specified project + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml new file mode 100644 index 00000000..f00ac06c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/connections.yaml @@ -0,0 +1,74 @@ +get: + description: List the connections belonging to the project + operationId: projectListInterconnections + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List project connections + tags: + - Interconnections +post: + description: Creates a new interconnection request + operationId: createProjectInterconnection + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the project's organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml new file mode 100644 index 00000000..f645e882 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/invitations.yaml @@ -0,0 +1,90 @@ +get: + description: Returns all invitations in a project. + operationId: findProjectInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project invitations + tags: + - Projects +post: + description: In order to add a user to a project, they must first be invited. + operationId: createProjectInvitation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml new file mode 100644 index 00000000..701d7695 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Reservation in json + format + operationId: findIPReservationCustomdata + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml new file mode 100644 index 00000000..79362fa3 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/memberships.yaml @@ -0,0 +1,47 @@ +get: + description: Returns all memberships in a project. + operationId: findProjectMemberships + parameters: + - description: Search by member full name, id and email. + in: query + name: search + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MembershipList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project memberships + tags: + - Projects diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml new file mode 100644 index 00000000..3ab78d3a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/metal-gateways.yaml @@ -0,0 +1,91 @@ +get: + description: Return all metal gateways for a project + operationId: findMetalGatewaysByProject + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MetalGatewayList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Returns all metal gateways for a project + tags: + - MetalGateways +post: + description: Create a metal gateway in a project + operationId: createMetalGateway + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGatewayCreateInput.yaml' + - $ref: '../../../components/schemas/VrfMetalGatewayCreateInput.yaml' + description: Metal Gateway to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGateway.yaml' + - $ref: '../../../components/schemas/VrfMetalGateway.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml new file mode 100644 index 00000000..f3e16aa1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all reservations. + operationId: findSelfServiceReservations + parameters: + - $ref: '../../../../components/parameters/Page.yaml' + - $ref: '../../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Filter reservations by items category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all reservations + tags: + - SelfServiceReservations +post: + description: Creates a reservation. + operationId: createSelfServiceReservation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/CreateSelfServiceReservationRequest.yaml' + description: reservation to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml new file mode 100644 index 00000000..22fe23df --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/projects/project_id/self-service/reservations/id.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a reservation + operationId: findSelfServiceReservation + parameters: + - description: Reservation short_id + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml b/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml new file mode 100644 index 00000000..524c11a7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/reset-password.yaml @@ -0,0 +1,53 @@ +delete: + description: Resets current user password. + operationId: resetPassword + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/NewPassword.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Reset current user password + tags: + - PasswordResetTokens +post: + description: Creates a password reset token + operationId: createPasswordResetToken + parameters: + - description: Email of user to create password reset token + in: query + name: email + required: true + schema: + type: string + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a password reset token + tags: + - PasswordResetTokens diff --git a/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml b/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml new file mode 100644 index 00000000..c817958a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/routes/id.yaml @@ -0,0 +1,137 @@ +delete: + summary: Delete a VRF Route + description: Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + operationId: deleteVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a VRF Route + description: Returns a single VRF Route resource + operationId: findVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +put: + summary: Update a VRF Route + description: Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + operationId: updateVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRouteUpdateInput.yaml' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unprocessable Entity + "429": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Too Many Requests + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml new file mode 100644 index 00000000..566282b1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/routes/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the VRF route events + operationId: findVrfRouteEvents + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve VRF route events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml b/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml new file mode 100644 index 00000000..4ef048ff --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/spot-market-requests/id.yaml @@ -0,0 +1,80 @@ +delete: + description: Deletes the spot market request. + operationId: deleteSpotMarketRequest + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Terminate associated spot instances + in: query + name: force_termination + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the spot market request + tags: + - SpotMarket +get: + description: Returns a single spot market request + operationId: findSpotMarketRequestById + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SpotMarketRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml new file mode 100644 index 00000000..e45af1b4 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ssh-keys.yaml @@ -0,0 +1,55 @@ +get: + description: Returns a collection of the user’s ssh keys. + operationId: findSSHKeys + parameters: + - description: Search by key, label, or fingerprint + in: query + name: search + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createSSHKey + requestBody: + $ref: '../components/requestBodies/SSHKeyCreateInput.yaml' + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the current user + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml new file mode 100644 index 00000000..5cc39162 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/ssh-keys/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the ssh key. + operationId: deleteSSHKey + parameters: + - description: ssh key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the ssh key + tags: + - SSHKeys +get: + description: Returns a single ssh key if the user has access + operationId: findSSHKeyById + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a ssh key + tags: + - SSHKeys +put: + description: Updates the ssh key. + operationId: updateSSHKey + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKeyInput.yaml' + description: ssh key to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the ssh key + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml b/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml new file mode 100644 index 00000000..45169cee --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/support-requests.yaml @@ -0,0 +1,40 @@ +post: + description: Support Ticket. + operationId: requestSuppert + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/SupportRequestInput.yaml' + description: Support Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a support ticket + tags: + - SupportRequest diff --git a/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml b/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml new file mode 100644 index 00000000..e9ea5bdb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/transfers/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Decline a transfer request. + operationId: declineTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline a transfer request + tags: + - TransferRequests +get: + description: Returns a single transfer request. + operationId: findTransferRequestById + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/TransferRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View a transfer request + tags: + - TransferRequests +put: + description: Accept a transfer request. + operationId: acceptTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept a transfer request + tags: + - TransferRequests diff --git a/spec/services/metalv1/oas3.fetched/paths/user.yaml b/spec/services/metalv1/oas3.fetched/paths/user.yaml new file mode 100644 index 00000000..bb9f08d1 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user.yaml @@ -0,0 +1,57 @@ +get: + description: Returns the user object for the currently logged-in user. + operationId: findCurrentUser + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the current user + tags: + - Users +put: + description: Updates the currently logged-in user. + operationId: updateCurrentUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserUpdateInput.yaml' + description: User to update + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the current user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml b/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml new file mode 100644 index 00000000..06f1a274 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/api-keys.yaml @@ -0,0 +1,72 @@ +post: + description: Creates a API key for the current user. + operationId: createAPIKey + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenInput.yaml' + description: API key to create + required: true + parameters: + - $ref: '../../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key + tags: + - Authentication +get: + description: Returns all API keys for the current user. + operationId: findAPIKeys + parameters: + - description: Search by description + in: query + name: search + schema: + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all user API keys + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml b/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml new file mode 100644 index 00000000..59edb412 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the current user API key. + operationId: deleteUserAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml new file mode 100644 index 00000000..ac3f4be6 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/app.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaApp + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication using authenticator app. + operationId: enableTfaApp + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using app + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml new file mode 100644 index 00000000..b0f88de7 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/recovery-codes.yaml @@ -0,0 +1,62 @@ +get: + description: Returns my recovery codes. + operationId: findRecoveryCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve my recovery codes + tags: + - OTPs +post: + description: Generate a new set of recovery codes. + operationId: regenerateCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Generate new recovery codes + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml new file mode 100644 index 00000000..d7b17f74 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaSms + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication with sms. + operationId: enableTfaSms + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using sms + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml new file mode 100644 index 00000000..c2bea8dc --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/sms/receive.yaml @@ -0,0 +1,33 @@ +post: + description: Sends an OTP to the user's mobile phone. + operationId: receiveCodes + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + "500": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: internal server error + summary: Receive an OTP per sms + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml b/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml new file mode 100644 index 00000000..750dc153 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/user/otp/verify/otp.yaml @@ -0,0 +1,29 @@ +post: + description: It verifies the user once a valid OTP is provided. It gives back a + session token, essentially logging in the user. + operationId: findEnsureOtp + parameters: + - description: OTP + in: path + name: otp + required: true + schema: + type: string + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Verify user by providing an OTP + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml b/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml new file mode 100644 index 00000000..6a952f3c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/userdata/validate.yaml @@ -0,0 +1,27 @@ +post: + description: Validates user data (Userdata) + operationId: validateUserdata + parameters: + - description: Userdata to validate + in: query + name: userdata + schema: + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Validate user data + tags: + - Userdata diff --git a/spec/services/metalv1/oas3.fetched/paths/users.yaml b/spec/services/metalv1/oas3.fetched/paths/users.yaml new file mode 100644 index 00000000..ce1b579a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users.yaml @@ -0,0 +1,63 @@ +get: + description: Returns a list of users that the are accessible to the current user + (all users in the current user’s projects, essentially). + operationId: findUsers + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/UserList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all users + tags: + - Users +post: + description: Creates a user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserCreateInput.yaml' + description: User to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + example: + errors: + - "Email address username@example.com has already been taken" + description: unprocessable entity + summary: Create a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/users/id.yaml b/spec/services/metalv1/oas3.fetched/paths/users/id.yaml new file mode 100644 index 00000000..4e4c8a08 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single user if the user has access + operationId: findUserById + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml b/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml new file mode 100644 index 00000000..8ba9eabb --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/users/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this user in json format + operationId: findUserCustomdata + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml b/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml new file mode 100644 index 00000000..a0d9e02c --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/verify-email.yaml @@ -0,0 +1,60 @@ +post: + description: Creates an email verification request + operationId: createValidationRequest + parameters: + - description: Email for verification request + in: query + name: login + required: true + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email verification request + tags: + - UserVerificationTokens +put: + description: Consumes an email verification token and verifies the user associated + with it. + operationId: consumeVerificationRequest + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/VerifyEmail.yaml' + description: Email to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Verify a user using an email verification token + tags: + - UserVerificationTokens diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml new file mode 100644 index 00000000..01a6b0a5 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id.yaml @@ -0,0 +1,118 @@ +delete: + description: Delete a virtual circuit from a Dedicated Port. + operationId: deleteVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete a virtual circuit + tags: + - Interconnections +get: + description: Get the details of a virtual circuit + operationId: getVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get a virtual circuit + tags: + - Interconnections +put: + description: Update the details of a virtual circuit. + operationId: updateVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuitUpdateInput.yaml' + description: Updated Virtual Circuit details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update a virtual circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml new file mode 100644 index 00000000..f255c449 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-circuits/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the virtual circuit events + operationId: findVirtualCircuitEvents + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve virtual circuit events + tags: + - Events diff --git a/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml b/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml new file mode 100644 index 00000000..381d1a74 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/virtual-networks/id.yaml @@ -0,0 +1,94 @@ +delete: + description: Deletes a virtual network. + operationId: deleteVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete a virtual network + tags: + - VLANs +get: + description: Get a virtual network. + operationId: getVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get a virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml new file mode 100644 index 00000000..98e76b4a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the VRF + operationId: deleteVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the VRF + tags: + - VRFs +get: + description: Returns a single VRF resource + operationId: findVrfById + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VRF + tags: + - VRFs +put: + description: Updates the VRF. + operationId: updateVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfUpdateInput.yaml' + description: VRF to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml new file mode 100644 index 00000000..1a36ebd9 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/ips.yaml @@ -0,0 +1,53 @@ +get: + description: Returns the list of VRF IP Reservations for the VRF. + operationId: findVrfIpReservations + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfIpReservationList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml new file mode 100644 index 00000000..35ad02f0 --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/id/routes.yaml @@ -0,0 +1,92 @@ +post: + description: | + Create a route in a VRF. Currently only static default routes are supported. + + Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createVrfRoute + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteCreateInput.yaml' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + summary: Create a VRF route + tags: + - VRFs + +get: + description: Returns the list of routes for the VRF + operationId: getVrfRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + summary: Retrieve all routes in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml b/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml new file mode 100644 index 00000000..98c2e06a --- /dev/null +++ b/spec/services/metalv1/oas3.fetched/paths/vrfs/vrf_id/ips/id.yaml @@ -0,0 +1,60 @@ +get: + description: Returns the IP Reservation for the VRF. + operationId: findVrfIpReservation + parameters: + - description: VRF UUID + in: path + name: vrf_id + required: true + schema: + type: string + format: uuid + - description: IP UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/VrfIpReservation.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/components/parameters/DeviceSearch.yaml b/spec/services/metalv1/oas3.patched/components/parameters/DeviceSearch.yaml new file mode 100644 index 00000000..0ff7e3c5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/DeviceSearch.yaml @@ -0,0 +1,5 @@ +description: Search by hostname, description, short_id, reservation short_id, tags, plan name, plan slug, facility code, facility name, operating system name, operating system slug, IP addresses. +in: query +name: search +schema: + type: string diff --git a/spec/services/metalv1/oas3.patched/components/parameters/Exclude.yaml b/spec/services/metalv1/oas3.patched/components/parameters/Exclude.yaml new file mode 100644 index 00000000..dc844437 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/Exclude.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to exclude. Excluded objects will return only the href + attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. +in: query +name: exclude +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.patched/components/parameters/Include.yaml b/spec/services/metalv1/oas3.patched/components/parameters/Include.yaml new file mode 100644 index 00000000..715b84d9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/Include.yaml @@ -0,0 +1,12 @@ +description: |- + Nested attributes to include. Included objects will return their full + attributes. Attribute names can be dotted (up to 3 levels) to included deeply + nested objects. +in: query +name: include +schema: + items: + type: string + type: array +style: form +explode: false diff --git a/spec/services/metalv1/oas3.patched/components/parameters/Page.yaml b/spec/services/metalv1/oas3.patched/components/parameters/Page.yaml new file mode 100644 index 00000000..98b2cf73 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/Page.yaml @@ -0,0 +1,9 @@ +description: Page to return +in: query +name: page +schema: + default: 1 + format: int32 + maximum: 100000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/parameters/PerPage.yaml b/spec/services/metalv1/oas3.patched/components/parameters/PerPage.yaml new file mode 100644 index 00000000..1d262157 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/PerPage.yaml @@ -0,0 +1,9 @@ +description: Items returned per page +in: query +name: per_page +schema: + default: 10 + format: int32 + maximum: 1000 + minimum: 1 + type: integer \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/parameters/ProjectName.yaml b/spec/services/metalv1/oas3.patched/components/parameters/ProjectName.yaml new file mode 100644 index 00000000..f2e0a162 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/parameters/ProjectName.yaml @@ -0,0 +1,5 @@ +description: Filter results by name. +in: query +name: name +schema: + type: string diff --git a/spec/services/metalv1/oas3.patched/components/requestBodies/InterconnectionCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/requestBodies/InterconnectionCreateInput.yaml new file mode 100644 index 00000000..8a836571 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/requestBodies/InterconnectionCreateInput.yaml @@ -0,0 +1,9 @@ +content: + application/json: + schema: + oneOf: + - $ref: '../schemas/DedicatedPortCreateInput.yaml' + - $ref: '../schemas/VlanFabricVcCreateInput.yaml' + - $ref: '../schemas/VrfFabricVcCreateInput.yaml' +description: Dedicated port or shared interconnection (also known as Fabric VC) creation request +required: true diff --git a/spec/services/metalv1/oas3.patched/components/requestBodies/InvitationInput.yaml b/spec/services/metalv1/oas3.patched/components/requestBodies/InvitationInput.yaml new file mode 100644 index 00000000..876f949e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/requestBodies/InvitationInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/InvitationInput.yaml' +description: Invitation to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/requestBodies/PortAssignInput.yaml b/spec/services/metalv1/oas3.patched/components/requestBodies/PortAssignInput.yaml new file mode 100644 index 00000000..c9e68501 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/requestBodies/PortAssignInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/PortAssignInput.yaml' +description: 'Virtual Network ID. May be the UUID of the Virtual Network record, or the VLAN value itself (ex: ''1001'').' +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/requestBodies/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/requestBodies/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..b93aa52a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/requestBodies/SSHKeyCreateInput.yaml @@ -0,0 +1,6 @@ +content: + application/json: + schema: + $ref: '../schemas/SSHKeyCreateInput.yaml' +description: ssh key to create +required: true \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Address.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Address.yaml new file mode 100644 index 00000000..7cbab354 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Address.yaml @@ -0,0 +1,20 @@ +properties: + address: + type: string + address2: + type: string + city: + type: string + coordinates: + $ref: './Coordinates.yaml' + country: + type: string + state: + type: string + zip_code: + type: string +required: +- address +- zip_code +- country +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Attribute.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Attribute.yaml new file mode 100644 index 00000000..fdd3bcde --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Attribute.yaml @@ -0,0 +1,17 @@ +properties: + namespace: + readOnly: true + type: string + description: Attribute namespace + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + data: + $ref: "./AttributeData.yaml" diff --git a/spec/services/metalv1/oas3.patched/components/schemas/AttributeData.yaml b/spec/services/metalv1/oas3.patched/components/schemas/AttributeData.yaml new file mode 100644 index 00000000..bba3c908 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/AttributeData.yaml @@ -0,0 +1,17 @@ +properties: + latest: + readOnly: true + type: boolean + description: Boolean flag to know if the firmware set is the latest for the model and vendor + model: + readOnly: true + type: string + description: Model on which this firmware set can be applied + vendor: + readOnly: true + type: string + description: Vendor on which this firmware set can be applied + plan: + readOnly: true + type: string + description: Plan where the firmware set can be applied diff --git a/spec/services/metalv1/oas3.patched/components/schemas/AuthToken.yaml b/spec/services/metalv1/oas3.patched/components/schemas/AuthToken.yaml new file mode 100644 index 00000000..8a43219c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/AuthToken.yaml @@ -0,0 +1,26 @@ +properties: + created_at: + format: date-time + type: string + description: + description: Available only for API keys + type: string + id: + format: uuid + type: string + project: + allOf: + - $ref: './Project.yaml' + - description: Available only for project tokens + read_only: + type: boolean + token: + type: string + updated_at: + format: date-time + type: string + user: + allOf: + - $ref: './User.yaml' + - description: Available only for user tokens +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenInput.yaml new file mode 100644 index 00000000..203a139e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + read_only: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenList.yaml new file mode 100644 index 00000000..c99752f6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/AuthTokenList.yaml @@ -0,0 +1,6 @@ +properties: + api_keys: + items: + $ref: './AuthToken.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BGPSessionInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BGPSessionInput.yaml new file mode 100644 index 00000000..a06baae8 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BGPSessionInput.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + description: Address family for BGP session. + enum: + - ipv4 + - ipv6 + example: ipv4 + type: string + default_route: + default: false + description: Set the default route policy. + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Batch.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Batch.yaml new file mode 100644 index 00000000..919aa209 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Batch.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + devices: + items: + $ref: './Href.yaml' + type: array + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + quantity: + type: integer + state: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BatchesList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BatchesList.yaml new file mode 100644 index 00000000..0da8f68b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BatchesList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './Batch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpConfig.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpConfig.yaml new file mode 100644 index 00000000..0947e2f2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpConfig.yaml @@ -0,0 +1,61 @@ +properties: + asn: + description: Autonomous System Number. ASN is required with Global BGP. With Local + BGP the private ASN, 65000, is assigned. + example: 65000 + format: int32 + type: integer + created_at: + format: date-time + type: string + deployment_type: + description: | + In a Local BGP deployment, a customer uses an internal ASN to control routes within a single Equinix Metal datacenter. This means that the routes are never advertised to the global Internet. Global BGP, on the other hand, requires a customer to have a registered ASN and IP space. + enum: + - global + - local + example: local + type: string + href: + type: string + id: + format: uuid + type: string + max_prefix: + default: 10 + description: The maximum number of route filters allowed per server + type: integer + md5: + description: (Optional) Password for BGP session in plaintext (not a checksum) + nullable: true + type: string + project: + $ref: './Href.yaml' + ranges: + description: The IP block ranges associated to the ASN (Populated in Global BGP + only) + items: + $ref: './GlobalBgpRange.yaml' + type: array + requested_at: + format: date-time + type: string + route_object: + description: Specifies AS-MACRO (aka AS-SET) to use when building client route + filters + type: string + sessions: + description: The direct connections between neighboring routers that want to exchange + routing information. + items: + $ref: './BgpSession.yaml' + type: array + status: + description: Status of the BGP Config. Status "requested" is valid only with the + "global" deployment_type. + enum: + - requested + - enabled + - disabled + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpConfigRequestInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpConfigRequestInput.yaml new file mode 100644 index 00000000..9cd1aa01 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpConfigRequestInput.yaml @@ -0,0 +1,30 @@ +properties: + asn: + type: integer + minimum: 0 + maximum: 4294967295 + description: Autonomous System Number for local BGP deployment. + example: 65000 + deployment_type: + description: Wether the BGP deployment is local or global. Local deployments are configured immediately. Global deployments will need to be reviewed by Equinix Metal engineers. + type: string + example: local + enum: + - local + - global + md5: + type: string + description: | + The plaintext password to share between BGP neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + use_case: + description: A use case explanation (necessary for global BGP request review). + type: string +required: +- deployment_type +- asn +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighbor.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighbor.yaml new file mode 100644 index 00000000..02135006 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighbor.yaml @@ -0,0 +1,43 @@ +properties: + id: + description: The unique identifier for the resource + format: uuid + readOnly: true + type: string + example: aea82f16-57ec-412c-9523-b7f2b27635b2 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + example: 12345 + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + metal_gateway: + $ref: './VrfMetalGateway.yaml' + state: + readOnly: true + type: string + enum: + - active + - deleting + - pending + - ready + href: + type: string + readOnly: true + example: /bgp-dynamic-neighbors/aea82f16-57ec-412c-9523-b7f2b27635b2 + created_at: + format: date-time + readOnly: true + type: string + created_by: + $ref: './UserLimited.yaml' + updated_at: + format: date-time + readOnly: true + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborCreateInput.yaml new file mode 100644 index 00000000..c53701f3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + bgp_neighbor_range: + description: Network range of the dynamic BGP neighbor in CIDR format + type: string + example: 192.168.1.0/25 + bgp_neighbor_asn: + description: The ASN of the dynamic BGP neighbor + type: integer + example: 12345 + tags: + items: + type: string + type: array +required: +- bgp_neighbor_range +- bgp_neighbor_asn diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborList.yaml new file mode 100644 index 00000000..69e368a3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpDynamicNeighborList.yaml @@ -0,0 +1,8 @@ +properties: + bgp_dynamic_neighbors: + items: + $ref: './BgpDynamicNeighbor.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpNeighborData.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpNeighborData.yaml new file mode 100644 index 00000000..8914ad1a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpNeighborData.yaml @@ -0,0 +1,61 @@ +properties: + address_family: + description: Address Family for IP Address. Accepted values are 4 or 6 + example: 4 + format: int32 + type: integer + customer_as: + description: The customer's ASN. In a local BGP deployment, this will be an internal + ASN used to route within the data center. For a global BGP deployment, this + will be the your own ASN, configured when you set up BGP for your project. + example: 65000 + format: int32 + type: integer + customer_ip: + description: The device's IP address. For an IPv4 BGP session, this is typically + the private bond0 address for the device. + example: 10.32.16.1 (IPv4) or 2604:1380:4111:2700::1 (IPv6) + type: string + md5_enabled: + description: True if an MD5 password is configured for the project. + type: boolean + md5_password: + description: The MD5 password configured for the project, if set. + type: string + multihop: + description: True when the BGP session should be configured as multihop. + type: boolean + peer_as: + description: The Peer ASN to use when configuring BGP on your device. + example: 65530 + format: int32 + type: integer + peer_ips: + description: A list of one or more IP addresses to use for the Peer IP section + of your BGP configuration. For non-multihop sessions, this will typically be + a single gateway address for the device. For multihop sessions, it will be a + list of IPs. + example: + - 169.254.255.1 + - 169.254.255.2 + items: + type: string + type: array + routes_in: + description: A list of project subnets + example: + - exact: true + route: 10.32.16.0/31 + items: + $ref: "./BgpRoute.yaml" + type: array + routes_out: + description: A list of outgoing routes. Only populated if the BGP session has + default route enabled. + example: + - exact: true + route: 0.0.0.0/0 + items: + $ref: "./BgpRoute.yaml" + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpRoute.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpRoute.yaml new file mode 100644 index 00000000..18d325c3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpRoute.yaml @@ -0,0 +1,6 @@ +properties: + exact: + type: boolean + route: + example: 10.32.16.0/31 + type: string diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml new file mode 100644 index 00000000..50bcc227 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml @@ -0,0 +1,37 @@ +properties: + address_family: + enum: + - ipv4 + - ipv6 + type: string + created_at: + format: date-time + type: string + default_route: + type: boolean + device: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + learned_routes: + items: + description: IPv4 or IPv6 range + example: 10.32.16.0/31 + type: string + type: array + status: + description: ' The status of the BGP Session. Multiple status values may be reported + when the device is connected to multiple switches, one value per switch. Each + status will start with "unknown" and progress to "up" or "down" depending on + the connected device. Subsequent "unknown" values indicate a problem acquiring + status from the switch. ' + type: string + updated_at: + format: date-time + type: string +required: +- address_family +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionList.yaml new file mode 100644 index 00000000..78bcbcb6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionList.yaml @@ -0,0 +1,6 @@ +properties: + bgp_sessions: + items: + $ref: './BgpSession.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionNeighbors.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionNeighbors.yaml new file mode 100644 index 00000000..11bc4c5e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpSessionNeighbors.yaml @@ -0,0 +1,7 @@ +properties: + bgp_neighbors: + description: A list of BGP session neighbor data + items: + $ref: './BgpNeighborData.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BondPortData.yaml b/spec/services/metalv1/oas3.patched/components/schemas/BondPortData.yaml new file mode 100644 index 00000000..da6a03d7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/BondPortData.yaml @@ -0,0 +1,9 @@ +properties: + id: + description: ID of the bonding port + type: string + format: uuid + name: + description: Name of the port interface for the bond ("bond0") + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityInfo.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityInfo.yaml new file mode 100644 index 00000000..e970ec63 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityInfo.yaml @@ -0,0 +1,10 @@ +properties: + available: + type: boolean + facility: + type: string + plan: + type: string + quantity: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityList.yaml new file mode 100644 index 00000000..530332a2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerFacilityList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerFacilityInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml new file mode 100644 index 00000000..2fb51ba2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroInfo.yaml @@ -0,0 +1,15 @@ +properties: + available: + description: Returns true if there is enough capacity in the metro to fulfill + the quantity set. Returns false if there is not enough. + type: boolean + metro: + description: The metro ID or code sent to check capacity. + type: string + plan: + description: The plan ID or slug sent to check capacity. + type: string + quantity: + description: The number of servers sent to check capacity. + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroList.yaml new file mode 100644 index 00000000..9ec1ecc1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityCheckPerMetroList.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './CapacityCheckPerMetroInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityInput.yaml new file mode 100644 index 00000000..c1a02be0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityInput.yaml @@ -0,0 +1,6 @@ +properties: + servers: + items: + $ref: './ServerInfo.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityLevelPerBaremetal.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityLevelPerBaremetal.yaml new file mode 100644 index 00000000..e187f6f9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityLevelPerBaremetal.yaml @@ -0,0 +1,4 @@ +properties: + level: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityList.yaml new file mode 100644 index 00000000..ecc3f627 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityList.yaml @@ -0,0 +1,4 @@ +properties: + capacity: + $ref: './CapacityReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CapacityReport.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CapacityReport.yaml new file mode 100644 index 00000000..7af91e6b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CapacityReport.yaml @@ -0,0 +1,5 @@ +additionalProperties: + type: object + additionalProperties: + $ref: './CapacityLevelPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Component.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Component.yaml new file mode 100644 index 00000000..efce1ccc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Component.yaml @@ -0,0 +1,55 @@ +properties: + uuid: + readOnly: true + type: string + description: Component UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + vendor: + readOnly: true + type: string + description: Component vendor + example: "equinix" + model: + readOnly: true + type: array + description: List of models where this component version can be applied + items: + type: string + example: romed8hm3 + filename: + readOnly: true + type: string + description: name of the file + version: + readOnly: true + type: string + description: Version of the component + example: 1.5.0 + component: + readOnly: true + type: string + description: Component type + example: bmc + checksum: + readOnly: true + type: string + description: File checksum + upstream_url: + readOnly: true + type: string + description: Location of the file + repository_url: + readOnly: true + type: string + description: Location of the file in the repository + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Coordinates.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Coordinates.yaml new file mode 100644 index 00000000..036c6627 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Coordinates.yaml @@ -0,0 +1,6 @@ +properties: + latitude: + type: string + longitude: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CreateEmailInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CreateEmailInput.yaml new file mode 100644 index 00000000..5aa749bd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CreateEmailInput.yaml @@ -0,0 +1,6 @@ +properties: + address: + type: string +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/CreateSelfServiceReservationRequest.yaml b/spec/services/metalv1/oas3.patched/components/schemas/CreateSelfServiceReservationRequest.yaml new file mode 100644 index 00000000..84e9138c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/CreateSelfServiceReservationRequest.yaml @@ -0,0 +1,23 @@ +properties: + item: + items: + $ref: './SelfServiceReservationItemRequest.yaml' + type: array + notes: + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + start_date: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DedicatedPortCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DedicatedPortCreateInput.yaml new file mode 100644 index 00000000..bfd4f814 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DedicatedPortCreateInput.yaml @@ -0,0 +1,53 @@ +properties: + billing_account_name: + description: The billing account name of the Equinix Fabric account. + type: string + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. For interconnections with Dedicated Ports, this will be the location of the issued Dedicated Ports. + type: string + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Fabric VCs won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Dedicated Ports, this can be 10Gbps or 100Gbps. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a dedicated port, the value of this field should be 'dedicated'. + type: string + enum: + - dedicated + use_case: + description: The intended use case of the dedicated port. + type: string +required: +- name +- metro +- type +- redundancy +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml new file mode 100644 index 00000000..120e1583 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml @@ -0,0 +1,179 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + bonding_mode: + type: integer + created_at: + format: date-time + type: string + created_by: + allOf: + - $ref: './UserLite.yaml' + - description: The user that created the device. + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + facility: + $ref: './Facility.yaml' + firmware_set_id: + description: The UUID of the firmware set to associate with the device. + format: uuid + type: string + hardware_reservation: + $ref: './HardwareReservation.yaml' + hostname: + type: string + href: + type: string + id: + format: uuid + type: string + image_url: + type: string + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array + ipxe_script_url: + type: string + iqn: + type: string + locked: + type: boolean + description: Prevents accidental deletion of this resource when set to true. + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + network_frozen: + type: boolean + description: Whether network mode changes such as converting to/from Layer2 or Layer3 networking, bonding or disbonding network interfaces are permitted for the device. + network_ports: + description: + By default, servers at Equinix Metal are configured in a “bonded” mode + using LACP (Link Aggregation Control Protocol). Each 2-NIC server is + configured with a single bond (namely bond0) with both interfaces eth0 + and eth1 as members of the bond in a default Layer 3 mode. Some device + plans may have a different number of ports and bonds available. + type: array + items: + $ref: './Port.yaml' + operating_system: + $ref: './OperatingSystem.yaml' + actions: + description: Actions supported by the device instance. + items: + properties: + type: + type: string + name: + type: string + type: object + type: array + plan: + $ref: './Plan.yaml' + project: + $ref: './Project.yaml' + project_lite: + allOf: + - $ref: './Href.yaml' + - description: Lite version of project object when included + provisioning_events: + items: + $ref: './Event.yaml' + type: array + provisioning_percentage: + description: Only visible while device provisioning + format: float + type: number + root_password: + description: Root password is automatically generated when server is provisioned + and it is removed after 24 hours + type: string + short_id: + type: string + spot_instance: + description: Whether or not the device is a spot instance. + type: boolean + spot_price_max: + description: |- + The maximum price per hour you are willing to pay to keep this spot + instance. If you are outbid, the termination will be set allowing two + minutes before shutdown. + format: float + type: number + ssh_keys: + items: + $ref: './Href.yaml' + type: array + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + storage: + $ref: './Storage.yaml' + switch_uuid: + description: |- + Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + tags: + items: + type: string + type: array + termination_time: + description: |- + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + updated_at: + format: date-time + type: string + user: + type: string + userdata: + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + sos: + description: Hostname used to connect to the instance via the SOS (Serial over SSH) out-of-band console. + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceActionInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceActionInput.yaml new file mode 100644 index 00000000..671b5974 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceActionInput.yaml @@ -0,0 +1,30 @@ +type: object +required: +- type +properties: + type: + description: Action to perform. See Device.actions for possible actions. + type: string + enum: + - power_on + - power_off + - reboot + - rescue + - reinstall + force_delete: + description: May be required to perform actions under certain conditions + type: boolean + deprovision_fast: + description: When type is `reinstall`, enabling fast deprovisioning will bypass full disk wiping. + type: boolean + preserve_data: + description: When type is `reinstall`, preserve the existing data on all disks except the operating-system disk. + type: boolean + operating_system: + description: When type is `reinstall`, use this `operating_system` (defaults to the current `operating system`) + type: string + example: ubuntu_22_04 + ipxe_script_url: + description: When type is `reinstall`, use this `ipxe_script_url` (`operating_system` must be `custom_ipxe`, defaults to the current `ipxe_script_url`) + type: string + diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInFacilityInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInFacilityInput.yaml new file mode 100644 index 00000000..655100bb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInFacilityInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './FacilityInput.yaml' +- $ref: './DeviceCreateInput.yaml' \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInMetroInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInMetroInput.yaml new file mode 100644 index 00000000..90c69ecd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInMetroInput.yaml @@ -0,0 +1,3 @@ +allOf: +- $ref: './MetroInput.yaml' +- $ref: './DeviceCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInput.yaml new file mode 100644 index 00000000..a5e47e26 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceCreateInput.yaml @@ -0,0 +1,213 @@ +properties: + always_pxe: + default: false + description: |- + When true, devices with a `custom_ipxe` OS will always boot to iPXE. The + default setting of false ensures that iPXE will be used on only the + first boot. + type: boolean + billing_cycle: + description: The billing cycle of the device. + enum: + - hourly + - daily + - monthly + - yearly + type: string + customdata: + description: |- + Customdata is an arbitrary JSON value that can be accessed via the + metadata service. + default: {} + type: object + additionalProperties: true + description: + description: |- + Any description of the device or how it will be used. This may be used + to inform other API consumers with project access. + type: string + features: + description: |- + The features attribute allows you to optionally specify what features your server should have. + + In the API shorthand syntax, all features listed are `required`: + + ``` + { "features": ["tpm"] } + ``` + + Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a `preferred` value. The request will not fail if we have no servers with that feature in our inventory. The API offers an alternative syntax for mixing preferred and required features: + + ``` + { "features": { "tpm": "required", "raid": "preferred" } } + ``` + + The request will only fail if there are no available servers matching the required `tpm` criteria. + items: + type: string + type: array + hardware_reservation_id: + default: "" + description: |- + The Hardware Reservation UUID to provision. Alternatively, `next-available` can be specified to select from any of the available hardware reservations. An error will be returned if the requested reservation option is not available. + + See [Reserved Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/) for more details. + example: next-available + type: string + hostname: + description: The hostname to use within the operating system. The same hostname + may be used on multiple devices within a project. + type: string + ip_addresses: + default: + - address_family: 4 + public: true + - address_family: 4 + public: false + - address_family: 6 + public: true + description: |- + The `ip_addresses attribute will allow you to specify the addresses you want created with your device. + + The default value configures public IPv4, public IPv6, and private IPv4. + + Private IPv4 address is required. When specifying `ip_addresses`, one of the array items must enable private IPv4. + + Some operating systems require public IPv4 address. In those cases you will receive an error message if public IPv4 is not enabled. + + For example, to only configure your server with a private IPv4 address, you can send `{ "ip_addresses": [{ "address_family": 4, "public": false }] }`. + + It is possible to request a subnet size larger than a `/30` by assigning addresses using the UUID(s) of ip_reservations in your project. + + For example, `{ "ip_addresses": [..., {"address_family": 4, "public": true, "ip_reservations": ["uuid1", "uuid2"]}] }` + + To access a server without public IPs, you can use our Out-of-Band console access (SOS) or proxy through another server in the project with public IPs enabled. + items: + $ref: './IPAddress.yaml' + type: array + ipxe_script_url: + description: |- + When set, the device will chainload an iPXE Script at boot fetched from the supplied URL. + + See [Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/) for more details. + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/ + type: string + locked: + default: false + description: Whether the device should be locked, preventing accidental deletion. + type: boolean + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + no_ssh_keys: + default: false + description: Overrides default behaviour of attaching all of the organization + members ssh keys and project ssh keys to device if no specific keys specified + type: boolean + operating_system: + description: The slug of the operating system to provision. Check the Equinix + Metal operating system documentation for rules that may be imposed per operating + system, including restrictions on IP address options and device plans. + type: string + plan: + description: The slug of the device plan to provision. + type: string + example: "c3.large.x86" + private_ipv4_subnet_size: + default: 28 + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. + format: int32 + type: integer + x-deprecated: true + project_ssh_keys: + description: |+ + A list of UUIDs identifying the device parent project + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also appear in the device metadata. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + default: 31 + description: Deprecated. Use ip_addresses. Subnet range for addresses allocated + to this device. Your project must have addresses available for a non-default + request. + format: int32 + type: integer + x-deprecated: true + spot_instance: + type: boolean + description: Create a spot instance. Spot instances are created with a maximum + bid price. If the bid price is not met, the spot instance will be terminated as indicated by the `termination_time` field. + spot_price_max: + format: float + type: number + example: 1.23 + description: The maximum amount to bid for a spot instance. + ssh_keys: + description: | + A list of new or existing project ssh_keys + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + These keys are added in addition to any keys defined by + `project_ssh_keys` and `user_ssh_keys`. + items: + $ref: './SSHKeyInput.yaml' + type: array + storage: + $ref: './Storage.yaml' + tags: + items: + type: string + type: array + termination_time: + description: | + When the device will be terminated. If you don't supply timezone info, the timestamp is assumed to be in UTC. + + This is commonly set in advance for + ephemeral spot market instances but this field may also be set with + on-demand and reservation instances to automatically delete the resource + at a given time. The termination time can also be used to release a + hardware reservation instance at a given time, keeping the reservation + open for other uses. On a spot market device, the termination time will + be set automatically when outbid. + format: date-time + example: "2021-09-03T16:32:00+03:00" + type: string + user_ssh_keys: + description: | + A list of UUIDs identifying the users + that should be authorized to access this device (typically + via /root/.ssh/authorized_keys). These keys will also + appear in the device metadata. + + The users must be members of the project or organization. + + If no SSH keys are specified (`user_ssh_keys`, `project_ssh_keys`, and `ssh_keys` are all empty lists or omitted), + all parent project keys, parent project members keys and organization members keys will be included. This behaviour can + be changed with 'no_ssh_keys' option to omit any SSH key being added. + items: + format: uuid + type: string + type: array + userdata: + description: |- + The userdata presented in the metadata service for this device. Userdata is fetched and interpreted by the operating system installed on the device. Acceptable formats are determined by the operating system, with the exception of a special iPXE enabling syntax which is handled before the operating system starts. + + See [Server User Data](https://metal.equinix.com/developers/docs/servers/user-data/) and [Provisioning with Custom iPXE](https://metal.equinix.com/developers/docs/operating-systems/custom-ipxe/#provisioning-with-custom-ipxe) for more details. + type: string + externalDocs: + url: https://metal.equinix.com/developers/docs/servers/user-data/ +required: +- plan +- operating_system diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceHealthRollup.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceHealthRollup.yaml new file mode 100644 index 00000000..7396b72d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceHealthRollup.yaml @@ -0,0 +1,16 @@ +properties: + health_rollup: + readOnly: true + type: string + description: Health Status + enum: + - ok + - warning + - critical + updated_at: + readOnly: true + type: string + format: date-time + description: Last update of health status. +type: object +description: Represents a Device Health Status diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceList.yaml new file mode 100644 index 00000000..ca171496 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceList.yaml @@ -0,0 +1,8 @@ +properties: + devices: + items: + $ref: './Device.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUpdateInput.yaml new file mode 100644 index 00000000..933136da --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUpdateInput.yaml @@ -0,0 +1,36 @@ +properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + default: {} + type: object + additionalProperties: true + description: + type: string + hostname: + type: string + firmware_set_id: + type: string + ipxe_script_url: + type: string + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + network_frozen: + description: If true, this instance can not be converted to a different network + type. + type: boolean + spot_instance: + type: boolean + description: Can be set to false to convert a spot-market instance to on-demand. + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/spot-market/#converting-a-spot-market-server-to-on-demand + tags: + items: + type: string + type: array + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsage.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsage.yaml new file mode 100644 index 00000000..6968295c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsage.yaml @@ -0,0 +1,8 @@ +properties: + quantity: + type: string + total: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsageList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsageList.yaml new file mode 100644 index 00000000..d266838b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/DeviceUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './DeviceUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Disk.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Disk.yaml new file mode 100644 index 00000000..3a8b9237 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Disk.yaml @@ -0,0 +1,10 @@ +properties: + device: + type: string + wipeTable: + type: boolean + partitions: + items: + $ref: './Partition.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Email.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Email.yaml new file mode 100644 index 00000000..9b420b33 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Email.yaml @@ -0,0 +1,13 @@ +properties: + address: + type: string + default: + type: boolean + href: + type: string + id: + format: uuid + type: string + verified: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/EmailInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/EmailInput.yaml new file mode 100644 index 00000000..7563066d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/EmailInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + default: + type: boolean +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Entitlement.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Entitlement.yaml new file mode 100644 index 00000000..c8bde23b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Entitlement.yaml @@ -0,0 +1,32 @@ +properties: + description: + type: string + feature_access: + type: object + href: + type: string + id: + format: uuid + type: string + instance_quota: + type: object + ip_quota: + type: object + name: + type: string + project_quota: + default: 0 + type: integer + slug: + type: string + volume_limits: + type: object + volume_quota: + type: object + weight: + type: integer +required: +- id +- slug +- weight +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Error.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Error.yaml new file mode 100644 index 00000000..f940b13d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Error.yaml @@ -0,0 +1,13 @@ +description: Error responses are included with 4xx and 5xx HTTP responses from the + API service. Either "error" or "errors" will be set. +properties: + error: + description: A description of the error that caused the request to fail. + type: string + errors: + description: A list of errors that contributed to the request failing. + items: + description: An error message that contributed to the request failing. + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Event.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Event.yaml new file mode 100644 index 00000000..9f4effd2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Event.yaml @@ -0,0 +1,26 @@ +properties: + body: + type: string + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + interpolated: + type: string + relationships: + items: + $ref: './Href.yaml' + type: array + state: + type: string + type: + type: string + modified_by: + type: object + ip: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/EventList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/EventList.yaml new file mode 100644 index 00000000..75b2d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/EventList.yaml @@ -0,0 +1,8 @@ +properties: + events: + items: + $ref: './Event.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FabricServiceToken.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FabricServiceToken.yaml new file mode 100644 index 00000000..e1559ea3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FabricServiceToken.yaml @@ -0,0 +1,48 @@ +properties: + expires_at: + description: The expiration date and time of the Fabric service token. Once a + service token is expired, it is no longer redeemable. + format: date-time + type: string + id: + description: |- + The UUID that can be used on the Fabric Portal to redeem either an A-Side or Z-Side Service Token. + For Fabric VCs (Metal Billed), this UUID will represent an A-Side Service Token, which will allow interconnections + to be made from Equinix Metal to other Service Providers on Fabric. For Fabric VCs (Fabric Billed), this UUID will + represent a Z-Side Service Token, which will allow interconnections to be made to connect an owned Fabric Port or + Virtual Device to Equinix Metal. + format: uuid + type: string + max_allowed_speed: + description: |- + The maximum speed that can be selected on the Fabric Portal when configuring a interconnection with either + an A-Side or Z-Side Service Token. For Fabric VCs (Metal Billed), this is what the billing is based off of, and can be one + of the following options, '50mbps', '200mbps', '500mbps', '1gbps', '2gbps', '5gbps' or '10gbps'. For Fabric VCs + (Fabric Billed), this will default to 10Gbps. + type: integer + example: 10000000000 + role: + description: Either primary or secondary, depending on which interconnection the service token is associated to. + enum: + - primary + - secondary + type: string + service_token_type: + description: Either 'a_side' or 'z_side', depending on which type of Fabric VC was requested. + enum: + - a_side + - z_side + type: string + state: + description: |- + The state of the service token that corresponds with the service + token state on Fabric. An 'inactive' state refers to a token that has not been + redeemed yet on the Fabric side, an 'active' state refers to a token that has + already been redeemed, and an 'expired' state refers to a token that has reached + its expiry time. + enum: + - inactive + - active + - expired + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Facility.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Facility.yaml new file mode 100644 index 00000000..dd0203c4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Facility.yaml @@ -0,0 +1,37 @@ +properties: + address: + $ref: './Address.yaml' + code: + type: string + features: + example: + - baremetal + - backend_transfer + - global_ipv4 + items: + enum: + - baremetal + - backend_transfer + - layer_2 + - global_ipv4 + - ibx + type: string + type: array + id: + format: uuid + type: string + ip_ranges: + description: IP ranges registered in facility. Can be used for GeoIP location + example: + - 2604:1380::/36 + - 147.75.192.0/21 + items: + type: string + type: array + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the facility is in + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml new file mode 100644 index 00000000..11e24222 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml @@ -0,0 +1,17 @@ +required: + - facility +properties: + facility: + deprecated: true + description: |- + The datacenter where the device should be created. + + Either metro or facility must be provided. + + The API will accept either a single facility `{ "facility": "f1" }`, or it can be instructed to create the device in the best available datacenter `{ "facility": "any" }`. + + Additionally it is possible to set a prioritized location selection. For example `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. + type: array + items: + type: string + example: ["sv15"] diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FacilityList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FacilityList.yaml new file mode 100644 index 00000000..f7a4af1a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FacilityList.yaml @@ -0,0 +1,6 @@ +properties: + facilities: + items: + $ref: './Facility.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Filesystem.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Filesystem.yaml new file mode 100644 index 00000000..d309cba1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Filesystem.yaml @@ -0,0 +1,4 @@ +properties: + mount: + $ref: './Mount.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSet.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSet.yaml new file mode 100644 index 00000000..2d8bf7cb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSet.yaml @@ -0,0 +1,36 @@ +properties: + uuid: + readOnly: true + type: string + description: Firmware Set UUID + format: uuid + example: "0516463a-47ee-4809-9a66-ece8c740eed9" + name: + readOnly: true + type: string + description: Firmware Set Name + created_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was created. + updated_at: + readOnly: true + type: string + format: date-time + description: Datetime when the block was updated. + attributes: + type: array + description: Represents a list of attributes + items: + $ref: "./Attribute.yaml" + component_firmware: + type: array + description: List of components versions + items: + $ref: "./Component.yaml" +required: + - uuid + - name +type: object +description: Represents a Firmware Set diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetList.yaml new file mode 100644 index 00000000..7e9fe5ee --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetList.yaml @@ -0,0 +1,4 @@ +type: array +description: Represents a list of FirmwareSets +items: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetListResponse.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetListResponse.yaml new file mode 100644 index 00000000..47d81795 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetListResponse.yaml @@ -0,0 +1,20 @@ +type: object +description: Represents collection of Firmware Sets +properties: + page_size: + description: Max number of items returned in a page + type: integer + page: + description: Page returned + type: integer + page_count: + description: Items returned in current page + type: integer + total_pages: + description: Total count of pages + type: integer + total_record_count: + description: Total count of items + type: integer + records: + $ref: "./FirmwareSetList.yaml" diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetResponse.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetResponse.yaml new file mode 100644 index 00000000..adb43e43 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/FirmwareSetResponse.yaml @@ -0,0 +1,5 @@ +type: object +description: Represents single Firmware set response +properties: + record: + $ref: "./FirmwareSet.yaml" diff --git a/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRange.yaml b/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRange.yaml new file mode 100644 index 00000000..ac2eaa3b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRange.yaml @@ -0,0 +1,13 @@ +properties: + address_family: + type: integer + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + range: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRangeList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRangeList.yaml new file mode 100644 index 00000000..a0bd661e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/GlobalBgpRangeList.yaml @@ -0,0 +1,6 @@ +properties: + global_bgp_ranges: + items: + $ref: './GlobalBgpRange.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservation.yaml b/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservation.yaml new file mode 100644 index 00000000..59aa31ff --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservation.yaml @@ -0,0 +1,46 @@ +properties: + created_at: + format: date-time + type: string + custom_rate: + description: Amount that will be charged for every billing_cycle. + example: 1050.5 + format: float + type: number + device: + $ref: './Device.yaml' + facility: + $ref: './Facility.yaml' + href: + type: string + id: + format: uuid + type: string + need_of_service: + description: Whether this Device requires assistance from Equinix Metal. + type: boolean + plan: + $ref: './Plan.yaml' + project: + $ref: './Project.yaml' + provisionable: + description: Whether the reserved server is provisionable or not. Spare devices + can't be provisioned unless they are activated first. + type: boolean + short_id: + description: Short version of the ID. + format: string + type: string + spare: + description: Whether the Hardware Reservation is a spare. Spare Hardware Reservations + are used when a Hardware Reservations requires service from Equinix Metal + type: boolean + switch_uuid: + description: Switch short id. This can be used to determine if two devices are + connected to the same switch, for example. + type: string + termination_time: + description: Expiration date for the reservation. + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservationList.yaml new file mode 100644 index 00000000..1ffd5b75 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/HardwareReservationList.yaml @@ -0,0 +1,8 @@ +properties: + hardware_reservations: + items: + $ref: './HardwareReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Href.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Href.yaml new file mode 100644 index 00000000..bbe7e220 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Href.yaml @@ -0,0 +1,6 @@ +properties: + href: + type: string +required: +- href +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAddress.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAddress.yaml new file mode 100644 index 00000000..90e98687 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAddress.yaml @@ -0,0 +1,27 @@ +properties: + address_family: + description: Address Family for IP Address + enum: + - 4 + - 6 + example: 4 + format: int32 + type: integer + cidr: + description: Cidr Size for the IP Block created. Valid values depends on + the operating system being provisioned. (28..32 for IPv4 addresses, 124..127 + for IPv6 addresses) + example: 28 + format: int32 + type: integer + ip_reservations: + description: UUIDs of any IP reservations to use when assigning IPs + items: + type: string + type: array + public: + default: true + description: Address Type for IP Address + example: false + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml new file mode 100644 index 00000000..46f9abc3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml @@ -0,0 +1,61 @@ +properties: + address: + type: string + address_family: + type: integer + assigned_to: + $ref: './Href.yaml' + cidr: + type: integer + created_at: + format: date-time + type: string + enabled: + type: boolean + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP address is in + netmask: + type: string + network: + type: string + parent_block: + $ref: './ParentBlock.yaml' + public: + type: boolean + state: + type: string + enum: + - pending + - active + - deleting + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + Describes the current configuration state of this IP on the network. + next_hop: + type: string + format: ipv4 + description: | + Only set when this is a Metal Gateway Elastic IP Assignment. + + The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. + type: + type: string + enum: + - IPAssignment +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentInput.yaml new file mode 100644 index 00000000..90efc5ee --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentInput.yaml @@ -0,0 +1,8 @@ +properties: + address: + type: string + customdata: + type: object +required: +- address +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentList.yaml new file mode 100644 index 00000000..94f11aeb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './IPAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentUpdateInput.yaml new file mode 100644 index 00000000..47556d84 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignmentUpdateInput.yaml @@ -0,0 +1,10 @@ +properties: + details: + type: string + customdata: + type: object + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAvailabilitiesList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAvailabilitiesList.yaml new file mode 100644 index 00000000..1bb6642f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAvailabilitiesList.yaml @@ -0,0 +1,6 @@ +properties: + available: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPReservation.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPReservation.yaml new file mode 100644 index 00000000..848adb57 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPReservation.yaml @@ -0,0 +1,83 @@ +properties: + addon: + type: boolean + address: + type: string + address_family: + type: integer + assignments: + items: + $ref: './IPAssignment.yaml' + type: array + available: + type: string + bill: + type: boolean + cidr: + type: integer + created_at: + format: date-time + type: string + customdata: + type: object + enabled: + type: boolean + details: + type: string + facility: + allOf: + - $ref: './Facility.yaml' + - description: The facility the IP reservation is in. If the facility the IP reservation + was requested in is in a metro, a metro value will also be set, and the subsequent + IP reservation can be used on a metro level. Can be null if requesting an + IP reservation in a metro. + gateway: + type: string + global_ip: + type: boolean + href: + type: string + id: + format: uuid + type: string + manageable: + type: boolean + management: + type: boolean + metal_gateway: + $ref: './MetalGatewayLite.yaml' + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the IP reservation is in. As long as the IP reservation + has a metro, it can be used on a metro level. Can be null if requesting an + IP reservation in a facility that is not in a metro. + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + project_lite: + $ref: './Href.yaml' + requested_by: + $ref: './Href.yaml' + public: + type: boolean + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - global_ipv4 + - public_ipv4 + - private_ipv4 + - public_ipv6 +type: object +additionalProperties: false +required: + - type diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPReservationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPReservationList.yaml new file mode 100644 index 00000000..56393f25 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPReservationList.yaml @@ -0,0 +1,10 @@ +properties: + ip_addresses: + items: + anyOf: + - $ref: './IPReservation.yaml' + - $ref: './VrfIpReservation.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPReservationRequestInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPReservationRequestInput.yaml new file mode 100644 index 00000000..d76c68fe --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/IPReservationRequestInput.yaml @@ -0,0 +1,27 @@ +properties: + comments: + type: string + customdata: + type: object + details: + type: string + facility: + type: string + fail_on_approval_required: + type: boolean + metro: + description: The code of the metro you are requesting the IP reservation in. + example: SV + type: string + quantity: + type: integer + tags: + items: + type: string + type: array + type: + type: string +required: +- type +- quantity +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InstancesBatchCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InstancesBatchCreateInput.yaml new file mode 100644 index 00000000..97c166be --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InstancesBatchCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + batches: + items: + allOf: + - properties: + hostnames: + items: + type: string + type: array + quantity: + type: integer + description: The number of devices to create in this batch. The hostname may contain an `{{index}}` placeholder, which will be replaced with the index of the device in the batch. For example, if the hostname is `device-{{index}}`, the first device in the batch will have the hostname `device-01`, the second device will have the hostname `device-02`, and so on. + - oneOf: + - $ref: 'DeviceCreateInMetroInput.yaml' + - $ref: 'DeviceCreateInFacilityInput.yaml' + type: array +type: object + diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Interconnection.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Interconnection.yaml new file mode 100644 index 00000000..191a4414 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Interconnection.yaml @@ -0,0 +1,78 @@ +properties: + contact_email: + type: string + description: + type: string + facility: + $ref: './Href.yaml' + id: + format: uuid + type: string + metro: + allOf: + - $ref: './Metro.yaml' + description: |- + The location of where the shared or Dedicated Port is located. For interconnections with Dedicated Ports, + this will be the location of the Dedicated Ports. For Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports + as the origin of the interconnection using A-Side service tokens. We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), + this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), so the origin of the interconnection can be a different metro set here. + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + organization: + $ref: './Href.yaml' + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array + description: For Fabric VCs, these represent Virtual Port(s) created for the interconnection. For dedicated interconnections, these represent the Dedicated Port(s). + redundancy: + type: string + enum: + - primary + - redundant + description: Either 'primary', meaning a single interconnection, or 'redundant', meaning a redundant interconnection. + service_tokens: + items: + $ref: './FabricServiceToken.yaml' + type: array + description: For Fabric VCs (Metal Billed), this will show details of the A-Side service tokens issued for the interconnection. For Fabric VCs (Fabric Billed), this will show the details of the Z-Side service tokens issued for the interconnection. Dedicated interconnections will not have any service tokens issued. + There will be one per interconnection, so for redundant interconnections, there should be two service tokens issued. + speed: + description: For interconnections on Dedicated Ports and shared connections, this represents the interconnection's speed in bps. For Fabric VCs, this field refers to the maximum speed of the interconnection in bps. This value will default to 10Gbps for Fabric VCs (Fabric Billed). + type: integer + example: 10000000000 + status: + type: string + tags: + items: + type: string + type: array + token: + format: uuid + type: string + description: This token is used for shared interconnections to be used as the Fabric Token. This field is entirely deprecated. + type: + type: string + enum: + - shared + - dedicated + description: The 'shared' type of interconnection refers to shared connections, or later also known as Fabric Virtual Connections (or Fabric VCs). The 'dedicated' type of interconnection refers to interconnections created with Dedicated Ports. + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + requested_by: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionList.yaml new file mode 100644 index 00000000..5683309b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionList.yaml @@ -0,0 +1,8 @@ +properties: + interconnections: + items: + $ref: './Interconnection.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPort.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPort.yaml new file mode 100644 index 00000000..be1d7f52 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPort.yaml @@ -0,0 +1,39 @@ +properties: + id: + format: uuid + type: string + organization: + $ref: './Href.yaml' + role: + description: Either 'primary' or 'secondary'. + type: string + enum: + - primary + - secondary + status: + type: string + description: For both Fabric VCs and Dedicated Ports, this will be 'requested' on creation and 'deleting' on deletion. Once the Fabric VC has found its corresponding Fabric connection, + this will turn to 'active'. For Dedicated Ports, once the dedicated port is associated, this will also turn to 'active'. For Fabric VCs, this can turn into an 'expired' state if the + service token associated is expired. + enum: + - requested + - active + - deleting + - expired + - delete_failed + switch_id: + description: A switch 'short ID' + type: string + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array + name: + type: string + speed: + type: integer + link_status: + type: string + href: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPortList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPortList.yaml new file mode 100644 index 00000000..6c86e0c1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionPortList.yaml @@ -0,0 +1,6 @@ +properties: + ports: + items: + $ref: './InterconnectionPort.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionUpdateInput.yaml new file mode 100644 index 00000000..75a29f7d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InterconnectionUpdateInput.yaml @@ -0,0 +1,26 @@ +properties: + contact_email: + type: string + description: + type: string + mode: + description: |- + The mode of the interconnection (only relevant to Dedicated Ports). Shared connections won't have this field. Can be either 'standard' or 'tunnel'. + The default mode of an interconnection on a Dedicated Port is 'standard'. The mode can only be changed when there are no associated virtual circuits on the interconnection. + In tunnel mode, an 802.1q tunnel is added to a port to send/receive double tagged packets from server instances. + enum: + - standard + - tunnel + example: standard + type: string + name: + type: string + redundancy: + description: Updating from 'redundant' to 'primary' will remove a secondary port, + while updating from 'primary' to 'redundant' will add one. + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Invitation.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Invitation.yaml new file mode 100644 index 00000000..fb587f0f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Invitation.yaml @@ -0,0 +1,37 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + invitation: + $ref: './Href.yaml' + invited_by: + $ref: './Href.yaml' + invitee: + type: string + format: email + nonce: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InvitationInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InvitationInput.yaml new file mode 100644 index 00000000..3461ddcb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InvitationInput.yaml @@ -0,0 +1,26 @@ +properties: + invitee: + type: string + format: email + message: + type: string + organization_id: + type: string + format: uuid + projects_ids: + items: + type: string + format: uuid + type: array + roles: + items: + type: string + enum: + - admin + - billing + - collaborator + - limited_collaborator + type: array +required: +- invitee +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InvitationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InvitationList.yaml new file mode 100644 index 00000000..5077f623 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InvitationList.yaml @@ -0,0 +1,6 @@ +properties: + invitations: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Invoice.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Invoice.yaml new file mode 100644 index 00000000..ec764a0e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Invoice.yaml @@ -0,0 +1,41 @@ +properties: + amount: + format: float + type: number + balance: + format: float + type: number + created_on: + format: date + type: string + credit_amount: + format: float + type: number + credits_applied: + format: float + type: number + currency: + example: USD + type: string + due_on: + format: date + type: string + id: + format: uuid + type: string + items: + items: + $ref: './LineItem.yaml' + type: array + number: + type: string + project: + $ref: './ProjectIdName.yaml' + reference_number: + type: string + status: + type: string + target_date: + format: date + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/InvoiceList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/InvoiceList.yaml new file mode 100644 index 00000000..16410460 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/InvoiceList.yaml @@ -0,0 +1,6 @@ +properties: + invoices: + items: + $ref: './Invoice.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/License.yaml b/spec/services/metalv1/oas3.patched/components/schemas/License.yaml new file mode 100644 index 00000000..d16812b6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/License.yaml @@ -0,0 +1,15 @@ +properties: + description: + type: string + id: + format: uuid + type: string + license_key: + type: string + licensee_product: + $ref: './Href.yaml' + project: + $ref: './Href.yaml' + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/LicenseCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/LicenseCreateInput.yaml new file mode 100644 index 00000000..f1bec3dd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/LicenseCreateInput.yaml @@ -0,0 +1,8 @@ +properties: + description: + type: string + licensee_product_id: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/LicenseList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/LicenseList.yaml new file mode 100644 index 00000000..a74cf2f0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/LicenseList.yaml @@ -0,0 +1,6 @@ +properties: + licenses: + items: + $ref: './License.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/LicenseUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/LicenseUpdateInput.yaml new file mode 100644 index 00000000..11c51efa --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/LicenseUpdateInput.yaml @@ -0,0 +1,6 @@ +properties: + description: + type: string + size: + type: number +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/LineItem.yaml b/spec/services/metalv1/oas3.patched/components/schemas/LineItem.yaml new file mode 100644 index 00000000..82ae67ad --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/LineItem.yaml @@ -0,0 +1,18 @@ +properties: + amount: + format: float + type: number + currency: + type: string + description: + type: string + details: + type: string + plan: + $ref: './Plan.yaml' + unit: + type: string + unit_price: + format: float + type: number +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Membership.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Membership.yaml new file mode 100644 index 00000000..9adde1ac --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Membership.yaml @@ -0,0 +1,21 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + roles: + items: + type: string + type: array + updated_at: + format: date-time + type: string + user: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MembershipInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MembershipInput.yaml new file mode 100644 index 00000000..6054927a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MembershipInput.yaml @@ -0,0 +1,6 @@ +properties: + role: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MembershipList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MembershipList.yaml new file mode 100644 index 00000000..81d7735b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MembershipList.yaml @@ -0,0 +1,6 @@ +properties: + memberships: + items: + $ref: './Membership.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Meta.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Meta.yaml new file mode 100644 index 00000000..88a52dc1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Meta.yaml @@ -0,0 +1,18 @@ +properties: + first: + $ref: './Href.yaml' + last: + $ref: './Href.yaml' + next: + $ref: './Href.yaml' + previous: + $ref: './Href.yaml' + self: + $ref: './Href.yaml' + total: + type: integer + current_page: + type: integer + last_page: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Metadata.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Metadata.yaml new file mode 100644 index 00000000..4c2d5e62 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Metadata.yaml @@ -0,0 +1,99 @@ +properties: + class: + type: string + customdata: + default: {} + type: object + additionalProperties: true + facility: + description: The facility code of the instance + type: string + hostname: + type: string + id: + format: uuid + type: string + iqn: + type: string + metro: + description: The metro code of the instance + type: string + network: + properties: + addresses: + items: + type: string + type: array + interfaces: + items: + type: object + type: array + network: + properties: + bonding: + properties: + link_aggregation: + type: string + mac: + type: string + mode: + type: integer + type: object + type: object + type: object + operating_system: + type: object + plan: + description: The plan slug of the instance + type: string + private_subnets: + description: An array of the private subnets + items: + type: string + type: array + reserved: + type: boolean + specs: + description: The specs of the plan version of the instance + type: object + ssh_keys: + items: + type: string + type: array + switch_short_id: + type: string + state: + type: string + enum: + - queued + - provisioning + - deprovisioning + - reinstalling + - active + - inactive + - failed + - powering_on + - powering_off + - deleted + description: |- + The current state the instance is in. + + * When an instance is initially created it will be in the `queued` state until it is picked up by the provisioner. + * Once provisioning has begun on the instance it's state will move to `provisioning`. + * When an instance is deleted, it will move to `deprovisioning` state until the deprovision is completed and the instance state moves to `deleted`. + * If an instance fails to provision or deprovision it will move to `failed` state. + * Once an instance has completed provisioning it will move to `active` state. + * If an instance is currently powering off or powering on it will move to `powering_off` or `powering_on` states respectively. + * When the instance is powered off completely it will move to the `inactive` state. + * When an instance is powered on completely it will move to the `active` state. + * Using the reinstall action to install a new OS on the instance will cause the instance state to change to `reinstalling`. + * When the reinstall action is complete the instance will move to `active` state. + tags: + items: + type: string + type: array + volumes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetalGateway.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetalGateway.yaml new file mode 100644 index 00000000..ed0eb307 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetalGateway.yaml @@ -0,0 +1,32 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './IPReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayCreateInput.yaml new file mode 100644 index 00000000..e4be2e54 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayCreateInput.yaml @@ -0,0 +1,20 @@ +properties: + ip_reservation_id: + description: The UUID of an IP reservation that belongs to the same project as + where the metal gateway will be created in. This field is required unless the + private IPv4 subnet size is specified. + format: uuid + type: string + private_ipv4_subnet_size: + description: |- + The subnet size (8, 16, 32, 64, or 128) of the private IPv4 reservation that will be created for the metal gateway. This field is required unless a project IP reservation was specified. + Please keep in mind that the number of private metal gateway ranges are limited per project. If you would like to increase the limit per project, please contact support for assistance. + type: integer + virtual_network_id: + description: The UUID of a metro virtual network that belongs to the same project + as where the metal gateway will be created in. + format: uuid + type: string +required: +- virtual_network_id +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayElasticIpCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayElasticIpCreateInput.yaml new file mode 100644 index 00000000..dea3a00c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayElasticIpCreateInput.yaml @@ -0,0 +1,24 @@ +properties: + address: + type: string + description: An IP address (or IP Address range) contained within one of the project's IP Reservations + example: "147.75.234.8/31" + next_hop: + type: string + format: ipv4 + description: An IP address contained within the Metal Gateways' IP Reservation range. + example: "192.168.12.13" + customdata: + type: object + additionalProperties: true + description: Optional User-defined JSON object value. + tags: + items: + type: string + type: array + description: Optional list of User-defined tags. Can be used by users to provide additional details or context regarding the purpose or usage of this resource. + example: [NY,prod,public] +required: +- address +- next_hop +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayList.yaml new file mode 100644 index 00000000..3b66ccdc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayList.yaml @@ -0,0 +1,10 @@ +properties: + metal_gateways: + items: + anyOf: + - $ref: './MetalGateway.yaml' + - $ref: './VrfMetalGateway.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayLite.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayLite.yaml new file mode 100644 index 00000000..ce42cc15 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetalGatewayLite.yaml @@ -0,0 +1,35 @@ +properties: + created_at: + format: date-time + type: string + gateway_address: + description: The gateway address with subnet CIDR value for this Metal Gateway. + For example, a Metal Gateway using an IP reservation with block 10.1.2.0/27 + would have a gateway address of 10.1.2.1/27. + type: string + example: 10.1.2.1/27 + href: + type: string + id: + format: uuid + type: string + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + vlan: + description: 'The VLAN id of the Virtual Network record associated to this Metal + Gateway.' + type: integer + example: 1001 +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Metro.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Metro.yaml new file mode 100644 index 00000000..c98a13f8 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Metro.yaml @@ -0,0 +1,11 @@ +properties: + code: + type: string + country: + type: string + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetroInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetroInput.yaml new file mode 100644 index 00000000..0c6ebac5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetroInput.yaml @@ -0,0 +1,9 @@ +required: + - metro +properties: + metro: + description: |- + Metro code or ID of where the instance should be provisioned in. + Either metro or facility must be provided. + type: string + example: sv \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/components/schemas/MetroList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/MetroList.yaml new file mode 100644 index 00000000..e3863ad4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/MetroList.yaml @@ -0,0 +1,6 @@ +properties: + metros: + items: + $ref: './Metro.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Mount.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Mount.yaml new file mode 100644 index 00000000..916e3161 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Mount.yaml @@ -0,0 +1,12 @@ +properties: + device: + type: string + format: + type: string + point: + type: string + options: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/NewPassword.yaml b/spec/services/metalv1/oas3.patched/components/schemas/NewPassword.yaml new file mode 100644 index 00000000..2be80d13 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/NewPassword.yaml @@ -0,0 +1,4 @@ +properties: + new_password: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystem.yaml b/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystem.yaml new file mode 100644 index 00000000..eb027d83 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystem.yaml @@ -0,0 +1,35 @@ +properties: + distro: + type: string + distro_label: + type: string + id: + format: uuid + type: string + licensed: + description: Licenced OS is priced according to pricing property + type: boolean + name: + type: string + preinstallable: + description: Servers can be already preinstalled with OS in order to shorten provision + time. + type: boolean + pricing: + description: This object contains price per time unit and optional multiplier + value if licence price depends on hardware plan or components (e.g. number of + cores) + type: object + provisionable_on: + items: + type: string + type: array + slug: + type: string + version: + type: string + default_operating_system: + description: Default operating system for the distro. + readOnly: true + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystemList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystemList.yaml new file mode 100644 index 00000000..01793610 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/OperatingSystemList.yaml @@ -0,0 +1,6 @@ +properties: + operating_systems: + items: + $ref: './OperatingSystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Organization.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Organization.yaml new file mode 100644 index 00000000..534c0b51 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Organization.yaml @@ -0,0 +1,49 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + created_at: + format: date-time + type: string + credit_amount: + format: float + type: number + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + id: + format: uuid + type: string + logo: + type: string + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + projects: + items: + $ref: './Href.yaml' + type: array + terms: + type: integer + twitter: + type: string + updated_at: + format: date-time + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/OrganizationInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/OrganizationInput.yaml new file mode 100644 index 00000000..3f46526c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/OrganizationInput.yaml @@ -0,0 +1,25 @@ +properties: + address: + $ref: './Address.yaml' + billing_address: + $ref: './Address.yaml' + customdata: + type: object + description: + type: string + enforce_2fa_at: + description: Force to all members to have enabled the two factor authentication + after that date, unless the value is null + format: date-time + type: string + logo: + description: The logo for the organization; must be base64-encoded image data + format: byte + type: string + name: + type: string + twitter: + type: string + website: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/OrganizationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/OrganizationList.yaml new file mode 100644 index 00000000..43d0c9ec --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/OrganizationList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + organizations: + items: + $ref: './Organization.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ParentBlock.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ParentBlock.yaml new file mode 100644 index 00000000..0eeeed3e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ParentBlock.yaml @@ -0,0 +1,10 @@ +properties: + cidr: + type: integer + href: + type: string + netmask: + type: string + network: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Partition.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Partition.yaml new file mode 100644 index 00000000..f0190354 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Partition.yaml @@ -0,0 +1,9 @@ +properties: + label: + type: string + number: + type: integer + format: int32 + size: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethod.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethod.yaml new file mode 100644 index 00000000..1ead6a67 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethod.yaml @@ -0,0 +1,37 @@ +properties: + billing_address: + $ref: './PaymentMethodBillingAddress.yaml' + card_type: + type: string + cardholder_name: + type: string + created_at: + format: date-time + type: string + created_by_user: + $ref: './Href.yaml' + default: + type: boolean + email: + type: string + expiration_month: + type: string + expiration_year: + type: string + id: + format: uuid + type: string + name: + type: string + organization: + $ref: './Href.yaml' + projects: + items: + $ref: './Href.yaml' + type: array + type: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodBillingAddress.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodBillingAddress.yaml new file mode 100644 index 00000000..e9a84861 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodBillingAddress.yaml @@ -0,0 +1,8 @@ +properties: + country_code_alpha2: + type: string + postal_code: + type: string + street_address: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodCreateInput.yaml new file mode 100644 index 00000000..662f1eb7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodCreateInput.yaml @@ -0,0 +1,11 @@ +properties: + default: + type: boolean + name: + type: string + nonce: + type: string +required: +- name +- nonce +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodList.yaml new file mode 100644 index 00000000..f6318e40 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodList.yaml @@ -0,0 +1,6 @@ +properties: + payment_methods: + items: + $ref: './PaymentMethod.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodUpdateInput.yaml new file mode 100644 index 00000000..01092b0e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PaymentMethodUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + billing_address: + type: object + cardholder_name: + type: string + default: + type: boolean + expiration_month: + type: string + expiration_year: + type: integer + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml new file mode 100644 index 00000000..c9602d00 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml @@ -0,0 +1,132 @@ +properties: + available_in: + description: Shows which facilities the plan is available in, and the facility-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Facility + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + available_in_metros: + description: Shows which metros the plan is available in, and the metro-based + price if it is different from the default price. + items: + type: object + properties: + href: + description: href to the Metro + type: string + price: + type: object + properties: + hour: + type: number + format: double + example: 1.23 + type: array + categories: + description: Categories of the plan, like compute or storage. A Plan can belong to multiple categories. + items: + type: string + type: array + class: + type: string + example: m3.large.x86 + description: + type: string + deployment_types: + items: + type: string + enum: + - on_demand + - spot_market + type: array + minItems: 0 + uniqueItems: true + id: + format: uuid + type: string + legacy: + description: Deprecated. Always return false + type: boolean + x-deprecated: true + line: + type: string + name: + type: string + pricing: + type: object + slug: + type: string + example: m3.large.x86 + specs: + type: object + properties: + cpus: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + memory: + type: object + properties: + total: + type: string + drives: + type: array + items: + type: object + properties: + count: + type: integer + type: + type: string + size: + type: string + example: 3.84TB + category: + type: string + enum: + - boot + - cache + - storage + nics: + type: array + items: + type: object + properties: + count: + type: integer + example: 2 + type: + type: string + features: + type: object + properties: + raid: + type: boolean + txt: + type: boolean + uefi: + type: boolean + type: + description: The plan type + type: string + enum: + - standard + - workload_optimized + - custom +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PlanList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PlanList.yaml new file mode 100644 index 00000000..a22e4dec --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PlanList.yaml @@ -0,0 +1,6 @@ +properties: + plans: + items: + $ref: './Plan.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Port.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Port.yaml new file mode 100644 index 00000000..bceaf31b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Port.yaml @@ -0,0 +1,40 @@ +description: Port is a hardware port associated with a reserved or instantiated hardware device. +properties: + bond: + $ref: './BondPortData.yaml' + data: + $ref: './PortData.yaml' + disbond_operation_supported: + description: Indicates whether or not the bond can be broken on the port (when + applicable). + type: boolean + href: + type: string + id: + format: uuid + type: string + name: + type: string + example: bond0 + type: + description: Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports + type: string + enum: + - NetworkPort + - NetworkBondPort + network_type: + description: Composite network type of the bond + type: string + enum: + - 'layer2-bonded' + - 'layer2-individual' + - 'layer3' + - 'hybrid' + - 'hybrid-bonded' + native_virtual_network: + $ref: './VirtualNetwork.yaml' + virtual_networks: + items: + $ref: './Href.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortAssignInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortAssignInput.yaml new file mode 100644 index 00000000..2e08fd80 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortAssignInput.yaml @@ -0,0 +1,8 @@ +properties: + vnid: + description: > + Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself. + type: string + example: "1001" +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortConvertLayer3Input.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortConvertLayer3Input.yaml new file mode 100644 index 00000000..175e77c7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortConvertLayer3Input.yaml @@ -0,0 +1,11 @@ +properties: + request_ips: + items: + properties: + address_family: + type: integer + public: + type: boolean + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortData.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortData.yaml new file mode 100644 index 00000000..adf41a01 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortData.yaml @@ -0,0 +1,8 @@ +properties: + mac: + description: MAC address is set for NetworkPort ports + type: string + bonded: + description: Bonded is true for NetworkPort ports in a bond and NetworkBondPort ports that are active + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignment.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignment.yaml new file mode 100644 index 00000000..889b3486 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignment.yaml @@ -0,0 +1,24 @@ +properties: + created_at: + format: date-time + type: string + id: + format: uuid + type: string + native: + type: boolean + port: + $ref: './Href.yaml' + state: + enum: + - assigned + - unassigning + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './Href.yaml' + vlan: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatch.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatch.yaml new file mode 100644 index 00000000..0d5e8a2b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatch.yaml @@ -0,0 +1,45 @@ +properties: + created_at: + format: date-time + type: string + error_messages: + items: + type: string + type: array + id: + format: uuid + type: string + port: + $ref: './Port.yaml' + quantity: + type: integer + state: + enum: + - queued + - in_progress + - completed + - failed + type: string + updated_at: + format: date-time + type: string + vlan_assignments: + items: + properties: + id: + format: uuid + type: string + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: integer + type: object + type: array + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml new file mode 100644 index 00000000..a6bc0925 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + vlan_assignments: + items: + properties: + native: + type: boolean + state: + enum: + - assigned + - unassigned + type: string + vlan: + type: string + type: object + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchList.yaml new file mode 100644 index 00000000..af95e08f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentBatchList.yaml @@ -0,0 +1,6 @@ +properties: + batches: + items: + $ref: './PortVlanAssignmentBatch.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentList.yaml new file mode 100644 index 00000000..d058582e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/PortVlanAssignmentList.yaml @@ -0,0 +1,6 @@ +properties: + vlan_assignments: + items: + $ref: './PortVlanAssignment.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml new file mode 100644 index 00000000..de5da431 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml @@ -0,0 +1,64 @@ +properties: + bgp_config: + $ref: './Href.yaml' + created_at: + format: date-time + type: string + customdata: + type: object + devices: + items: + $ref: './Href.yaml' + type: array + href: + type: string + id: + format: uuid + type: string + invitations: + items: + $ref: './Href.yaml' + type: array + max_devices: + type: object + members: + items: + $ref: './Href.yaml' + type: array + memberships: + items: + $ref: './Href.yaml' + type: array + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + network_status: + type: object + organization: + $ref: './Organization.yaml' + payment_method: + $ref: './Href.yaml' + ssh_keys: + items: + $ref: './Href.yaml' + type: array + updated_at: + format: date-time + type: string + volumes: + items: + $ref: './Href.yaml' + type: array + type: + type: string + description: The type of the project. Projects of type `vmce` are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateFromRootInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateFromRootInput.yaml new file mode 100644 index 00000000..e138c704 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateFromRootInput.yaml @@ -0,0 +1,28 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + organization_id: + format: uuid + type: string + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateInput.yaml new file mode 100644 index 00000000..5dd2966b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectCreateInput.yaml @@ -0,0 +1,25 @@ +properties: + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + type: + type: string + description: The type of the project. If no type is specified the project type will automatically be `default` + Projects of type 'vmce' are part of an in development feature and not available to all customers. + enum: + - default + - vmce + tags: + items: + type: string + type: array +required: +- name +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectIdName.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectIdName.yaml new file mode 100644 index 00000000..3a06d9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectIdName.yaml @@ -0,0 +1,7 @@ +properties: + id: + format: uuid + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectList.yaml new file mode 100644 index 00000000..a4c8a58c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + projects: + items: + $ref: './Project.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUpdateInput.yaml new file mode 100644 index 00000000..7acaad09 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUpdateInput.yaml @@ -0,0 +1,18 @@ +properties: + backend_transfer_enabled: + type: boolean + customdata: + type: object + name: + type: string + minLength: 1 + maxLength: 80 + description: The name of the project. Cannot contain characters encoded in greater than 3 bytes such as emojis. + payment_method_id: + format: uuid + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsage.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsage.yaml new file mode 100644 index 00000000..cec80ec2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsage.yaml @@ -0,0 +1,20 @@ +properties: + facility: + type: string + name: + type: string + plan: + type: string + plan_version: + type: string + price: + type: string + quantity: + type: string + total: + type: string + type: + type: string + unit: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsageList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsageList.yaml new file mode 100644 index 00000000..827d8ad2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ProjectUsageList.yaml @@ -0,0 +1,6 @@ +properties: + usages: + items: + $ref: './ProjectUsage.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Raid.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Raid.yaml new file mode 100644 index 00000000..c2a892f6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Raid.yaml @@ -0,0 +1,10 @@ +properties: + devices: + items: + type: string + type: array + level: + type: string + name: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/RecoveryCodeList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/RecoveryCodeList.yaml new file mode 100644 index 00000000..40928232 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/RecoveryCodeList.yaml @@ -0,0 +1,6 @@ +properties: + recovery_codes: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SSHKey.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SSHKey.yaml new file mode 100644 index 00000000..135e59d0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SSHKey.yaml @@ -0,0 +1,25 @@ +properties: + created_at: + format: date-time + type: string + entity: + $ref: './Href.yaml' + fingerprint: + type: string + href: + type: string + id: + format: uuid + type: string + key: + type: string + label: + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyCreateInput.yaml new file mode 100644 index 00000000..2aab7ffa --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyCreateInput.yaml @@ -0,0 +1,18 @@ +properties: + instances_ids: + description: |- + List of instance UUIDs to associate SSH key with, when empty array is sent all instances belonging + to entity will be included + items: + format: uuid + type: string + type: array + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyInput.yaml new file mode 100644 index 00000000..fb5db698 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyInput.yaml @@ -0,0 +1,10 @@ +properties: + key: + type: string + label: + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyList.yaml new file mode 100644 index 00000000..8a99546c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SSHKeyList.yaml @@ -0,0 +1,6 @@ +properties: + ssh_keys: + items: + $ref: './SSHKey.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemRequest.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemRequest.yaml new file mode 100644 index 00000000..12e996eb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemRequest.yaml @@ -0,0 +1,15 @@ +properties: + amount: + format: float + type: number + metro_id: + format: uuid + type: string + plan_id: + format: uuid + type: string + quantity: + type: integer + term: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemResponse.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemResponse.yaml new file mode 100644 index 00000000..06b2f9eb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationItemResponse.yaml @@ -0,0 +1,29 @@ +properties: + amount: + format: float + type: number + id: + type: string + metro_code: + type: string + metro_id: + format: uuid + type: string + metro_name: + type: string + plan_id: + format: uuid + type: string + plan_name: + type: string + plan_slug: + type: string + plan_categories: + type: array + items: + type: string + quantity: + type: integer + term: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationList.yaml new file mode 100644 index 00000000..c0960915 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationList.yaml @@ -0,0 +1,6 @@ +properties: + reservations: + items: + $ref: './SelfServiceReservationResponse.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationResponse.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationResponse.yaml new file mode 100644 index 00000000..60cbfb0b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SelfServiceReservationResponse.yaml @@ -0,0 +1,40 @@ +properties: + created_at: + format: date-time + type: string + item: + items: + $ref: './SelfServiceReservationItemResponse.yaml' + type: array + notes: + type: string + organization: + type: string + organization_id: + format: uuid + type: string + period: + properties: + count: + enum: + - 12 + - 36 + type: integer + unit: + enum: + - monthly + type: string + type: object + project: + type: string + project_id: + format: uuid + type: string + start_date: + format: date-time + type: string + status: + type: string + total_cost: + type: integer +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/ServerInfo.yaml b/spec/services/metalv1/oas3.patched/components/schemas/ServerInfo.yaml new file mode 100644 index 00000000..83566aa5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/ServerInfo.yaml @@ -0,0 +1,14 @@ +properties: + facility: + deprecated: true + type: string + metro: + description: The metro ID or code to check the capacity in. + type: string + plan: + description: The plan ID or slug to check the capacity of. + type: string + quantity: + description: The number of servers to check the capacity of. + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesList.yaml new file mode 100644 index 00000000..1164d10c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotPricesReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroList.yaml new file mode 100644 index 00000000..e0a9b36b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroList.yaml @@ -0,0 +1,4 @@ +properties: + spot_market_prices: + $ref: './SpotMarketPricesPerMetroReport.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroReport.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroReport.yaml new file mode 100644 index 00000000..3dae22bc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketPricesPerMetroReport.yaml @@ -0,0 +1,16 @@ +properties: + am: + $ref: './SpotPricesPerFacility.yaml' + ch: + $ref: './SpotPricesPerFacility.yaml' + da: + $ref: './SpotPricesPerFacility.yaml' + la: + $ref: './SpotPricesPerFacility.yaml' + ny: + $ref: './SpotPricesPerFacility.yaml' + sg: + $ref: './SpotPricesPerFacility.yaml' + sv: + $ref: './SpotPricesPerFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequest.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequest.yaml new file mode 100644 index 00000000..bea87517 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequest.yaml @@ -0,0 +1,30 @@ +properties: + created_at: + format: date-time + type: string + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + instances: + $ref: './Href.yaml' + max_bid_price: + format: float + type: number + metro: + allOf: + - $ref: './Metro.yaml' + - description: The metro the spot market request was created in + project: + $ref: './Href.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestCreateInput.yaml new file mode 100644 index 00000000..085397cb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestCreateInput.yaml @@ -0,0 +1,76 @@ +properties: + devices_max: + type: integer + devices_min: + type: integer + end_at: + format: date-time + type: string + facilities: + deprecated: true + items: + format: uuid + type: string + type: array + instance_parameters: + properties: + always_pxe: + type: boolean + billing_cycle: + type: string + customdata: + type: object + description: + type: string + features: + items: + type: string + type: array + hostname: + type: string + hostnames: + items: + type: string + type: array + locked: + type: boolean + description: Whether the device should be locked, preventing accidental deletion. + no_ssh_keys: + type: boolean + operating_system: + type: string + plan: + type: string + private_ipv4_subnet_size: + type: integer + project_ssh_keys: + items: + format: uuid + type: string + type: array + public_ipv4_subnet_size: + type: integer + tags: + items: + type: string + type: array + termination_time: + format: date-time + type: string + user_ssh_keys: + description: The UUIDs of users whose SSH keys should be included on the provisioned + device. + items: + format: uuid + type: string + type: array + userdata: + type: string + type: object + max_bid_price: + format: float + type: number + metro: + description: The metro ID or code the spot market request will be created in. + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestList.yaml new file mode 100644 index 00000000..3ed96cd0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotMarketRequestList.yaml @@ -0,0 +1,6 @@ +properties: + spot_market_requests: + items: + $ref: './SpotMarketRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapoints.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapoints.yaml new file mode 100644 index 00000000..27674b98 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapoints.yaml @@ -0,0 +1,6 @@ +properties: + datapoints: + items: + $ref: './SpotPricesDatapointsList.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapointsList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapointsList.yaml new file mode 100644 index 00000000..038972f5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesDatapointsList.yaml @@ -0,0 +1,3 @@ +items: + type: number +type: array diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesHistoryReport.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesHistoryReport.yaml new file mode 100644 index 00000000..3a3c8522 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesHistoryReport.yaml @@ -0,0 +1,4 @@ +properties: + prices_history: + $ref: './SpotPricesDatapoints.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerBaremetal.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerBaremetal.yaml new file mode 100644 index 00000000..6c9b0b0a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerBaremetal.yaml @@ -0,0 +1,5 @@ +properties: + price: + format: float + type: number +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerFacility.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerFacility.yaml new file mode 100644 index 00000000..a0ba3def --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerFacility.yaml @@ -0,0 +1,20 @@ +properties: + baremetal_0: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_1: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_2a2: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_3: + $ref: './SpotPricesPerBaremetal.yaml' + baremetal_s: + $ref: './SpotPricesPerBaremetal.yaml' + c2.medium.x86: + $ref: './SpotPricesPerBaremetal.yaml' + m2.xlarge.x86: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerNewFacility.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerNewFacility.yaml new file mode 100644 index 00000000..e72795c2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesPerNewFacility.yaml @@ -0,0 +1,4 @@ +properties: + baremetal_1e: + $ref: './SpotPricesPerBaremetal.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesReport.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesReport.yaml new file mode 100644 index 00000000..15b59111 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SpotPricesReport.yaml @@ -0,0 +1,30 @@ +properties: + ams1: + $ref: './SpotPricesPerFacility.yaml' + atl1: + $ref: './SpotPricesPerNewFacility.yaml' + dfw1: + $ref: './SpotPricesPerNewFacility.yaml' + ewr1: + $ref: './SpotPricesPerFacility.yaml' + fra1: + $ref: './SpotPricesPerNewFacility.yaml' + iad1: + $ref: './SpotPricesPerNewFacility.yaml' + lax1: + $ref: './SpotPricesPerNewFacility.yaml' + nrt1: + $ref: './SpotPricesPerFacility.yaml' + ord1: + $ref: './SpotPricesPerNewFacility.yaml' + sea1: + $ref: './SpotPricesPerNewFacility.yaml' + sin1: + $ref: './SpotPricesPerNewFacility.yaml' + sjc1: + $ref: './SpotPricesPerFacility.yaml' + syd1: + $ref: './SpotPricesPerNewFacility.yaml' + yyz1: + $ref: './SpotPricesPerNewFacility.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Storage.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Storage.yaml new file mode 100644 index 00000000..a800531d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Storage.yaml @@ -0,0 +1,14 @@ +properties: + disks: + items: + $ref: './Disk.yaml' + type: array + raid: + items: + $ref: './Raid.yaml' + type: array + filesystems: + items: + $ref: './Filesystem.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/SupportRequestInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/SupportRequestInput.yaml new file mode 100644 index 00000000..27a7a640 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/SupportRequestInput.yaml @@ -0,0 +1,20 @@ +properties: + device_id: + type: string + message: + type: string + priority: + enum: + - urgent + - high + - medium + - low + type: string + project_id: + type: string + subject: + type: string +required: +- subject +- message +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/TransferRequest.yaml b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequest.yaml new file mode 100644 index 00000000..86f4eb42 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequest.yaml @@ -0,0 +1,17 @@ +properties: + created_at: + format: date-time + type: string + href: + type: string + id: + format: uuid + type: string + project: + $ref: './Href.yaml' + target_organization: + $ref: './Href.yaml' + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestInput.yaml new file mode 100644 index 00000000..21584bd9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestInput.yaml @@ -0,0 +1,5 @@ +properties: + target_organization_id: + format: uuid + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestList.yaml new file mode 100644 index 00000000..2e22bdbb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/TransferRequestList.yaml @@ -0,0 +1,6 @@ +properties: + transfers: + items: + $ref: './TransferRequest.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UpdateEmailInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UpdateEmailInput.yaml new file mode 100644 index 00000000..01eec3c4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UpdateEmailInput.yaml @@ -0,0 +1,4 @@ +properties: + default: + type: boolean +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/User.yaml b/spec/services/metalv1/oas3.patched/components/schemas/User.yaml new file mode 100644 index 00000000..b81db710 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/User.yaml @@ -0,0 +1,54 @@ +properties: + avatar_thumb_url: + type: string + avatar_url: + type: string + created_at: + format: date-time + type: string + customdata: + type: object + default_organization_id: + type: string + format: uuid + default_project_id: + type: string + format: uuid + email: + type: string + emails: + items: + $ref: './Href.yaml' + type: array + first_name: + type: string + fraud_score: + type: string + full_name: + type: string + href: + type: string + id: + format: uuid + type: string + last_login_at: + format: date-time + type: string + last_name: + type: string + max_organizations: + type: integer + max_projects: + type: integer + phone_number: + type: string + short_id: + type: string + timezone: + type: string + two_factor_auth: + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UserCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UserCreateInput.yaml new file mode 100644 index 00000000..b7d08229 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UserCreateInput.yaml @@ -0,0 +1,45 @@ +properties: + avatar: + format: binary + type: string + company_name: + type: string + company_url: + type: string + customdata: + type: object + emails: + items: + $ref: './EmailInput.yaml' + type: array + first_name: + type: string + last_name: + type: string + level: + type: string + password: + type: string + phone_number: + type: string + social_accounts: + type: object + timezone: + type: string + title: + type: string + two_factor_auth: + type: string + verified_at: + format: date-time + type: string + invitation_id: + type: string + format: uuid + nonce: + type: string +required: +- first_name +- last_name +- emails +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UserLimited.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UserLimited.yaml new file mode 100644 index 00000000..3e909c3c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UserLimited.yaml @@ -0,0 +1,21 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + avatar_url: + description: Avatar URL of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string +required: + - id + - short_id +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UserList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UserList.yaml new file mode 100644 index 00000000..5ed5b73e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UserList.yaml @@ -0,0 +1,8 @@ +properties: + meta: + $ref: './Meta.yaml' + users: + items: + $ref: './User.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UserLite.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UserLite.yaml new file mode 100644 index 00000000..333edef4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UserLite.yaml @@ -0,0 +1,38 @@ +properties: + avatar_thumb_url: + description: Avatar thumbnail URL of the User + type: string + created_at: + description: When the user was created + format: date-time + type: string + email: + description: Primary email address of the User + type: string + first_name: + description: First name of the User + type: string + full_name: + description: Full name of the User + type: string + href: + description: API URL uniquely representing the User + type: string + id: + description: ID of the User + format: uuid + type: string + last_name: + description: Last name of the User + type: string + short_id: + description: Short ID of the User + type: string + updated_at: + description: When the user details were last updated + format: date-time + type: string +required: +- id +- short_id +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/UserUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/UserUpdateInput.yaml new file mode 100644 index 00000000..6ba885f6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/UserUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + customdata: + type: object + first_name: + type: string + last_name: + type: string + password: + type: string + phone_number: + type: string + timezone: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Userdata.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Userdata.yaml new file mode 100644 index 00000000..8acfc608 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Userdata.yaml @@ -0,0 +1,4 @@ +properties: + userdata: + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VerifyEmail.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VerifyEmail.yaml new file mode 100644 index 00000000..d32c848c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VerifyEmail.yaml @@ -0,0 +1,7 @@ +properties: + user_token: + description: User verification token + type: string + writeOnly: true +required: + - user_token diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuit.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuit.yaml new file mode 100644 index 00000000..2c12357e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuit.yaml @@ -0,0 +1,3 @@ +oneOf: +- $ref: './VlanVirtualCircuit.yaml' +- $ref: './VrfVirtualCircuit.yaml' diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..d4b72f38 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitCreateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitCreateInput.yaml' + - $ref: 'VrfVirtualCircuitCreateInput.yaml' diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitList.yaml new file mode 100644 index 00000000..03ecf33e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_circuits: + items: + $ref: './VirtualCircuit.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..5205301a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualCircuitUpdateInput.yaml @@ -0,0 +1,3 @@ +oneOf: + - $ref: 'VlanVirtualCircuitUpdateInput.yaml' + - $ref: 'VrfVirtualCircuitUpdateInput.yaml' diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml new file mode 100644 index 00000000..bae14ae8 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml @@ -0,0 +1,42 @@ +properties: + assigned_to: + $ref: './Href.yaml' + assigned_to_virtual_circuit: + description: True if the virtual network is attached to a virtual circuit. False + if not. + type: boolean + description: + type: string + facility: + $ref: './Href.yaml' + href: + type: string + created_at: + format: date-time + type: string + id: + format: uuid + type: string + instances: + description: A list of instances with ports currently associated to this Virtual + Network. + items: + $ref: './Href.yaml' + type: array + metal_gateways: + description: A list of metal gateways currently associated to this Virtual Network. + items: + $ref: './MetalGatewayLite.yaml' + type: array + metro: + $ref: './Href.yaml' + metro_code: + description: The Metro code of the metro in which this Virtual Network is defined. + type: string + vxlan: + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkCreateInput.yaml new file mode 100644 index 00000000..1a74eca6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkCreateInput.yaml @@ -0,0 +1,23 @@ +properties: + description: + type: string + facility: + deprecated: true + description: The UUID (or facility code) for the Facility in which to create this + Virtual network. + type: string + metro: + description: The UUID (or metro code) for the Metro in which to create this Virtual + Network. + type: string + vxlan: + description: VLAN ID between 2-3999. Must be unique for the project within the + Metro in which this Virtual Network is being created. If no value is specified, + the next-available VLAN ID in the range 1000-1999 will be automatically selected. + example: 1099 + type: integer + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkList.yaml new file mode 100644 index 00000000..8d3fd950 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetworkList.yaml @@ -0,0 +1,6 @@ +properties: + virtual_networks: + items: + $ref: './VirtualNetwork.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VlanFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VlanFabricVcCreateInput.yaml new file mode 100644 index 00000000..a68635e0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VlanFabricVcCreateInput.yaml @@ -0,0 +1,61 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. + We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), + so the origin of the interconnection can be a different metro set here. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vlans: + description: A list of one or two metro-based VLANs that will be set on the virtual circuits of primary + and/or secondary (if redundant) interconnections respectively when creating Fabric VCs. + VLANs can also be set after the interconnection is created, but are required to fully activate the virtual circuits. + example: + - 1000 + - 1001 + items: + type: integer + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuit.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuit.yaml new file mode 100644 index 00000000..55324321 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuit.yaml @@ -0,0 +1,65 @@ +properties: + bill: + type: boolean + default: false + description: True if the Virtual Circuit is being billed. Currently, only Virtual Circuits of Fabric VCs (Metal Billed) will be billed. Usage will start the first time the Virtual Circuit becomes active, and will not stop until it is deleted from Metal. + description: + type: string + id: + format: uuid + type: string + name: + type: string + nni_vlan: + type: integer + port: + $ref: './Href.yaml' + project: + $ref: './Href.yaml' + speed: + description: For Virtual Circuits on shared and dedicated connections, this speed should match the one set on their Interconnection Ports. For Virtual Circuits on + Fabric VCs (both Metal and Fabric Billed) that have found their corresponding Fabric connection, this is the actual speed of the interconnection that was configured when setting up the interconnection on the Fabric Portal. + Details on Fabric VCs are included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + type: integer + status: + type: string + description: The status of a Virtual Circuit is always 'pending' on creation. The status can turn to 'Waiting on Customer VLAN' if a Metro VLAN was not set yet on the Virtual Circuit and is the last step needed for full activation. For Dedicated interconnections, as long as the Dedicated Port has been associated + to the Virtual Circuit and a NNI VNID has been set, it will turn to 'waiting_on_customer_vlan'. + For Fabric VCs, it will only change to 'waiting_on_customer_vlan' once the corresponding Fabric connection has been found on the Fabric side. If the Fabric service token associated with the Virtual Circuit hasn't been redeemed on Fabric within the expiry time, it will change to an `expired` status. + Once a Metro VLAN is set on the Virtual Circuit (which for Fabric VCs, can be set on creation of a Fabric VC) and the necessary set up is done, it will turn into 'Activating' status as it tries to activate the Virtual Circuit. Once the Virtual Circuit fully activates and is configured on the switch, + it will turn to staus 'active'. For Fabric VCs (Metal Billed), we will start billing the moment the status of the Virtual Circuit turns to 'active'. If there are any changes to the VLAN after the Virtual Circuit is in an 'active' status, the status will show 'changing_vlan' if a new VLAN has been provided, + or 'deactivating' if we are removing the VLAN. When a deletion request is issued for the Virtual Circuit, it will move to a 'deleting' status, and we will immediately unconfigure the switch for the Virtual Circuit and issue a deletion on any associated Fabric connections. Any associated Metro VLANs on the + virtual circuit will also be unassociated after the switch has been successfully unconfigured. If there are any associated Fabric connections, we will only fully delete the Virtual Circuit once we have checked that the Fabric connection was fully deprovisioned on Fabric. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_customer_vlan + - activating + - changing_vlan + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_vlan_failed + - deactivation_failed + - delete_failed + tags: + items: + type: string + type: array + type: + type: string + enum: + - vlan + virtual_network: + $ref: './Href.yaml' + vnid: + type: integer + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..d5f9c473 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitCreateInput.yaml @@ -0,0 +1,28 @@ +properties: + description: + type: string + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: integer + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project (sent as integer). + format: uuid + type: string +type: object +required: + - project_id diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..1d88bf77 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VlanVirtualCircuitUpdateInput.yaml @@ -0,0 +1,17 @@ +properties: + description: + type: string + name: + type: string + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + tags: + items: + type: string + type: array + vnid: + description: A Virtual Network record UUID or the VNID of a Metro Virtual Network in + your project. + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Vrf.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Vrf.yaml new file mode 100644 index 00000000..85f576ea --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/Vrf.yaml @@ -0,0 +1,52 @@ +properties: + id: + format: uuid + type: string + name: + type: string + description: + description: Optional field that can be set to describe the VRF + type: string + bill: + type: boolean + default: false + description: True if the VRF is being billed. Usage will start when the first VRF Virtual Circuit is active, and will only stop when the VRF has been deleted. + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + local_asn: + description: A 4-byte ASN associated with the VRF. + type: integer + format: int32 + virtual_circuits: + description: Virtual circuits that are in the VRF + type: array + items: + $ref: './VrfVirtualCircuit.yaml' + ip_ranges: + $ref: './VrfIpRangeList.yaml' + project: + $ref: './Project.yaml' + metro: + $ref: './Metro.yaml' + created_by: + $ref: './User.yaml' + href: + type: string + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfCreateInput.yaml new file mode 100644 index 00000000..081a63b6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfCreateInput.yaml @@ -0,0 +1,29 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeCreateInput.yaml' + local_asn: + type: integer + format: int32 + metro: + description: The UUID (or metro code) for the Metro in which to create this VRF. + type: string + name: + type: string + tags: + items: + type: string + type: array +required: +- metro +- name diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfFabricVcCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfFabricVcCreateInput.yaml new file mode 100644 index 00000000..cd026b18 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfFabricVcCreateInput.yaml @@ -0,0 +1,61 @@ +properties: + contact_email: + description: The preferred email used for communication and notifications about the Equinix Fabric interconnection. Required when using a Project API key. Optional and defaults to the primary user email address when using a User API key. + type: string + format: email + description: + type: string + metro: + description: A Metro ID or code. When creating Fabric VCs (Metal Billed), this is where interconnection will be originating from, as we pre-authorize the use of one of our shared ports as the origin of the interconnection using A-Side service tokens. + We only allow local connections for Fabric VCs (Metal Billed), so the destination location must be the same as the origin. For Fabric VCs (Fabric Billed), or shared connections, this will be the destination of the interconnection. We allow remote connections for Fabric VCs (Fabric Billed), + so the origin of the interconnection can be a different metro set here. + type: string + name: + type: string + project: + type: string + redundancy: + description: Either 'primary' or 'redundant'. + type: string + service_token_type: + description: Either 'a_side' or 'z_side'. Setting this field to 'a_side' will create an interconnection with Fabric VCs (Metal Billed). Setting this field + to 'z_side' will create an interconnection with Fabric VCs (Fabric Billed). This is required when the 'type' is 'shared', but this is not applicable when the 'type' is 'dedicated'. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + enum: + - a_side + - z_side + example: a_side + type: string + speed: + description: |- + A interconnection speed, in bps, mbps, or gbps. For Fabric VCs, this represents the maximum speed of the interconnection. For Fabric VCs (Metal Billed), this can only be one of the following: + ''50mbps'', ''200mbps'', ''500mbps'', ''1gbps'', ''2gbps'', ''5gbps'' or ''10gbps'', and is required for creation. For Fabric VCs (Fabric Billed), this field will always default to ''10gbps'' even if it is not provided. + For example, ''500000000'', ''50m'', or' ''500mbps'' will all work as valid inputs. + type: integer + example: 10000000000 + tags: + items: + type: string + type: array + type: + description: When requesting for a Fabric VC, the value of this field should be 'shared'. + type: string + enum: + - shared + vrfs: + description: This field holds a list of VRF UUIDs that will be set automatically on the virtual circuits of Fabric VCs on + creation, and can hold up to two UUIDs. Two UUIDs are required when requesting redundant Fabric VCs. The first UUID will be set on the primary virtual circuit, + while the second UUID will be set on the secondary. The two UUIDs can be the same if both the primary and secondary virtual circuits will be in the same VRF. + This parameter is included in the specification as a developer preview and is generally unavailable. Please contact our Support team for more details. + items: + format: uuid + type: string + type: array +required: +- name +- metro +- type +- redundancy +- service_token_type +- vrfs +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeCreateInput.yaml new file mode 100644 index 00000000..6f69292b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeCreateInput.yaml @@ -0,0 +1,6 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeList.yaml new file mode 100644 index 00000000..db7e7211 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeList.yaml @@ -0,0 +1,4 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeUpdateInput.yaml new file mode 100644 index 00000000..352c55bd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpRangeUpdateInput.yaml @@ -0,0 +1,10 @@ +type: array +items: + type: string +description: A list of CIDR network addresses. Like ["10.0.0.0/16", "2001:d78::/56"]. + IPv4 blocks must be between /8 and /29 in size. IPv6 blocks must be between /56 and /64. + A VRF\'s IP ranges must be defined in order to create VRF IP Reservations, which can then be used for Metal Gateways or Virtual Circuits. + Adding a new CIDR address to the list will result in the creation of a new IP Range for this VRF. + Removal of an existing CIDR address from the list will result in the deletion of an existing IP Range for this VRF. Deleting an IP Range will result in the deletion of any VRF IP Reservations contained within the IP Range, as well as the VRF IP Reservation\'s associated Metal Gateways or Virtual Circuits. + If you do not wish to add or remove IP Ranges, either include the full existing list of IP Ranges in the update request, or do not specify the `ip_ranges` field in the update request. + Specifying a value of `[]` will remove all existing IP Ranges from the VRF. diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservation.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservation.yaml new file mode 100644 index 00000000..f17bd109 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservation.yaml @@ -0,0 +1,59 @@ +properties: + address_family: + type: integer + cidr: + type: integer + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + details: + type: string + href: + type: string + id: + format: uuid + type: string + metal_gateway: + $ref: './MetalGatewayLite.yaml' + netmask: + type: string + network: + type: string + project: + $ref: './Project.yaml' + state: + type: string + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + public: + type: boolean + management: + type: boolean + manageable: + type: boolean + customdata: + type: object + bill: + type: boolean + project_lite: + $ref: './Project.yaml' + address: + type: string + gateway: + type: string + metro: + $ref: './Metro.yaml' +required: + - vrf + - type +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationCreateInput.yaml new file mode 100644 index 00000000..c96ccc19 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationCreateInput.yaml @@ -0,0 +1,30 @@ +properties: + cidr: + type: integer + example: 16 + description: The size of the VRF IP Reservation's subnet + customdata: + type: object + details: + type: string + network: + type: string + example: "10.1.2.0" + description: "The starting address for this VRF IP Reservation's subnet" + tags: + items: + type: string + type: array + type: + type: string + example: vrf + description: "Must be set to 'vrf'" + vrf_id: + type: string + format: uuid + description: The ID of the VRF in which this VRF IP Reservation is created. The VRF must have an existing IP Range that contains the requested subnet. This field may be aliased as just 'vrf'. +required: + - cidr + - network + - type + - vrf_id diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationList.yaml new file mode 100644 index 00000000..bd84ddc8 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfIpReservationList.yaml @@ -0,0 +1,6 @@ +properties: + ip_addresses: + items: + $ref: './VrfIpReservation.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfList.yaml new file mode 100644 index 00000000..148036ed --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfList.yaml @@ -0,0 +1,6 @@ +properties: + vrfs: + items: + $ref: './Vrf.yaml' + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGateway.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGateway.yaml new file mode 100644 index 00000000..5864d01e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGateway.yaml @@ -0,0 +1,34 @@ +properties: + created_at: + format: date-time + type: string + created_by: + $ref: './Href.yaml' + href: + type: string + id: + format: uuid + type: string + ip_reservation: + $ref: './VrfIpReservation.yaml' + project: + $ref: './Project.yaml' + state: + description: The current state of the Metal Gateway. 'Ready' indicates the gateway + record has been configured, but is currently not active on the network. 'Active' + indicates the gateway has been configured on the network. 'Deleting' is a temporary + state used to indicate that the gateway is in the process of being un-configured + from the network, after which the gateway record will be deleted. + enum: + - ready + - active + - deleting + type: string + updated_at: + format: date-time + type: string + virtual_network: + $ref: './VirtualNetwork.yaml' + vrf: + $ref: './Vrf.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGatewayCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGatewayCreateInput.yaml new file mode 100644 index 00000000..9e205084 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfMetalGatewayCreateInput.yaml @@ -0,0 +1,16 @@ +properties: + ip_reservation_id: + description: The UUID an a VRF IP Reservation that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the VRF IP Reservation + and the Virtual Network must reside in the same Metro. + format: uuid + type: string + virtual_network_id: + description: THe UUID of a Metro Virtual Network that belongs to the same project as + the one in which the Metal Gateway is to be created. Additionally, the Virtual Network + and the VRF IP Reservation must reside in the same metro. + format: uuid + type: string +required: + - ip_reservation_id + - virtual_network_id diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfRoute.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfRoute.yaml new file mode 100644 index 00000000..88bdf509 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfRoute.yaml @@ -0,0 +1,61 @@ +properties: + id: + description: The unique identifier for the newly-created resource + format: uuid + type: string + readOnly: true + example: e1ff9c2b-051a-4688-965f-153e274f77e0 + status: + description: The status of the route. Potential values are "pending", "active", "deleting", and "error", representing various lifecycle states of the route and whether or not it has been successfully configured on the network + type: string + readOnly: true + example: active + enum: + - pending + - active + - deleting + - error + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation + type: string + example: 0.0.0.0/0 + next_hop: + description: The next-hop IPv4 address for the route + type: string + format: ipv4 + example: 192.168.1.254 + type: + description: VRF route type, like 'bgp', 'connected', and 'static'. Currently, only static routes are supported + type: string + readOnly: true + example: static + enum: + - static + created_at: + format: date-time + type: string + readOnly: true + updated_at: + format: date-time + type: string + readOnly: true + metal_gateway: + description: A link to the Metal Gateway to which this VRF Route is associated + readOnly: true + $ref: './VrfMetalGateway.yaml' + virtual_network: + description: A link to the Virtual Network to which this VRF Route is associated, through the Metal Gateway + readOnly: true + $ref: './VirtualNetwork.yaml' + vrf: + description: A link to the VRF within which this route exists + readOnly: true + $ref: './Vrf.yaml' + href: + type: string + readOnly: true + example: /routes/e1ff9c2b-051a-4688-965f-153e274f77e0 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteCreateInput.yaml new file mode 100644 index 00000000..b9e672fb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteCreateInput.yaml @@ -0,0 +1,17 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array +required: +- prefix +- next_hop diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteList.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteList.yaml new file mode 100644 index 00000000..1c9f021e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteList.yaml @@ -0,0 +1,8 @@ +properties: + routes: + items: + $ref: './VrfRoute.yaml' + type: array + meta: + $ref: './Meta.yaml' +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteUpdateInput.yaml new file mode 100644 index 00000000..db195555 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfRouteUpdateInput.yaml @@ -0,0 +1,14 @@ +properties: + prefix: + description: The IPv4 prefix for the route, in CIDR-style notation. For a static default route, this will always be "0.0.0.0/0" + type: string + example: 0.0.0.0/0 + next_hop: + description: The IPv4 address within the VRF of the host that will handle this route + type: string + format: ipv4 + example: 192.168.1.254 + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfUpdateInput.yaml new file mode 100644 index 00000000..4dd5a4e3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfUpdateInput.yaml @@ -0,0 +1,24 @@ +properties: + bgp_dynamic_neighbors_enabled: + description: Toggle to enable the dynamic bgp neighbors feature on the VRF + type: boolean + bgp_dynamic_neighbors_export_route_map: + description: Toggle to export the VRF route-map to the dynamic bgp neighbors + type: boolean + bgp_dynamic_neighbors_bfd_enabled: + description: Toggle BFD on dynamic bgp neighbors sessions + type: boolean + description: + type: string + ip_ranges: + $ref: './VrfIpRangeUpdateInput.yaml' + local_asn: + type: integer + format: int32 + description: The new `local_asn` value for the VRF. This field cannot be updated when there are active Interconnection Virtual Circuits associated to the VRF, or if any of the VLANs of the VRF's metal gateway has been assigned on an instance. + name: + type: string + tags: + items: + type: string + type: array diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuit.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuit.yaml new file mode 100644 index 00000000..2bb47b5b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuit.yaml @@ -0,0 +1,90 @@ +required: +- vrf +properties: + customer_ip: + description: >- + An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + id: + format: uuid + type: string + md5: + description: >- + The MD5 password for the BGP peering in plaintext (not a checksum). + type: string + metal_ip: + description: >- + An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + port: + $ref: './Href.yaml' + nni_vlan: + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + project: + $ref: './Href.yaml' + speed: + description: integer representing bps speed + type: integer + status: + type: string + description: >- + The status changes of a VRF virtual circuit are generally the same as Virtual Circuits that aren't in a VRF. + However, for VRF Virtual Circuits on Fabric VCs, the status will change to 'waiting_on_peering_details' once + the Fabric service token associated with the virtual circuit has been redeemed on Fabric, and Metal has found + the associated Fabric connection. At this point, users can update the subnet, MD5 password, customer IP and/or + metal IP accordingly. For VRF Virtual Circuits on Dedicated Ports, we require all peering details to be set on + creation of a VRF Virtual Circuit. The status will change to `changing_peering_details` whenever an active VRF + Virtual Circuit has any of its peering details updated. + # NOTE: Any new additions to the enum will affect users using generated SDKs. + enum: + - pending + - waiting_on_peering_details + - activating + - changing_peering_details + - deactivating + - deleting + - active + - expired + - activation_failed + - changing_peering_details_failed + - deactivation_failed + - delete_failed + subnet: + description: >- + The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array + type: + type: string + enum: + - vrf + vrf: + $ref: './Vrf.yaml' + created_at: + format: date-time + type: string + updated_at: + format: date-time + type: string +type: object diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitCreateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitCreateInput.yaml new file mode 100644 index 00000000..19381664 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitCreateInput.yaml @@ -0,0 +1,65 @@ +properties: + customer_ip: + description: An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + nullable: true + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + nni_vlan: + maximum: 4094 + minimum: 2 + type: integer + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + project_id: + format: uuid + type: string + speed: + description: speed can be passed as integer number representing bps speed or string + (e.g. '52m' or '100g' or '4 gbps') + type: integer + subnet: + description: The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. The subnet specified must be contained within an already-defined + IP Range for the VRF. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array + vrf: + description: The UUID of the VRF that will be associated with the Virtual Circuit. + format: uuid + type: string +type: object +required: +- nni_vlan +- peer_asn +- project_id +- subnet +- vrf diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitUpdateInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitUpdateInput.yaml new file mode 100644 index 00000000..4058c7c0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/components/schemas/VrfVirtualCircuitUpdateInput.yaml @@ -0,0 +1,48 @@ +properties: + customer_ip: + description: >- + An IP address from the subnet that will be used on the Customer side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, + the last usable IP address in the subnet will be used. + type: string + example: "12.0.0.2" + description: + type: string + md5: + description: | + The plaintext BGP peering password shared by neighbors as an MD5 checksum: + * must be 10-20 characters long + * may not include punctuation + * must be a combination of numbers and letters + * must contain at least one lowercase, uppercase, and digit character + type: string + pattern: '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{10,20}$' + metal_ip: + description: >- + An IP address from the subnet that will be used on the Metal side. This parameter is optional, + but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, + the first usable IP address in the subnet will be used. + type: string + example: "12.0.0.1" + name: + type: string + peer_asn: + description: The peer ASN that will be used with the VRF on the Virtual Circuit. + type: integer + speed: + description: Speed can be changed only if it is an interconnection on a Dedicated Port + type: string + subnet: + description: >- + The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for + the Virtual Circuit. This subnet does not have to be an existing VRF IP reservation, as we + will create the VRF IP reservation on creation if it does not exist. The Metal IP and Customer + IP must be IPs from this subnet. For /30 subnets, the network and broadcast IPs cannot be used + as the Metal or Customer IP. + type: string + example: "12.0.0.0/30" + tags: + items: + type: string + type: array +type: object diff --git a/spec/services/metalv1/oas3.patched/openapi3.yaml b/spec/services/metalv1/oas3.patched/openapi3.yaml new file mode 100644 index 00000000..9822cd39 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/openapi3.yaml @@ -0,0 +1,1128 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Metal API + contact: + email: support@equinixmetal.com + name: Equinix Metal API Team + description: | + # Introduction + Equinix Metal provides a RESTful HTTP API which can be reached at . This document describes the API and how to use it. + + The API allows you to programmatically interact with all + of your Equinix Metal resources, including devices, networks, addresses, organizations, + projects, and your user account. Every feature of the Equinix Metal web interface is accessible through the API. + + The API docs are generated from the Equinix Metal OpenAPI specification and are officially hosted at . + + # Common Parameters + + The Equinix Metal API uses a few methods to minimize network traffic and improve throughput. These parameters are not used in all API calls, but are used often enough to warrant their own section. Look for these parameters in the documentation for the API calls that support them. + + ## Pagination + + Pagination is used to limit the number of results returned in a single request. The API will return a maximum of 100 results per page. To retrieve additional results, you can use the `page` and `per_page` query parameters. + + The `page` parameter is used to specify the page number. The first page is `1`. The `per_page` parameter is used to specify the number of results per page. The maximum number of results differs by resource type. + + ## Sorting + + Where offered, the API allows you to sort results by a specific field. To sort results use the `sort_by` query parameter with the root level field name as the value. The `sort_direction` parameter is used to specify the sort direction, either either `asc` (ascending) or `desc` (descending). + + ## Filtering + + Filtering is used to limit the results returned in a single request. The API supports filtering by certain fields in the response. To filter results, you can use the field as a query parameter. + + For example, to filter the IP list to only return public IPv4 addresses, you can filter by the `type` field, as in the following request: + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/projects/id/ips?type=public_ipv4 + ``` + + Only IP addresses with the `type` field set to `public_ipv4` will be returned. + + ## Searching + + Searching is used to find matching resources using multiple field comparissons. The API supports searching in resources that define this behavior. Currently the search parameter is only available on devices, ssh_keys, api_keys and memberships endpoints. + + To search resources you can use the `search` query parameter. + + ## Include and Exclude + + For resources that contain references to other resources, sucha as a Device that refers to the Project it resides in, the Equinix Metal API will returns `href` values (API links) to the associated resource. + + ```json + { + ... + "project": { + "href": "/metal/v1/projects/f3f131c8-f302-49ef-8c44-9405022dc6dd" + } + } + ``` + + If you're going need the project details, you can avoid a second API request. Specify the contained `href` resources and collections that you'd like to have included in the response using the `include` query parameter. + + For example: + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=projects + ``` + + The `include` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests where `href` resources are presented. + + To have multiple resources include, use a comma-separated list (e.g. `?include=emails,projects,memberships`). + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=emails,projects,memberships + ``` + + You may also include nested associations up to three levels deep using dot notation (`?include=memberships.projects`): + + ```sh + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user?include=memberships.projects + ``` + + To exclude resources, and optimize response delivery, use the `exclude` query parameter. The `exclude` parameter is generally accepted in `GET`, `POST`, `PUT`, and `PATCH` requests for fields with nested object responses. When excluded, these fields will be replaced with an object that contains only an `href` field. + license: + name: Equinix Metal + url: https://metal.equinix.com/legal/ + termsOfService: https://metal.equinix.com/legal/ +security: + - x_auth_token: [] +servers: + - url: https://api.equinix.com/metal/v1 +components: + parameters: + DeviceSearch: + $ref: './components/parameters/DeviceSearch.yaml' + ProjectName: + $ref: './components/parameters/ProjectName.yaml' + Page: + $ref: './components/parameters/Page.yaml' + PerPage: + $ref: './components/parameters/PerPage.yaml' + Include: + $ref: './components/parameters/Include.yaml' + Exclude: + $ref: './components/parameters/Exclude.yaml' + requestBodies: + InterconnectionCreateInput: + $ref: './components/requestBodies/InterconnectionCreateInput.yaml' + InvitationInput: + $ref: './components/requestBodies/InvitationInput.yaml' + PortAssignInput: + $ref: './components/requestBodies/PortAssignInput.yaml' + SSHKeyCreateInput: + $ref: './components/requestBodies/SSHKeyCreateInput.yaml' + schemas: + Address: + $ref: './components/schemas/Address.yaml' + Attribute: + $ref: './components/schemas/Attribute.yaml' + AttributeData: + $ref: './components/schemas/AttributeData.yaml' + AuthToken: + $ref: './components/schemas/AuthToken.yaml' + AuthTokenInput: + $ref: './components/schemas/AuthTokenInput.yaml' + AuthTokenList: + $ref: './components/schemas/AuthTokenList.yaml' + BGPSessionInput: + $ref: './components/schemas/BGPSessionInput.yaml' + Batch: + $ref: './components/schemas/Batch.yaml' + BatchesList: + $ref: './components/schemas/BatchesList.yaml' + BgpConfig: + $ref: './components/schemas/BgpConfig.yaml' + BgpConfigRequestInput: + $ref: './components/schemas/BgpConfigRequestInput.yaml' + BgpDynamicNeighbor: + $ref: './components/schemas/BgpDynamicNeighbor.yaml' + BgpDynamicNeighborCreateInput: + $ref: './components/schemas/BgpDynamicNeighborCreateInput.yaml' + BgpDynamicNeighborList: + $ref: './components/schemas/BgpDynamicNeighborList.yaml' + BgpNeighborData: + $ref: './components/schemas/BgpNeighborData.yaml' + BgpSession: + $ref: './components/schemas/BgpSession.yaml' + BgpSessionList: + $ref: './components/schemas/BgpSessionList.yaml' + BgpSessionNeighbors: + $ref: './components/schemas/BgpSessionNeighbors.yaml' + CapacityCheckPerFacilityInfo: + $ref: './components/schemas/CapacityCheckPerFacilityInfo.yaml' + CapacityCheckPerFacilityList: + $ref: './components/schemas/CapacityCheckPerFacilityList.yaml' + CapacityCheckPerMetroInfo: + $ref: './components/schemas/CapacityCheckPerMetroInfo.yaml' + CapacityCheckPerMetroList: + $ref: './components/schemas/CapacityCheckPerMetroList.yaml' + CapacityInput: + $ref: './components/schemas/CapacityInput.yaml' + CapacityLevelPerBaremetal: + $ref: './components/schemas/CapacityLevelPerBaremetal.yaml' + CapacityList: + $ref: './components/schemas/CapacityList.yaml' + CapacityReport: + $ref: './components/schemas/CapacityReport.yaml' + Component: + $ref: './components/schemas/Component.yaml' + Coordinates: + $ref: './components/schemas/Coordinates.yaml' + CreateEmailInput: + $ref: './components/schemas/CreateEmailInput.yaml' + CreateSelfServiceReservationRequest: + $ref: './components/schemas/CreateSelfServiceReservationRequest.yaml' + DedicatedPortCreateInput: + $ref: './components/schemas/DedicatedPortCreateInput.yaml' + Device: + $ref: './components/schemas/Device.yaml' + DeviceCreateInput: + $ref: './components/schemas/DeviceCreateInput.yaml' + DeviceHealthRollup: + $ref: './components/schemas/DeviceHealthRollup.yaml' + DeviceCreateInFacilityInput: + $ref: './components/schemas/DeviceCreateInFacilityInput.yaml' + DeviceCreateInMetroInput: + $ref: './components/schemas/DeviceCreateInMetroInput.yaml' + DeviceList: + $ref: './components/schemas/DeviceList.yaml' + DeviceUpdateInput: + $ref: './components/schemas/DeviceUpdateInput.yaml' + DeviceUsage: + $ref: './components/schemas/DeviceUsage.yaml' + DeviceUsageList: + $ref: './components/schemas/DeviceUsageList.yaml' + Email: + $ref: './components/schemas/Email.yaml' + EmailInput: + $ref: './components/schemas/EmailInput.yaml' + Entitlement: + $ref: './components/schemas/Entitlement.yaml' + Error: + $ref: './components/schemas/Error.yaml' + Event: + $ref: './components/schemas/Event.yaml' + EventList: + $ref: './components/schemas/EventList.yaml' + FabricServiceToken: + $ref: './components/schemas/FabricServiceToken.yaml' + Facility: + $ref: './components/schemas/Facility.yaml' + FacilityInput: + $ref: './components/schemas/FacilityInput.yaml' + FacilityList: + $ref: './components/schemas/FacilityList.yaml' + FirmwareSet: + $ref: './components/schemas/FirmwareSet.yaml' + FirmwareSetList: + $ref: './components/schemas/FirmwareSetList.yaml' + FirmwareSetListResponse: + $ref: './components/schemas/FirmwareSetListResponse.yaml' + FirmwareSetResponse: + $ref: './components/schemas/FirmwareSetResponse.yaml' + GlobalBgpRange: + $ref: './components/schemas/GlobalBgpRange.yaml' + GlobalBgpRangeList: + $ref: './components/schemas/GlobalBgpRangeList.yaml' + HardwareReservation: + $ref: './components/schemas/HardwareReservation.yaml' + HardwareReservationList: + $ref: './components/schemas/HardwareReservationList.yaml' + Href: + $ref: './components/schemas/Href.yaml' + IPAddress: + $ref: './components/schemas/IPAddress.yaml' + IPAssignment: + $ref: './components/schemas/IPAssignment.yaml' + IPAssignmentInput: + $ref: './components/schemas/IPAssignmentInput.yaml' + IPAssignmentList: + $ref: './components/schemas/IPAssignmentList.yaml' + IPAvailabilitiesList: + $ref: './components/schemas/IPAvailabilitiesList.yaml' + IPReservation: + $ref: './components/schemas/IPReservation.yaml' + IPReservationList: + $ref: './components/schemas/IPReservationList.yaml' + IPReservationRequestInput: + $ref: './components/schemas/IPReservationRequestInput.yaml' + InstancesBatchCreateInput: + $ref: './components/schemas/InstancesBatchCreateInput.yaml' + Interconnection: + $ref: './components/schemas/Interconnection.yaml' + InterconnectionList: + $ref: './components/schemas/InterconnectionList.yaml' + InterconnectionPort: + $ref: './components/schemas/InterconnectionPort.yaml' + InterconnectionPortList: + $ref: './components/schemas/InterconnectionPortList.yaml' + InterconnectionUpdateInput: + $ref: './components/schemas/InterconnectionUpdateInput.yaml' + Invitation: + $ref: './components/schemas/Invitation.yaml' + InvitationInput: + $ref: './components/schemas/InvitationInput.yaml' + InvitationList: + $ref: './components/schemas/InvitationList.yaml' + Invoice: + $ref: './components/schemas/Invoice.yaml' + InvoiceList: + $ref: './components/schemas/InvoiceList.yaml' + License: + $ref: './components/schemas/License.yaml' + LicenseCreateInput: + $ref: './components/schemas/LicenseCreateInput.yaml' + LicenseList: + $ref: './components/schemas/LicenseList.yaml' + LicenseUpdateInput: + $ref: './components/schemas/LicenseUpdateInput.yaml' + LineItem: + $ref: './components/schemas/LineItem.yaml' + Membership: + $ref: './components/schemas/Membership.yaml' + MembershipInput: + $ref: './components/schemas/MembershipInput.yaml' + MembershipList: + $ref: './components/schemas/MembershipList.yaml' + Meta: + $ref: './components/schemas/Meta.yaml' + Metadata: + $ref: './components/schemas/Metadata.yaml' + MetalGateway: + $ref: './components/schemas/MetalGateway.yaml' + MetalGatewayCreateInput: + $ref: './components/schemas/MetalGatewayCreateInput.yaml' + MetalGatewayElasticIpCreateInput: + $ref: './components/schemas/MetalGatewayElasticIpCreateInput.yaml' + MetalGatewayList: + $ref: './components/schemas/MetalGatewayList.yaml' + MetalGatewayLite: + $ref: './components/schemas/MetalGatewayLite.yaml' + Metro: + $ref: './components/schemas/Metro.yaml' + MetroInput: + $ref: './components/schemas/MetroInput.yaml' + MetroList: + $ref: './components/schemas/MetroList.yaml' + NewPassword: + $ref: './components/schemas/NewPassword.yaml' + OperatingSystem: + $ref: './components/schemas/OperatingSystem.yaml' + OperatingSystemList: + $ref: './components/schemas/OperatingSystemList.yaml' + Organization: + $ref: './components/schemas/Organization.yaml' + OrganizationInput: + $ref: './components/schemas/OrganizationInput.yaml' + OrganizationList: + $ref: './components/schemas/OrganizationList.yaml' + ParentBlock: + $ref: './components/schemas/ParentBlock.yaml' + PaymentMethod: + $ref: './components/schemas/PaymentMethod.yaml' + PaymentMethodBillingAddress: + $ref: './components/schemas/PaymentMethodBillingAddress.yaml' + PaymentMethodCreateInput: + $ref: './components/schemas/PaymentMethodCreateInput.yaml' + PaymentMethodList: + $ref: './components/schemas/PaymentMethodList.yaml' + PaymentMethodUpdateInput: + $ref: './components/schemas/PaymentMethodUpdateInput.yaml' + Plan: + $ref: './components/schemas/Plan.yaml' + PlanList: + $ref: './components/schemas/PlanList.yaml' + Port: + $ref: './components/schemas/Port.yaml' + PortAssignInput: + $ref: './components/schemas/PortAssignInput.yaml' + PortConvertLayer3Input: + $ref: './components/schemas/PortConvertLayer3Input.yaml' + PortVlanAssignment: + $ref: './components/schemas/PortVlanAssignment.yaml' + PortVlanAssignmentBatch: + $ref: './components/schemas/PortVlanAssignmentBatch.yaml' + PortVlanAssignmentBatchCreateInput: + $ref: './components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + PortVlanAssignmentBatchList: + $ref: './components/schemas/PortVlanAssignmentBatchList.yaml' + PortVlanAssignmentList: + $ref: './components/schemas/PortVlanAssignmentList.yaml' + Project: + $ref: './components/schemas/Project.yaml' + ProjectCreateFromRootInput: + $ref: './components/schemas/ProjectCreateFromRootInput.yaml' + ProjectCreateInput: + $ref: './components/schemas/ProjectCreateInput.yaml' + ProjectIdName: + $ref: './components/schemas/ProjectIdName.yaml' + ProjectList: + $ref: './components/schemas/ProjectList.yaml' + ProjectUpdateInput: + $ref: './components/schemas/ProjectUpdateInput.yaml' + ProjectUsage: + $ref: './components/schemas/ProjectUsage.yaml' + ProjectUsageList: + $ref: './components/schemas/ProjectUsageList.yaml' + RecoveryCodeList: + $ref: './components/schemas/RecoveryCodeList.yaml' + SSHKey: + $ref: './components/schemas/SSHKey.yaml' + SSHKeyCreateInput: + $ref: './components/schemas/SSHKeyCreateInput.yaml' + SSHKeyInput: + $ref: './components/schemas/SSHKeyInput.yaml' + SSHKeyList: + $ref: './components/schemas/SSHKeyList.yaml' + SelfServiceReservationItemRequest: + $ref: './components/schemas/SelfServiceReservationItemRequest.yaml' + SelfServiceReservationItemResponse: + $ref: './components/schemas/SelfServiceReservationItemResponse.yaml' + SelfServiceReservationList: + $ref: './components/schemas/SelfServiceReservationList.yaml' + SelfServiceReservationResponse: + $ref: './components/schemas/SelfServiceReservationResponse.yaml' + ServerInfo: + $ref: './components/schemas/ServerInfo.yaml' + SpotMarketPricesList: + $ref: './components/schemas/SpotMarketPricesList.yaml' + SpotMarketPricesPerMetroList: + $ref: './components/schemas/SpotMarketPricesPerMetroList.yaml' + SpotMarketPricesPerMetroReport: + $ref: './components/schemas/SpotMarketPricesPerMetroReport.yaml' + SpotMarketRequest: + $ref: './components/schemas/SpotMarketRequest.yaml' + SpotMarketRequestCreateInput: + $ref: './components/schemas/SpotMarketRequestCreateInput.yaml' + SpotMarketRequestList: + $ref: './components/schemas/SpotMarketRequestList.yaml' + SpotPricesDatapoints: + $ref: './components/schemas/SpotPricesDatapoints.yaml' + SpotPricesDatapointsList: + $ref: './components/schemas/SpotPricesDatapointsList.yaml' + SpotPricesHistoryReport: + $ref: './components/schemas/SpotPricesHistoryReport.yaml' + SpotPricesPerBaremetal: + $ref: './components/schemas/SpotPricesPerBaremetal.yaml' + SpotPricesPerFacility: + $ref: './components/schemas/SpotPricesPerFacility.yaml' + SpotPricesPerNewFacility: + $ref: './components/schemas/SpotPricesPerNewFacility.yaml' + SpotPricesReport: + $ref: './components/schemas/SpotPricesReport.yaml' + SupportRequestInput: + $ref: './components/schemas/SupportRequestInput.yaml' + TransferRequest: + $ref: './components/schemas/TransferRequest.yaml' + TransferRequestInput: + $ref: './components/schemas/TransferRequestInput.yaml' + TransferRequestList: + $ref: './components/schemas/TransferRequestList.yaml' + UpdateEmailInput: + $ref: './components/schemas/UpdateEmailInput.yaml' + User: + $ref: './components/schemas/User.yaml' + UserCreateInput: + $ref: './components/schemas/UserCreateInput.yaml' + Userdata: + $ref: './components/schemas/Userdata.yaml' + UserLimited: + $ref: './components/schemas/UserLimited.yaml' + UserList: + $ref: './components/schemas/UserList.yaml' + UserLite: + $ref: './components/schemas/UserLite.yaml' + UserUpdateInput: + $ref: './components/schemas/UserUpdateInput.yaml' + VerifyEmail: + $ref: './components/schemas/VerifyEmail.yaml' + VirtualCircuit: + $ref: './components/schemas/VirtualCircuit.yaml' + VirtualCircuitCreateInput: + $ref: './components/schemas/VirtualCircuitCreateInput.yaml' + VirtualCircuitList: + $ref: './components/schemas/VirtualCircuitList.yaml' + VirtualCircuitUpdateInput: + $ref: './components/schemas/VirtualCircuitUpdateInput.yaml' + VirtualNetwork: + $ref: './components/schemas/VirtualNetwork.yaml' + VirtualNetworkCreateInput: + $ref: './components/schemas/VirtualNetworkCreateInput.yaml' + VirtualNetworkList: + $ref: './components/schemas/VirtualNetworkList.yaml' + VlanFabricVcCreateInput: + $ref: './components/schemas/VlanFabricVcCreateInput.yaml' + VlanVirtualCircuit: + $ref: './components/schemas/VlanVirtualCircuit.yaml' + VlanVirtualCircuitCreateInput: + $ref: './components/schemas/VlanVirtualCircuitCreateInput.yaml' + VlanVirtualCircuitUpdateInput: + $ref: './components/schemas/VlanVirtualCircuitUpdateInput.yaml' + Vrf: + $ref: './components/schemas/Vrf.yaml' + VrfCreateInput: + $ref: './components/schemas/VrfCreateInput.yaml' + VrfFabricVcCreateInput: + $ref: './components/schemas/VrfFabricVcCreateInput.yaml' + VrfIpRangeCreateInput: + $ref: './components/schemas/VrfIpRangeCreateInput.yaml' + VrfIpRangeList: + $ref: './components/schemas/VrfIpRangeList.yaml' + VrfIpRangeUpdateInput: + $ref: './components/schemas/VrfIpRangeUpdateInput.yaml' + VrfIpReservation: + $ref: './components/schemas/VrfIpReservation.yaml' + VrfIpReservationCreateInput: + $ref: './components/schemas/VrfIpReservationCreateInput.yaml' + VrfIpReservationList: + $ref: './components/schemas/VrfIpReservationList.yaml' + VrfList: + $ref: './components/schemas/VrfList.yaml' + VrfMetalGateway: + $ref: './components/schemas/VrfMetalGateway.yaml' + VrfMetalGatewayCreateInput: + $ref: './components/schemas/VrfMetalGatewayCreateInput.yaml' + VrfRoute: + $ref: './components/schemas/VrfRoute.yaml' + VrfRouteCreateInput: + $ref: './components/schemas/VrfRouteCreateInput.yaml' + VrfRouteUpdateInput: + $ref: './components/schemas/VrfRouteUpdateInput.yaml' + VrfRouteList: + $ref: './components/schemas/VrfRouteList.yaml' + VrfUpdateInput: + $ref: './components/schemas/VrfUpdateInput.yaml' + VrfVirtualCircuit: + $ref: './components/schemas/VrfVirtualCircuit.yaml' + VrfVirtualCircuitCreateInput: + $ref: './components/schemas/VrfVirtualCircuitCreateInput.yaml' + VrfVirtualCircuitUpdateInput: + $ref: './components/schemas/VrfVirtualCircuitUpdateInput.yaml' + securitySchemes: + x_auth_token: + in: header + name: X-Auth-Token + type: apiKey + x-displayName: X-Auth-Token + description: |+ + HTTP header containing the User or Project API key that will be used to authenticate the request. +paths: + /api-keys/{id}: + $ref: ./paths/api-keys/id.yaml + /batches/{id}: + $ref: ./paths/batches/id.yaml + /bgp/sessions/{id}: + $ref: ./paths/bgp/sessions/id.yaml + /bgp-dynamic-neighbors/{id}: + $ref: ./paths/bgp-dynamic-neighbors/id.yaml + /capacity: + $ref: ./paths/capacity.yaml + /capacity/metros: + $ref: ./paths/capacity/metros.yaml + /connections/{connection_id}: + $ref: ./paths/connections/connection_id.yaml + /connections/{connection_id}/events: + $ref: ./paths/connections/connection_id/events.yaml + /connections/{connection_id}/ports: + $ref: ./paths/connections/connection_id/ports.yaml + /connections/{connection_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/virtual-circuits.yaml + /connections/{connection_id}/ports/{id}: + $ref: ./paths/connections/connection_id/ports/id.yaml + /connections/{connection_id}/ports/{id}/events: + $ref: ./paths/connections/connection_id/ports/id/events.yaml + /connections/{connection_id}/ports/{port_id}/virtual-circuits: + $ref: ./paths/connections/connection_id/ports/port_id/virtual-circuits.yaml + /devices/{id}: + $ref: ./paths/devices/id.yaml + /devices/{id}/actions: + $ref: ./paths/devices/id/actions.yaml + /devices/{id}/bandwidth: + $ref: ./paths/devices/id/bandwidth.yaml + /devices/{id}/bgp/neighbors: + $ref: ./paths/devices/id/bgp/neighbors.yaml + /devices/{id}/bgp/sessions: + $ref: ./paths/devices/id/bgp/sessions.yaml + /devices/{id}/customdata: + $ref: ./paths/devices/id/customdata.yaml + /devices/{id}/diagnostics/screenshot: + $ref: ./paths/devices/id/diagnostics/screenshot.yaml + /devices/{id}/diagnostics/health/rollup: + $ref: ./paths/devices/id/diagnostics/health/rollup.yaml + /devices/{id}/events: + $ref: ./paths/devices/id/events.yaml + /devices/{id}/firmware-sets: + $ref: ./paths/devices/id/firmware-sets.yaml + /devices/{id}/ips: + $ref: ./paths/devices/id/ips.yaml + /devices/{id}/metadata: + $ref: ./paths/devices/id/metadata.yaml + /devices/{id}/ssh-keys: + $ref: ./paths/devices/id/ssh-keys.yaml + /devices/{id}/traffic: + $ref: ./paths/devices/id/traffic.yaml + /devices/{id}/usages: + $ref: ./paths/devices/id/usages.yaml + /devices/{id}/userdata: + $ref: ./paths/devices/id/userdata.yaml + /devices/{instance_id}/ips/{id}/customdata: + $ref: ./paths/devices/instance_id/ips/id/customdata.yaml + /emails: + $ref: ./paths/emails.yaml + /emails/{id}: + $ref: ./paths/emails/id.yaml + /events: + $ref: ./paths/events.yaml + /events/{id}: + $ref: ./paths/events/id.yaml + /facilities: + $ref: ./paths/facilities.yaml + /hardware-reservations/{id}: + $ref: ./paths/hardware-reservations/id.yaml + /hardware-reservations/{id}/activate: + $ref: ./paths/hardware-reservations/id/activate.yaml + /hardware-reservations/{id}/move: + $ref: ./paths/hardware-reservations/id/move.yaml + /incidents: + $ref: ./paths/incidents.yaml + /invitations: + $ref: ./paths/invitations.yaml + /invitations/{id}: + $ref: ./paths/invitations/id.yaml + /invoices/{id}: + $ref: ./paths/invoices/id.yaml + /ips/{id}: + $ref: ./paths/ips/id.yaml + /ips/{id}/available: + $ref: ./paths/ips/id/available.yaml + /ips/{id}/customdata: + $ref: ./paths/ips/id/customdata.yaml + /licenses/{id}: + $ref: ./paths/licenses/id.yaml + /locations/metros: + $ref: ./paths/locations/metros.yaml + /locations/metros/{id}: + $ref: ./paths/locations/metros/id.yaml + /market/spot/prices: + $ref: ./paths/market/spot/prices.yaml + /market/spot/prices/history: + $ref: ./paths/market/spot/prices/history.yaml + /market/spot/prices/metros: + $ref: ./paths/market/spot/prices/metros.yaml + /memberships/{id}: + $ref: ./paths/memberships/id.yaml + /metal-gateways/{id}: + $ref: ./paths/metal-gateways/id.yaml + /metal-gateways/{id}/bgp-dynamic-neighbors: + $ref: ./paths/metal-gateways/id/bgp-dynamic-neighbors.yaml + /metal-gateways/{id}/ips: + $ref: ./paths/metal-gateways/id/ips.yaml + /operating-system-versions: + $ref: ./paths/operating-system-versions.yaml + /operating-systems: + $ref: ./paths/operating-systems.yaml + /organizations: + $ref: ./paths/organizations.yaml + /organizations/{id}: + $ref: ./paths/organizations/id.yaml + /organizations/{id}/capacity: + $ref: ./paths/organizations/id/capacity.yaml + /organizations/{id}/capacity/metros: + $ref: ./paths/organizations/id/capacity/metros.yaml + /organizations/{id}/customdata: + $ref: ./paths/organizations/id/customdata.yaml + /organizations/{id}/devices: + $ref: ./paths/organizations/id/devices.yaml + /organizations/{id}/events: + $ref: ./paths/organizations/id/events.yaml + /organizations/{id}/facilities: + $ref: ./paths/organizations/id/facilities.yaml + /organizations/{id}/firmware-sets: + $ref: ./paths/organizations/id/firmware-sets.yaml + /organizations/{id}/invitations: + $ref: ./paths/organizations/id/invitations.yaml + /organizations/{id}/invoices: + $ref: ./paths/organizations/id/invoices.yaml + /organizations/{id}/operating-systems: + $ref: ./paths/organizations/id/operating-systems.yaml + /organizations/{id}/payment-methods: + $ref: ./paths/organizations/id/payment-methods.yaml + /organizations/{id}/plans: + $ref: ./paths/organizations/id/plans.yaml + /organizations/{id}/projects: + $ref: ./paths/organizations/id/projects.yaml + /organizations/{id}/transfers: + $ref: ./paths/organizations/id/transfers.yaml + /organizations/{organization_id}/connections: + $ref: ./paths/organizations/organization_id/connections.yaml + /payment-methods/{id}: + $ref: ./paths/payment-methods/id.yaml + /plans: + $ref: ./paths/plans.yaml + /ports/{id}: + $ref: ./paths/ports/id.yaml + /ports/{id}/assign: + $ref: ./paths/ports/id/assign.yaml + /ports/{id}/bond: + $ref: ./paths/ports/id/bond.yaml + /ports/{id}/convert/layer-2: + $ref: ./paths/ports/id/convert/layer-2.yaml + /ports/{id}/convert/layer-3: + $ref: ./paths/ports/id/convert/layer-3.yaml + /ports/{id}/disbond: + $ref: ./paths/ports/id/disbond.yaml + /ports/{id}/native-vlan: + $ref: ./paths/ports/id/native-vlan.yaml + /ports/{id}/unassign: + $ref: ./paths/ports/id/unassign.yaml + /ports/{id}/vlan-assignments: + $ref: ./paths/ports/id/vlan-assignments.yaml + /ports/{id}/vlan-assignments/{assignment_id}: + $ref: ./paths/ports/id/vlan-assignments/assignment_id.yaml + /ports/{id}/vlan-assignments/batches: + $ref: ./paths/ports/id/vlan-assignments/batches.yaml + /ports/{id}/vlan-assignments/batches/{batch_id}: + $ref: ./paths/ports/id/vlan-assignments/batches/batch_id.yaml + /projects: + $ref: ./paths/projects.yaml + /projects/{id}: + $ref: ./paths/projects/id.yaml + /projects/{id}/api-keys: + $ref: ./paths/projects/id/api-keys.yaml + /projects/{id}/batches: + $ref: ./paths/projects/id/batches.yaml + /projects/{id}/bgp-config: + $ref: ./paths/projects/id/bgp-config.yaml + /projects/{id}/bgp-configs: + $ref: ./paths/projects/id/bgp-configs.yaml + /projects/{id}/bgp/sessions: + $ref: ./paths/projects/id/bgp/sessions.yaml + /projects/{id}/customdata: + $ref: ./paths/projects/id/customdata.yaml + /projects/{id}/devices: + $ref: ./paths/projects/id/devices.yaml + /projects/{id}/devices/batch: + $ref: ./paths/projects/id/devices/batch.yaml + /projects/{id}/events: + $ref: ./paths/projects/id/events.yaml + /projects/{id}/facilities: + $ref: ./paths/projects/id/facilities.yaml + /projects/{id}/firmware-sets: + $ref: ./paths/projects/id/firmware-sets.yaml + /projects/{id}/global-bgp-ranges: + $ref: ./paths/projects/id/global-bgp-ranges.yaml + /projects/{id}/hardware-reservations: + $ref: ./paths/projects/id/hardware-reservations.yaml + /projects/{id}/ips: + $ref: ./paths/projects/id/ips.yaml + /projects/{id}/licenses: + $ref: ./paths/projects/id/licenses.yaml + /projects/{id}/plans: + $ref: ./paths/projects/id/plans.yaml + /projects/{id}/spot-market-requests: + $ref: ./paths/projects/id/spot-market-requests.yaml + /projects/{id}/ssh-keys: + $ref: ./paths/projects/id/ssh-keys.yaml + /projects/{id}/transfers: + $ref: ./paths/projects/id/transfers.yaml + /projects/{id}/usages: + $ref: ./paths/projects/id/usages.yaml + /projects/{id}/virtual-networks: + $ref: ./paths/projects/id/virtual-networks.yaml + /projects/{id}/vrfs: + $ref: ./paths/projects/id/vrfs.yaml + /projects/{project_id}/connections: + $ref: ./paths/projects/project_id/connections.yaml + /projects/{project_id}/invitations: + $ref: ./paths/projects/project_id/invitations.yaml + /projects/{project_id}/ips/{id}/customdata: + $ref: ./paths/projects/project_id/ips/id/customdata.yaml + /projects/{project_id}/memberships: + $ref: ./paths/projects/project_id/memberships.yaml + /projects/{project_id}/metal-gateways: + $ref: ./paths/projects/project_id/metal-gateways.yaml + /projects/{project_id}/self-service/reservations: + $ref: ./paths/projects/project_id/self-service/reservations.yaml + /projects/{project_id}/self-service/reservations/{id}: + $ref: ./paths/projects/project_id/self-service/reservations/id.yaml + /reset-password: + $ref: ./paths/reset-password.yaml + /routes/{id}: + $ref: ./paths/routes/id.yaml + /routes/{id}/events: + $ref: ./paths/routes/id/events.yaml + /spot-market-requests/{id}: + $ref: ./paths/spot-market-requests/id.yaml + /ssh-keys: + $ref: ./paths/ssh-keys.yaml + /ssh-keys/{id}: + $ref: ./paths/ssh-keys/id.yaml + /support-requests: + $ref: ./paths/support-requests.yaml + /transfers/{id}: + $ref: ./paths/transfers/id.yaml + /user: + $ref: ./paths/user.yaml + /user/api-keys: + $ref: ./paths/user/api-keys.yaml + /user/api-keys/{id}: + $ref: ./paths/user/api-keys/id.yaml + /user/otp/app: + $ref: ./paths/user/otp/app.yaml + /user/otp/recovery-codes: + $ref: ./paths/user/otp/recovery-codes.yaml + /user/otp/sms: + $ref: ./paths/user/otp/sms.yaml + /user/otp/sms/receive: + $ref: ./paths/user/otp/sms/receive.yaml + /user/otp/verify/{otp}: + $ref: ./paths/user/otp/verify/otp.yaml + /userdata/validate: + $ref: ./paths/userdata/validate.yaml + /users: + $ref: ./paths/users.yaml + /users/{id}: + $ref: ./paths/users/id.yaml + /users/{id}/customdata: + $ref: ./paths/users/id/customdata.yaml + /verify-email: + $ref: ./paths/verify-email.yaml + /virtual-circuits/{id}/events: + $ref: ./paths/virtual-circuits/id/events.yaml + /virtual-circuits/{id}: + $ref: ./paths/virtual-circuits/id.yaml + /virtual-networks/{id}: + $ref: ./paths/virtual-networks/id.yaml + /vrfs/{id}: + $ref: ./paths/vrfs/id.yaml + /vrfs/{id}/ips: + $ref: ./paths/vrfs/id/ips.yaml + /vrfs/{vrf_id}/ips/{id}: + $ref: ./paths/vrfs/vrf_id/ips/id.yaml + /vrfs/{id}/routes: + $ref: ./paths/vrfs/id/routes.yaml +tags: + - description: |+ + Nearly all of the endpoints in the API require authentication. Authentication is performed by providing an authentication token (interchangeably referred to as an API key) in the `X-Auth-Token` HTTP request header. + + + + User API keys can be obtained by creating them in the Equinix Metal Portal or by using the [Create a User API Key](#operation/createAPIKey) endpoint. + + Project API keys can also be obtained by creating them in the Equinix Metal Portal or by using the [Create a Project API Key](#operation/createProjectAPIKey) endpoint. Project API keys are scoped to a single project and can only be used to access resources within that project. + + For example, to use an authenticated API token, you would make a request like the following: + + ```bash + curl -H 'X-Auth-Token: my_authentication_token' \ + https://api.equinix.com/metal/v1/user/api-keys + ``` + + Applications can take advantage of the Equinix Metal API and API keys to perform any of the actions that can be performed in the Equinix Metal Portal. For example, you can use the API to create and manage devices, projects, and other resources. + + API keys can be deleted without affecting any of the resources created with them. Access to applications using the API can be revoked by deleting the API key used to authenticate the application. + name: Authentication + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/#api-keys + - description: | + Equinix Metal uses conventional HTTP response codes to indicate the success or failure of an API request. + + In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Equinix Metal's servers (these are rare). + + | Code | Summary + | ---------------------------------- | ------------------------------------------------------ + | 200 OK | Everything worked as expected. + | 201 Create | Everything worked as expected, the resource was created. + | 422 Bad Request | The request was unacceptable, often due to missing a required parameter. + | 401 Unauthorized | No valid API key provided. + | 404 Not Found | The requested resource doesn't exist. + | 500, 502, 503, 504 - Server Errors | Something went wrong on Equinix Metal's end. (These are rare.) + + Errors (4xx, 5xx) reported by the API will include a JSON error response. This response will be structured as one of the following: + + ```json + {"error": "the error message"} + ``` + + or + + ```json + {"errors": ["one error", "another error"} + ``` + + The JSON response is not guaranteed so check the HTTP status message. JSON may not be included if the error is reported by an API intermediary, like a loadbalancer service. + name: Errors + - description: > + Manage device batches. See project endpoints to list batches for a + particular project. Check out the product docs to learn more about [Batch + Deployment](https://metal.equinix.com/developers/docs/deploy/batch-deployment/). + name: Batches + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/batch-deployment/ + - description: > + Manage BGP configs and sessions. See device endpoints to create and list BGP + sessions for a particular device. Check out the product docs to learn more + about [Local and Global + BGP](https://metal.equinix.com/developers/docs/networking/local-global-bgp/). + name: BGP + externalDocs: + url: https://metal.equinix.com/developers/docs/bgp/bgp-on-equinix-metal/ + - description: > + Capacity Management. Check out the product docs to learn more about + [Capacity](https://metal.equinix.com/developers/docs/locations/capacity/). + name: Capacity + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/capacity/ + - description: > + Network Interconnections. See Instructions to create Network + Interconnections at Check out the product docs to learn more about [Equinix + Fabric](https://metal.equinix.com/developers/docs/networking/fabric/). + name: Interconnections + externalDocs: + url: https://metal.equinix.com/developers/docs/equinix-interconnect/introduction/ + - description: > + Device Management. Check out the product docs to learn more about [Server + Devices](https://metal.equinix.com/developers/docs/servers/). + name: Devices + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/on-demand/ + - description: Email Management + name: Emails + - description: Event Management + name: Events + - description: > + Facility Management. Check out the product docs to learn more about + [Facilities](https://metal.equinix.com/developers/docs/locations/). + name: Facilities + - description: > + Firmware Sets Management. Notice: Firmware Sets are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Firmware Sets + - description: > + Console Log Details. Notice: This is a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: Console Log Details + - description: > + Global BGP Range Management + name: GlobalBgpRanges + externalDocs: + url: https://metal.equinix.com/developers/docs/bgp/global-bgp/ + - description: > + Hardware Reservation Management. Check out the product docs to learn more + about [Reserved + Hardware](https://metal.equinix.com/developers/docs/deploy/reserved/). + name: HardwareReservations + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/reserved/ + - description: > + Incident Management + name: Incidents + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/maintenance/ + - description: > + Manage invitations. See project endpoints to create a new invitation. Check + out the product docs to learn more about + [Invitations](https://metal.equinix.com/developers/docs/accounts/). + name: Invitations + - description: > + Manage IP addresses. See device and project endpoints to list and create IP + assignments for a particular project or device. Check out the product docs + to learn more about [the basic networking + features](https://metal.equinix.com/developers/docs/networking/standard-ips/). + name: IPAddresses + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/ + - description: > + Manage licenses. See project endpoints to list and create licenses for a + particular project. + name: Licenses + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/licensed/ + - description: > + Membership Management (Project). Check out the product docs to learn more + about [Membership](https://metal.equinix.com/developers/docs/accounts/). + name: Memberships + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/#inviting-a-user-to-a-project + - description: > + Device Metadata + name: Metadata + externalDocs: + url: https://metal.equinix.com/developers/docs/server-metadata/metadata/ + - description: > + Metal Gateway Management.Check out the product docs to learn more about + [Metal + Gateways](https://metal.equinix.com/developers/docs/networking/metal-gateway/). + name: MetalGateways + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/metal-gateway/ + - description: Metro Management. Check out the product docs to learn more about [Metros](https://metal.equinix.com/developers/docs/locations/metros/). + name: Metros + externalDocs: + url: https://metal.equinix.com/developers/docs/locations/metros/ + - description: > + Operating System Management. Check out the product docs to learn more about + [Operating Systems + choices](https://metal.equinix.com/developers/docs/operating-systems/). + name: OperatingSystems + externalDocs: + url: https://metal.equinix.com/developers/docs/operating-systems/supported/ + - description: + Organizations Management. Check out the product docs to learn more + about [Organizations](https://metal.equinix.com/developers/docs/accounts/). + name: Organizations + - description: > + OTP Management. Check out the product docs to learn more about [OTP](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ + name: OTPs + - description: > + Password Reset Token Management + name: PasswordResetTokens + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/#security-settings + - description: > + Payment Method Management + name: PaymentMethods + externalDocs: + url: https://metal.equinix.com/developers/docs/billing/payment-methods/ + - description: > + Plan Management (Device). Check out the product docs to learn more + about [Device Plans](https://metal.equinix.com/developers/docs/servers/). + name: Plans + - description: > + Port ManagementCheck out the product docs to learn more about [Port + configurations](https://metal.equinix.com/developers/docs/layer2-networking/overview/). + name: Ports + externalDocs: + url: https://metal.equinix.com/developers/docs/layer2-networking/overview/ + - description: > + Project Management. Check out the product docs to learn more about + [Projects](https://metal.equinix.com/developers/docs/accounts/projects/). + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/ + name: Projects + - description: > + Self Service Reservations + name: SelfServiceReservations + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/reserved/ + - description: > + Spot Market Pricing and Requests Management. Check out the product docs to learn more + about [Spot Market + features](https://metal.equinix.com/developers/docs/deploy/spot-market/). + name: SpotMarket + externalDocs: + url: https://metal.equinix.com/developers/docs/deploy/spot-market/ + - description: > + Manage SSH keys. See project endpoints to list and create project-level SSH + keys. + name: SSHKeys + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/ssh-keys/ + - description: > + Support request + name: SupportRequest + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/support/ + - description: > + Project Transfer Requests Management + name: TransferRequests + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/projects/#transferring-a-project + - description: > + Two Factor Authentication Management. Check out the product docs to learn + more about + [2FA](https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/). + name: TwoFactorAuth + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/two-factor-authentication/ + - description: Usage Management + name: Usages + externalDocs: + url: https://metal.equinix.com/developers/docs/billing/checking-usage/ + - description: > + Userdata Management + name: Userdata + externalDocs: + url: https://metal.equinix.com/developers/docs/server-metadata/user-data/ + - description: > + User Management + name: Users + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/users/ + - description: > + User Verification Token Management + name: UserVerificationTokens + externalDocs: + url: https://metal.equinix.com/developers/docs/accounts/organizations/#managing-team-members + - description: > + Manage virtual networks (VLANs). See project endpoints to list and create + virtual networks. Check out the product docs to learn more about + [VLANs](https://metal.equinix.com/developers/docs/networking/layer2/). + name: VLANs + externalDocs: + url: https://metal.equinix.com/developers/docs/networking/layer2/ + - description: > + Volume Management (Block Storage). Notice: Block storage support will + be deprecated soon. Please check here: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ + for more details. + name: Volumes + externalDocs: + url: https://metal.equinix.com/developers/docs/resilience-recovery/elastic-block-storage/ + - description: > + VRF Management. A VRF is a project-scoped virtual router resource that defines a collection of customer-managed IP blocks that can be used in BGP peering on one or more virtual networks. Metal Gateways and Interconnection Virtual Circuits can take advantage of VRFs to enable Layer 3 routing with bespoke network ranges. Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + name: VRFs +x-tagGroups: + - name: Accounts and Organization + tags: + - Authentication + - Emails + - Invitations + - Memberships + - Organizations + - OTPs + - PasswordResetTokens + - PaymentMethods + - Projects + - SSHKeys + - SupportRequest + - TransferRequests + - TwoFactorAuth + - Users + - UserVerificationTokens + - name: Services and Billing + tags: + - Events + - Facilities + - Incidents + - Invoices + - Licenses + - Metros + - Plans + - Usages + - name: Servers + tags: + - Devices + - Batches + - Capacity + - HardwareReservations + - OperatingSystems + - Ports + - SelfServiceReservations + - SpotMarket + - Userdata + - Volumes + - name: Networking + tags: + - BGP + - Interconnections + - IPAddresses + - MetalGateways + - VLANs + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/api-keys/id.yaml b/spec/services/metalv1/oas3.patched/paths/api-keys/id.yaml new file mode 100644 index 00000000..10caea95 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the API key. + operationId: deleteAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.patched/paths/batches/id.yaml b/spec/services/metalv1/oas3.patched/paths/batches/id.yaml new file mode 100644 index 00000000..6a97f0b2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/batches/id.yaml @@ -0,0 +1,69 @@ +delete: + description: Deletes the Batch. + operationId: deleteBatch + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Delete all instances created from this batch + in: query + name: remove_associated_instances + schema: + default: false + type: boolean + responses: + "204": + description: no content + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the Batch + tags: + - Batches +get: + description: Returns a Batch + operationId: findBatchById + parameters: + - description: Batch UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Batch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a Batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.patched/paths/bgp-dynamic-neighbors/id.yaml b/spec/services/metalv1/oas3.patched/paths/bgp-dynamic-neighbors/id.yaml new file mode 100644 index 00000000..fcef32cd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/bgp-dynamic-neighbors/id.yaml @@ -0,0 +1,77 @@ +delete: + summary: Delete a VRF BGP Dynamic Neighbor + description: Trigger the removal of a BGP Neighbor range from a VRF + operationId: deleteBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a BGP Dynamic Neighbor + description: Return a single BGP Dynamic Neighbor resource + operation: findBgpDynamicNeighborById + parameters: + - description: BGP Dynamic Neighbor UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/BgpDynamicNeighbor.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/bgp/sessions/id.yaml b/spec/services/metalv1/oas3.patched/paths/bgp/sessions/id.yaml new file mode 100644 index 00000000..d34f2ae8 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/bgp/sessions/id.yaml @@ -0,0 +1,124 @@ +delete: + description: Deletes the BGP session. + operationId: deleteBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the BGP session + tags: + - BGP +get: + description: Returns a BGP session + operationId: findBgpSessionById + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpSession.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a BGP session + tags: + - BGP +put: + description: Updates the BGP session by either enabling or disabling the default + route functionality. + operationId: updateBgpSession + parameters: + - description: BGP session UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + type: boolean + description: Default route + required: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the BGP session + tags: + - BGP diff --git a/spec/services/metalv1/oas3.patched/paths/capacity.yaml b/spec/services/metalv1/oas3.patched/paths/capacity.yaml new file mode 100644 index 00000000..904cdd4c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/capacity.yaml @@ -0,0 +1,69 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findCapacityForFacility + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity + tags: + - Capacity +post: + deprecated: true + description: Validates if a deploy can be fulfilled. + operationId: checkCapacityForFacility + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CapacityInput.yaml' + description: Facility to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/CapacityCheckPerFacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.patched/paths/capacity/metros.yaml b/spec/services/metalv1/oas3.patched/paths/capacity/metros.yaml new file mode 100644 index 00000000..bac69d22 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/capacity/metros.yaml @@ -0,0 +1,68 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findCapacityForMetro + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + dc: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: View capacity for metros + tags: + - Capacity +post: + description: Validates if a deploy can be fulfilled in a metro. + operationId: checkCapacityForMetro + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityInput.yaml' + description: Metro to check capacity in + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/CapacityCheckPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Check capacity for a metro + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id.yaml new file mode 100644 index 00000000..1fdf9236 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id.yaml @@ -0,0 +1,112 @@ +delete: + description: Delete a interconnection, its associated ports and virtual circuits. + operationId: deleteInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete interconnection + tags: + - Interconnections +get: + description: Get the details of a interconnection + operationId: getInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get interconnection + tags: + - Interconnections +put: + description: Update the details of a interconnection + operationId: updateInterconnection + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/InterconnectionUpdateInput.yaml' + description: Updated interconnection details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Interconnection.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update interconnection + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml new file mode 100644 index 00000000..e797a392 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml @@ -0,0 +1,44 @@ +get: + description: Returns a list of the interconnection events + operationId: findInterconnectionEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection events + tags: + - Events + x-equinix-metal-paginated-property: Events diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports.yaml new file mode 100644 index 00000000..11b270ec --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports.yaml @@ -0,0 +1,33 @@ +get: + description: List the ports associated to an interconnection. + operationId: listInterconnectionPorts + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionPortList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's ports + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id.yaml new file mode 100644 index 00000000..540efd28 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id.yaml @@ -0,0 +1,42 @@ +get: + description: Get the details of an interconnection port. + operationId: getInterconnectionPort + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + - $ref: '../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/InterconnectionPort.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Get a interconnection port + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id/events.yaml new file mode 100644 index 00000000..8cafd50a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/id/events.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of the interconnection port events + operationId: findInterconnectionPortEvents + parameters: + - description: Interconnection UUID + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: Interconnection Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + - $ref: '../../../../../components/parameters/Page.yaml' + - $ref: '../../../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve interconnection port events + tags: + - Events diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml new file mode 100644 index 00000000..7d87e987 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/ports/port_id/virtual-circuits.yaml @@ -0,0 +1,92 @@ +get: + description: List the virtual circuit record(s) associatiated with a particular + interconnection port. + operationId: listInterconnectionPortVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + - $ref: '../../../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection port's virtual circuits + tags: + - Interconnections +post: + description: Create a new Virtual Circuit on a Dedicated Port. To create a regular Virtual Circuit, specify + a Virtual Network record and an NNI VLAN value. To create a VRF-based Virtual Circuit, specify the VRF ID and subnet, + along with the NNI VLAN value. + operationId: createInterconnectionPortVirtualCircuit + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + - description: UUID of the interconnection port + in: path + name: port_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuitCreateInput.yaml' + description: Virtual Circuit details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Create a new Virtual Circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/virtual-circuits.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/virtual-circuits.yaml new file mode 100644 index 00000000..ac0c891c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/virtual-circuits.yaml @@ -0,0 +1,33 @@ +get: + description: List the virtual circuit record(s) associated with a particular interconnection id. + operationId: listInterconnectionVirtualCircuits + parameters: + - description: UUID of the interconnection + in: path + name: connection_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualCircuitList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List a interconnection's virtual circuits + tags: + - Interconnections \ No newline at end of file diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id.yaml new file mode 100644 index 00000000..1eb2ed9e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id.yaml @@ -0,0 +1,144 @@ +delete: + description: Deletes a device and deprovisions it in our datacenter. + operationId: deleteDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Force the deletion of the device, by detaching any storage volume + still active. + in: query + name: force_delete + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete the device + tags: + - Devices +get: + description: |- + Type-specific options (such as facility for baremetal devices) will be included as part of the main data structure. + State value can be one of: active inactive queued or provisioning + operationId: findDeviceById + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a device + tags: + - Devices +put: + description: Updates the device. + operationId: updateDevice + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/DeviceUpdateInput.yaml' + description: Device to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Device.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/actions.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/actions.yaml new file mode 100644 index 00000000..ba60b9b4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/actions.yaml @@ -0,0 +1,44 @@ +post: + description: 'Performs an action for the given device. Possible actions include: + power_on, power_off, reboot, reinstall, and rescue (reboot the device into rescue + OS.)' + operationId: performAction + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceActionInput.yaml' + description: Action to perform + required: true + responses: + "202": + description: accepted + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Perform an action + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/bandwidth.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/bandwidth.yaml new file mode 100644 index 00000000..91524c96 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/bandwidth.yaml @@ -0,0 +1,41 @@ +get: + description: Retrieve an instance bandwidth for a given period of time. + operationId: findInstanceBandwidth + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an instance bandwidth + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/neighbors.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/neighbors.yaml new file mode 100644 index 00000000..e2711c96 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/neighbors.yaml @@ -0,0 +1,41 @@ +get: + description: Provides a summary of the BGP neighbor data associated to the BGP sessions + for this device. + operationId: getBgpNeighborData + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionNeighbors.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve BGP neighbor data for this device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/sessions.yaml new file mode 100644 index 00000000..131fcef5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/bgp/sessions.yaml @@ -0,0 +1,81 @@ +get: + description: Provides a listing of available BGP sessions for the device. + operationId: findBgpSessions + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all BGP sessions + tags: + - Devices +post: + description: Creates a BGP session. + operationId: createBgpSession + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/BGPSessionInput.yaml' + description: BGP session to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSession.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a BGP session + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/customdata.yaml new file mode 100644 index 00000000..1b3c0266 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this instance in json format + operationId: findDeviceCustomdata + parameters: + - description: Instance UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an instance + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/health/rollup.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/health/rollup.yaml new file mode 100644 index 00000000..4d66456f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/health/rollup.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's Health Status + description: Returns the health rollup status of the device. + operationId: getDeviceHealthRollup + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../../../components/schemas/DeviceHealthRollup.yaml' + "401": + $ref: '../../../../../components/schemas/Error.yaml' + "404": + $ref: '../../../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml new file mode 100644 index 00000000..67c2d147 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/diagnostics/screenshot.yaml @@ -0,0 +1,39 @@ +get: + description: Capture a screenshot from the device, if supported, via the BMC. + operationId: captureScreenshot + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + tags: + - Console Log Details + responses: + "200": + description: An image file + content: + application/jpeg: + schema: + type: string + format: binary + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "501": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not implemented for device diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml new file mode 100644 index 00000000..470b51ea --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml @@ -0,0 +1,44 @@ +get: + description: Returns a list of events pertaining to a specific device + operationId: findDeviceEvents + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device's events + tags: + - Events + x-equinix-metal-paginated-property: Events diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/firmware-sets.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/firmware-sets.yaml new file mode 100644 index 00000000..b3eca50a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/firmware-sets.yaml @@ -0,0 +1,31 @@ +get: + tags: + - Devices + summary: Get Device's associated Firmware Set + description: Returns the firmware set associated with the device. If a custom firmware set is associated with the device, then it is returned. Otherwise, if a default firmware set is available it is returned. + operationId: getDeviceFirmwareSets + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/ips.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/ips.yaml new file mode 100644 index 00000000..af8637c0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/ips.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all ip assignments for a device. + operationId: findIPAssignments + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip assignments + tags: + - Devices +post: + description: Creates an ip assignment for a device. + operationId: createIPAssignment + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignmentInput.yaml' + description: IPAssignment to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAssignment.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an ip assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/metadata.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/metadata.yaml new file mode 100644 index 00000000..d3fce7cc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/metadata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device metadata + operationId: findDeviceMetadataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metadata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve metadata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/ssh-keys.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/ssh-keys.yaml new file mode 100644 index 00000000..73fb19d6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/ssh-keys.yaml @@ -0,0 +1,33 @@ +get: + description: Returns a collection of the device's ssh keys. + operationId: findDeviceSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: Search string + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a device's ssh keys + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/traffic.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/traffic.yaml new file mode 100644 index 00000000..b766b01c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/traffic.yaml @@ -0,0 +1,84 @@ +get: + description: Returns traffic for a specific device. + operationId: findTraffic + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Traffic direction + in: query + name: direction + required: true + schema: + enum: + - inbound + - outbound + type: string + - description: Traffic interval + in: query + name: interval + schema: + enum: + - minute + - hour + - day + - week + - month + - year + - hour_of_day + - day_of_week + - day_of_month + - month_of_year + type: string + - description: Traffic bucket + in: query + name: bucket + schema: + enum: + - internal + - external + type: string + - name: timeframe + in: query + schema: + properties: + ended_at: + format: date-time + type: string + started_at: + format: date-time + type: string + required: + - started_at + - ended_at + type: object + style: deepObject + explode: true + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve device traffic + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/usages.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/usages.yaml new file mode 100644 index 00000000..6ad450c9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a device. + operationId: findDeviceUsages + parameters: + - description: Device UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for device + tags: + - Usages diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/userdata.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/userdata.yaml new file mode 100644 index 00000000..63aedafe --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/id/userdata.yaml @@ -0,0 +1,39 @@ +get: + description: Retrieve device userdata + operationId: findDeviceUserdataByID + parameters: + - description: Device UUID + in: path + name: id + schema: + type: string + format: uuid + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Userdata.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve userdata + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/devices/instance_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/devices/instance_id/ips/id/customdata.yaml new file mode 100644 index 00000000..080b675a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/devices/instance_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Assignment in json + format + operationId: findIPAssignmentCustomdata + parameters: + - description: Instance UUID + in: path + name: instance_id + required: true + schema: + format: uuid + type: string + - description: Ip Assignment UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Assignment + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/emails.yaml b/spec/services/metalv1/oas3.patched/paths/emails.yaml new file mode 100644 index 00000000..3e3e1b8e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/emails.yaml @@ -0,0 +1,32 @@ +post: + description: Add a new email address to the current user. + operationId: createEmail + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/CreateEmailInput.yaml' + description: Email to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Email.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.patched/paths/emails/id.yaml b/spec/services/metalv1/oas3.patched/paths/emails/id.yaml new file mode 100644 index 00000000..6c42e43b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/emails/id.yaml @@ -0,0 +1,126 @@ +delete: + description: Deletes the email. + operationId: deleteEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the email + tags: + - Emails +get: + description: Provides one of the user’s emails. + operationId: findEmailById + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an email + tags: + - Emails +put: + description: Updates the email. + operationId: updateEmail + parameters: + - description: Email UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/UpdateEmailInput.yaml' + description: email to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Email.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the email + tags: + - Emails diff --git a/spec/services/metalv1/oas3.patched/paths/events.yaml b/spec/services/metalv1/oas3.patched/paths/events.yaml new file mode 100644 index 00000000..7efcc877 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/events.yaml @@ -0,0 +1,25 @@ +get: + description: Returns a list of the current user’s events + operationId: findEvents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve current user's events + tags: + - Events + x-equinix-metal-paginated-property: Events diff --git a/spec/services/metalv1/oas3.patched/paths/events/id.yaml b/spec/services/metalv1/oas3.patched/paths/events/id.yaml new file mode 100644 index 00000000..f89b640e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/events/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single event if the user has access + operationId: findEventById + parameters: + - description: Event UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an event + tags: + - Events diff --git a/spec/services/metalv1/oas3.patched/paths/facilities.yaml b/spec/services/metalv1/oas3.patched/paths/facilities.yaml new file mode 100644 index 00000000..871a4d40 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/facilities.yaml @@ -0,0 +1,50 @@ +get: + deprecated: true + description: Provides a listing of available datacenters where you can provision + Packet devices. + operationId: findFacilities + parameters: + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + enum: + - address + - labels + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + default: + - address + items: + enum: + - address + - labels + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all facilities + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id.yaml b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id.yaml new file mode 100644 index 00000000..f060e73d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single hardware reservation + operationId: findHardwareReservationById + parameters: + - description: HardwareReservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/activate.yaml b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/activate.yaml new file mode 100644 index 00000000..2a828934 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/activate.yaml @@ -0,0 +1,50 @@ +post: + description: Activate a spare hardware reservation + operationId: activateHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + description: + type: string + description: Note to attach to the reservation + required: false + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Activate a spare hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/move.yaml b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/move.yaml new file mode 100644 index 00000000..53b7e969 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/hardware-reservations/id/move.yaml @@ -0,0 +1,51 @@ +post: + description: Move a hardware reservation to another project + operationId: moveHardwareReservation + parameters: + - description: Hardware Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + properties: + project_id: + format: uuid + type: string + description: Destination Project UUID + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Move a hardware reservation + tags: + - HardwareReservations diff --git a/spec/services/metalv1/oas3.patched/paths/incidents.yaml b/spec/services/metalv1/oas3.patched/paths/incidents.yaml new file mode 100644 index 00000000..f71ba426 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/incidents.yaml @@ -0,0 +1,18 @@ +get: + description: Retrieve the number of incidents. + operationId: findIncidents + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the number of incidents + tags: + - Incidents diff --git a/spec/services/metalv1/oas3.patched/paths/invitations.yaml b/spec/services/metalv1/oas3.patched/paths/invitations.yaml new file mode 100644 index 00000000..31edf02d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/invitations.yaml @@ -0,0 +1,35 @@ +get: + description: Returns all invitations in current user. + operationId: findInvitations + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + summary: Retrieve current user invitations + tags: + - Users diff --git a/spec/services/metalv1/oas3.patched/paths/invitations/id.yaml b/spec/services/metalv1/oas3.patched/paths/invitations/id.yaml new file mode 100644 index 00000000..675fb307 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/invitations/id.yaml @@ -0,0 +1,116 @@ +delete: + description: Decline an invitation. + operationId: declineInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline an invitation + tags: + - Invitations +get: + description: Returns a single invitation. (It include the `invitable` to maintain + backward compatibility but will be removed soon) + operationId: findInvitationById + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invitation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View an invitation + tags: + - Invitations +put: + description: Accept an invitation. + operationId: acceptInvitation + parameters: + - description: Invitation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept an invitation + tags: + - Invitations diff --git a/spec/services/metalv1/oas3.patched/paths/invoices/id.yaml b/spec/services/metalv1/oas3.patched/paths/invoices/id.yaml new file mode 100644 index 00000000..78152311 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/invoices/id.yaml @@ -0,0 +1,33 @@ +get: + description: Returns the invoice identified by the provided id + operationId: getInvoiceById + parameters: + - description: Invoice UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Invoice.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an invoice + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.patched/paths/ips/id.yaml b/spec/services/metalv1/oas3.patched/paths/ips/id.yaml new file mode 100644 index 00000000..db4cc052 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ips/id.yaml @@ -0,0 +1,137 @@ +delete: + description: | + This call can be used to un-assign an IP assignment or delete + an IP reservation. + + Un-assign an IP address record. + Use the assignment UUID you + get after attaching the IP. This will remove the relationship between an IP and the device or metal gateway and will make the IP address available to be assigned to another device, once the IP has been un-configured from the network. + + Delete an IP reservation. + Use the reservation UUID you get after adding the IP to the project. This will permanently delete the IP block reservation from the project. + operationId: deleteIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Unassign an ip address + tags: + - IPAddresses +get: + description: Returns a single ip address if the user has access. + operationId: findIPAddressById + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an ip address + tags: + - IPAddresses +patch: + description: Update details about an ip address + operationId: updateIPAddress + parameters: + - description: IP Address UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/IPAssignmentUpdateInput.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/IPAssignment.yaml' + - $ref: '../../components/schemas/IPReservation.yaml' + - $ref: '../../components/schemas/VrfIpReservation.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update an ip address + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.patched/paths/ips/id/available.yaml b/spec/services/metalv1/oas3.patched/paths/ips/id/available.yaml new file mode 100644 index 00000000..dcf4a6f0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ips/id/available.yaml @@ -0,0 +1,155 @@ +get: + description: Provides a list of IP resevations for a single project. + operationId: findIPAvailabilities + parameters: + - description: IP Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Size of subnets in bits + in: query + name: cidr + required: true + schema: + enum: + - "20" + - "21" + - "22" + - "23" + - "24" + - "25" + - "26" + - "27" + - "28" + - "29" + - "30" + - "31" + - "32" + - "33" + - "34" + - "35" + - "36" + - "37" + - "38" + - "39" + - "40" + - "41" + - "42" + - "43" + - "44" + - "45" + - "46" + - "47" + - "48" + - "49" + - "50" + - "51" + - "52" + - "53" + - "54" + - "55" + - "56" + - "57" + - "58" + - "59" + - "60" + - "61" + - "62" + - "63" + - "64" + - "65" + - "66" + - "67" + - "68" + - "69" + - "70" + - "71" + - "72" + - "73" + - "74" + - "75" + - "76" + - "77" + - "78" + - "79" + - "80" + - "81" + - "82" + - "83" + - "84" + - "85" + - "86" + - "87" + - "88" + - "89" + - "90" + - "91" + - "92" + - "93" + - "94" + - "95" + - "96" + - "97" + - "98" + - "99" + - "100" + - "101" + - "102" + - "103" + - "104" + - "105" + - "106" + - "107" + - "108" + - "109" + - "110" + - "111" + - "112" + - "113" + - "114" + - "115" + - "116" + - "117" + - "118" + - "119" + - "120" + - "121" + - "122" + - "123" + - "124" + - "125" + - "126" + - "127" + - "128" + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPAvailabilitiesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all available subnets of a particular reservation + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.patched/paths/ips/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/ips/id/customdata.yaml new file mode 100644 index 00000000..f44ebd3a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ips/id/customdata.yaml @@ -0,0 +1,36 @@ +get: + description: Provides the custom metadata stored for this IP Reservation or IP Assignment + in json format + operationId: findIPAddressCustomdata + parameters: + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation or IP Assignment + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.patched/paths/licenses/id.yaml b/spec/services/metalv1/oas3.patched/paths/licenses/id.yaml new file mode 100644 index 00000000..5ac742c9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/licenses/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes a license. + operationId: deleteLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the license + tags: + - Licenses +get: + description: Returns a license + operationId: findLicenseById + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a license + tags: + - Licenses +put: + description: Updates the license. + operationId: updateLicense + parameters: + - description: License UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/LicenseUpdateInput.yaml' + description: License to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/License.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the license + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.patched/paths/locations/metros.yaml b/spec/services/metalv1/oas3.patched/paths/locations/metros.yaml new file mode 100644 index 00000000..1e86e985 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/locations/metros.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available metros + operationId: findMetros + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/MetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all metros + tags: + - Metros diff --git a/spec/services/metalv1/oas3.patched/paths/locations/metros/id.yaml b/spec/services/metalv1/oas3.patched/paths/locations/metros/id.yaml new file mode 100644 index 00000000..217cc637 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/locations/metros/id.yaml @@ -0,0 +1,27 @@ +get: + description: Show the details for a metro, including name, code, and country. + operationId: getMetro + parameters: + - description: Metro UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Metro.yaml' + description: ok + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a specific Metro's details + tags: + - Metros diff --git a/spec/services/metalv1/oas3.patched/paths/market/spot/prices.yaml b/spec/services/metalv1/oas3.patched/paths/market/spot/prices.yaml new file mode 100644 index 00000000..94a2674c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/market/spot/prices.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices. + operationId: findSpotMarketPrices + parameters: + - description: Facility to check spot market prices + in: query + name: facility + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketPricesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.patched/paths/market/spot/prices/history.yaml b/spec/services/metalv1/oas3.patched/paths/market/spot/prices/history.yaml new file mode 100644 index 00000000..a0702301 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/market/spot/prices/history.yaml @@ -0,0 +1,58 @@ +get: + description: |- + Get spot market prices for a given plan and facility in a fixed period of time + + *Note: In the `200` response, the property `datapoints` contains arrays of `[float, integer]`.* + operationId: findSpotMarketPricesHistory + parameters: + - description: Facility to check spot market prices + in: query + name: facility + required: true + schema: + type: string + - description: Plan to check spot market prices + in: query + name: plan + required: true + schema: + type: string + - description: Metro to check spot market price history + in: query + name: metro + schema: + type: string + - description: Timestamp from range + in: query + name: from + required: true + schema: + type: string + - description: Timestamp to range + in: query + name: until + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotPricesHistoryReport.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get spot market prices for a given period of time + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.patched/paths/market/spot/prices/metros.yaml b/spec/services/metalv1/oas3.patched/paths/market/spot/prices/metros.yaml new file mode 100644 index 00000000..969f108e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/market/spot/prices/metros.yaml @@ -0,0 +1,36 @@ +get: + description: Get Equinix Metal current spot market prices for all metros. + operationId: findMetroSpotMarketPrices + parameters: + - description: Metro to filter spot market prices + in: query + name: metro + schema: + type: string + - description: Plan to filter spot market prices + in: query + name: plan + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SpotMarketPricesPerMetroList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get current spot market prices for metros + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.patched/paths/memberships/id.yaml b/spec/services/metalv1/oas3.patched/paths/memberships/id.yaml new file mode 100644 index 00000000..535bc738 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/memberships/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the membership. + operationId: deleteMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the membership + tags: + - Memberships +get: + description: Returns a single membership. + operationId: findMembershipById + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a membership + tags: + - Memberships +put: + description: Updates the membership. + operationId: updateMembership + parameters: + - description: Membership UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/MembershipInput.yaml' + description: Membership to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Membership.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the membership + tags: + - Memberships diff --git a/spec/services/metalv1/oas3.patched/paths/metal-gateways/id.yaml b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id.yaml new file mode 100644 index 00000000..87fd86aa --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id.yaml @@ -0,0 +1,74 @@ +delete: + description: Deletes a metal gateway and any elastic IP assignments associated with this metal gateway. + operationId: deleteMetalGateway + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + description: accepted + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Deletes the metal gateway + tags: + - MetalGateways +get: + description: Returns a specific metal gateway + operationId: findMetalGatewayById + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + oneOf: + - $ref: '../../components/schemas/MetalGateway.yaml' + - $ref: '../../components/schemas/VrfMetalGateway.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Returns the metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml new file mode 100644 index 00000000..fa11a461 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/bgp-dynamic-neighbors.yaml @@ -0,0 +1,94 @@ +post: + summary: Create a VRF BGP Dynamic Neighbor range + description: | + Create a VRF BGP Dynamic Neighbor range. + + BGP Dynamic Neighbor records are limited to 2 per Virtual Network. + + Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createBgpDynamicNeighbor + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/BgpDynamicNeighborCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighbor.yaml' + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - VRFs + +get: + description: Returns the list of VRF BGP Dynamic Neighbors for this Metal Gateway + operationId: getBgpDynamicNeighbors + summary: List BGP Dynamic Neighbors + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpDynamicNeighborList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/ips.yaml b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/ips.yaml new file mode 100644 index 00000000..78787aea --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/metal-gateways/id/ips.yaml @@ -0,0 +1,94 @@ +post: + summary: Create a Metal Gateway Elastic IP + description: | + Create a new Elastic IP on this Metal Gateway. + + Assign an IPv4 range as an elastic IP to the Metal Gateway, with a specified next-hop address contained within the Metal Gateway. + + Notice: Elastic IPs on Metal Gateways are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createMetalGatewayElasticIp + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: "../../../components/schemas/MetalGatewayElasticIpCreateInput.yaml" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignment.yaml" + description: Created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + tags: + - MetalGateways + +get: + summary: List Metal Gateway Elastic IPs + description: Returns the list of Elastic IPs assigned to this Metal Gateway + operationId: getMetalGatewayElasticIps + parameters: + - description: Metal Gateway UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: "../../../components/schemas/IPAssignmentList.yaml" + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.patched/paths/operating-system-versions.yaml b/spec/services/metalv1/oas3.patched/paths/operating-system-versions.yaml new file mode 100644 index 00000000..538b224f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/operating-system-versions.yaml @@ -0,0 +1,19 @@ +get: + description: Provides a listing of available operating system versions. + operationId: findOperatingSystemVersion + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating system versions + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.patched/paths/operating-systems.yaml b/spec/services/metalv1/oas3.patched/paths/operating-systems.yaml new file mode 100644 index 00000000..3afe2ed9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/operating-systems.yaml @@ -0,0 +1,20 @@ +get: + description: Provides a listing of available operating systems to provision your + new device with. + operationId: findOperatingSystems + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all operating systems + tags: + - OperatingSystems diff --git a/spec/services/metalv1/oas3.patched/paths/organizations.yaml b/spec/services/metalv1/oas3.patched/paths/organizations.yaml new file mode 100644 index 00000000..0a43328f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations.yaml @@ -0,0 +1,85 @@ +get: + description: Returns a list of organizations that are accessible to the current + user. + operationId: findOrganizations + parameters: + - description: Include, exclude or show only personal organizations. + in: query + name: personal + schema: + enum: + - include + - exclude + - only + type: string + - description: Include, exclude or show only organizations that have no projects. + in: query + name: without_projects + schema: + enum: + - include + - exclude + - only + type: string + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all organizations + tags: + - Organizations + x-equinix-metal-paginated-property: Organizations +post: + description: Creates an organization. + operationId: createOrganization + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/OrganizationInput.yaml' + description: Organization to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Organization.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id.yaml new file mode 100644 index 00000000..98d59577 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id.yaml @@ -0,0 +1,125 @@ +delete: + description: Deletes the organization. + operationId: deleteOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the organization + tags: + - Organizations +get: + description: Returns a single organization's details, if the user is authorized + to view it. + operationId: findOrganizationById + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve an organization's details + tags: + - Organizations +put: + description: Updates the organization. + operationId: updateOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/OrganizationInput.yaml' + description: Organization to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Organization.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity.yaml new file mode 100644 index 00000000..87b47ea6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of facilities and plans with their current capacity. + operationId: findOrganizationCapacityPerFacility + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/CapacityList.yaml' + example: + capacity: + am6: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da11: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + sv15: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Facility for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity/metros.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity/metros.yaml new file mode 100644 index 00000000..76a114cb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/capacity/metros.yaml @@ -0,0 +1,50 @@ +get: + description: Returns a list of metros and plans with their current capacity. + operationId: findOrganizationCapacityPerMetro + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/CapacityList.yaml' + example: + capacity: + am: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + da: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + dc: + "c2.medium.x86": + level: "string" + "m2.xlarge.x86": + level: "string" + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + summary: View available hardware plans per Metro for given organization + tags: + - Capacity diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/customdata.yaml new file mode 100644 index 00000000..e0a0c2b0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this organization in json format + operationId: findOrganizationCustomdata + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml new file mode 100644 index 00000000..ce90a935 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml @@ -0,0 +1,89 @@ +get: + description: Provides a collection of devices for a given organization. + operationId: findOrganizationDevices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of an organization + tags: + - Devices + x-equinix-metal-paginated-property: Devices diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml new file mode 100644 index 00000000..e184181c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml @@ -0,0 +1,44 @@ +get: + description: Returns a list of events for a single organization + operationId: findOrganizationEvents + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization's events + tags: + - Events + x-equinix-metal-paginated-property: Events diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/facilities.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/facilities.yaml new file mode 100644 index 00000000..cf47c1a4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given organization + operationId: findFacilitiesByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the organization + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/firmware-sets.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/firmware-sets.yaml new file mode 100644 index 00000000..35f49edf --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Organization's Firmware Sets + description: Returns all firmware sets associated with the organization. + operationId: getOrganizationFirmwareSets + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/invitations.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/invitations.yaml new file mode 100644 index 00000000..3897f3bd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/invitations.yaml @@ -0,0 +1,92 @@ +get: + description: Returns all invitations in an organization. + operationId: findOrganizationInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve organization invitations + tags: + - Organizations +post: + description: |- + In order to add a user to an organization, they must first be invited. + To invite to several projects the parameter `projects_ids:[a,b,c]` can be used + operationId: createOrganizationInvitation + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/invoices.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/invoices.yaml new file mode 100644 index 00000000..17cd9630 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/invoices.yaml @@ -0,0 +1,48 @@ +get: + description: Returns all invoices for an organization + operationId: findOrganizationInvoices + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: page number + in: query + name: page + schema: + type: integer + - description: per page + in: query + name: per_page + schema: + type: integer + - description: filter by status + in: query + name: status + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvoiceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all invoices for an organization + tags: + - Invoices diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/operating-systems.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/operating-systems.yaml new file mode 100644 index 00000000..edba6f62 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/operating-systems.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a listing of available operating systems for the given organization + operationId: findOperatingSystemsByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/OperatingSystemList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all operating systems visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/payment-methods.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/payment-methods.yaml new file mode 100644 index 00000000..029d3c61 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/payment-methods.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all payment methods of an organization. + operationId: findOrganizationPaymentMethods + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all payment methods of an organization + tags: + - Organizations +post: + description: Creates a payment method. + operationId: createPaymentMethod + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethodCreateInput.yaml' + description: Payment Method to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/PaymentMethod.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a payment method for the given organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/plans.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/plans.yaml new file mode 100644 index 00000000..12557edf --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given organization + operationId: findPlansByOrganization + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml new file mode 100644 index 00000000..3ccaf571 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml @@ -0,0 +1,75 @@ +get: + description: Returns a collection of projects that belong to the organization. + operationId: findOrganizationProjects + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/ProjectName.yaml' + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects of an organization + tags: + - Organizations + x-equinix-metal-paginated-property: Projects +post: + description: Creates a new project for the organization + operationId: createOrganizationProject + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectCreateInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project for the organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/transfers.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/transfers.yaml new file mode 100644 index 00000000..a24b6af1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/transfers.yaml @@ -0,0 +1,34 @@ +get: + description: Provides a collection of project transfer requests from or to the organization. + operationId: findOrganizationTransfers + parameters: + - description: Organization UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + summary: Retrieve all project transfer requests from or to an organization + tags: + - Organizations diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/organization_id/connections.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/organization_id/connections.yaml new file mode 100644 index 00000000..2f266f80 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/organizations/organization_id/connections.yaml @@ -0,0 +1,79 @@ +get: + description: List the connections belonging to the organization + operationId: organizationListInterconnections + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List organization connections + tags: + - Interconnections +post: + description: Creates a new interconnection request. A Project ID must be specified in + the request body for connections on shared ports. + operationId: createOrganizationInterconnection + parameters: + - description: UUID of the organization + in: path + name: organization_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/payment-methods/id.yaml b/spec/services/metalv1/oas3.patched/paths/payment-methods/id.yaml new file mode 100644 index 00000000..dfd41e8d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/payment-methods/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Deletes the payment method. + operationId: deletePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the payment method + tags: + - PaymentMethods +get: + description: Returns a payment method + operationId: findPaymentMethodById + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a payment method + tags: + - PaymentMethods +put: + description: Updates the payment method. + operationId: updatePaymentMethod + parameters: + - description: Payment Method UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethodUpdateInput.yaml' + description: Payment Method to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/PaymentMethod.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the payment method + tags: + - PaymentMethods diff --git a/spec/services/metalv1/oas3.patched/paths/plans.yaml b/spec/services/metalv1/oas3.patched/paths/plans.yaml new file mode 100644 index 00000000..1f04891e --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/plans.yaml @@ -0,0 +1,52 @@ +get: + description: Provides a listing of available plans to provision your device on. + operationId: findPlans + parameters: + - description: Filter plans by its category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter plans by its plan type + in: query + name: type + schema: + type: string + enum: + - standard + - workload_optimized + - custom + example: standard + - description: Filter plans by slug + in: query + name: slug + schema: + type: string + example: c3.small.x86 + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all plans + tags: + - Plans diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id.yaml new file mode 100644 index 00000000..d1785435 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id.yaml @@ -0,0 +1,34 @@ +get: + description: Returns a port + operationId: findPortById + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/assign.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/assign.yaml new file mode 100644 index 00000000..b24d19ed --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/assign.yaml @@ -0,0 +1,48 @@ +post: + description: Assign a hardware port to a virtual network. + operationId: assignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a port to virtual network + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/bond.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/bond.yaml new file mode 100644 index 00000000..2fa1326a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/bond.yaml @@ -0,0 +1,51 @@ +post: + description: Enabling bonding for one or all ports + operationId: bondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: enable both ports + in: query + name: bulk_enable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Enabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-2.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-2.yaml new file mode 100644 index 00000000..f25e6845 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-2.yaml @@ -0,0 +1,49 @@ +post: + description: Converts a bond port to Layer 2. IP assignments of the port will be + removed. + operationId: convertLayer2 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 2 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-3.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-3.yaml new file mode 100644 index 00000000..681642bb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/convert/layer-3.yaml @@ -0,0 +1,52 @@ +post: + description: Converts a bond port to Layer 3. VLANs must first be unassigned. + operationId: convertLayer3 + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortConvertLayer3Input.yaml' + description: IPs to request + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Convert to Layer 3 + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/disbond.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/disbond.yaml new file mode 100644 index 00000000..c824d4c5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/disbond.yaml @@ -0,0 +1,51 @@ +post: + description: Disabling bonding for one or all ports + operationId: disbondPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: disable both ports + in: query + name: bulk_disable + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Disabling bonding + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/native-vlan.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/native-vlan.yaml new file mode 100644 index 00000000..a23eb6fd --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/native-vlan.yaml @@ -0,0 +1,89 @@ +delete: + description: Removes the native VLAN from this port + operationId: deleteNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Remove native VLAN + tags: + - Ports +post: + description: Sets a virtual network on this port as a "native VLAN". The VLAN must + have already been assigned using the using the "Assign a port to a virtual network" + operation. + operationId: assignNativeVlan + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: 'Virtual Network ID. May be the UUID of the Virtual Network record, + or the VLAN value itself (ex: ''1001'').' + in: query + name: vnid + required: true + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Assign a native VLAN + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/unassign.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/unassign.yaml new file mode 100644 index 00000000..f115290d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/unassign.yaml @@ -0,0 +1,48 @@ +post: + description: Unassign a port for a hardware. + operationId: unassignPort + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/PortAssignInput.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Port.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Unassign a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments.yaml new file mode 100644 index 00000000..fe5e8bec --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments.yaml @@ -0,0 +1,53 @@ +get: + description: Show the port's current VLAN assignments, including if this VLAN is + set as native, and the current state of the assignment (ex. 'assigned' or 'unassigning') + operationId: findPortVlanAssignments + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PortVlanAssignmentList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List Current VLAN assignments for a port + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/assignment_id.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/assignment_id.yaml new file mode 100644 index 00000000..2c8acbce --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/assignment_id.yaml @@ -0,0 +1,60 @@ +get: + description: Show the details of a specific Port-VLAN assignment, including the + current state and if the VLAN is set as native. + operationId: findPortVlanAssignmentByPortIdAndAssignmentId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Assignment ID + in: path + name: assignment_id + required: true + schema: + format: uuid + type: string + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + default: + - port + - virtual_network + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignment.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Show a particular Port VLAN assignment's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches.yaml new file mode 100644 index 00000000..2e4b864b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches.yaml @@ -0,0 +1,95 @@ +get: + description: Show all the VLAN assignment batches that have been created for managing + this port's VLAN assignments + operationId: findPortVlanAssignmentBatches + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: List the VLAN Assignment Batches for a port + tags: + - Ports +post: + description: Create a new asynchronous batch request which handles adding and/or + removing the VLANs to which the port is assigned. + operationId: createPortVlanAssignmentBatch + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatchCreateInput.yaml' + description: VLAN Assignment batch details + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new Port-VLAN Assignment management batch + tags: + - Ports + diff --git a/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches/batch_id.yaml b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches/batch_id.yaml new file mode 100644 index 00000000..30ba91c7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ports/id/vlan-assignments/batches/batch_id.yaml @@ -0,0 +1,48 @@ +get: + description: Returns the details of an existing Port-VLAN Assignment batch, including + the list of VLANs to assign or unassign, and the current state of the batch. + operationId: findPortVlanAssignmentBatchByPortIdAndBatchId + parameters: + - description: Port UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Batch ID + in: path + name: batch_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/PortVlanAssignmentBatch.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VLAN Assignment Batch's details + tags: + - Ports diff --git a/spec/services/metalv1/oas3.patched/paths/projects.yaml b/spec/services/metalv1/oas3.patched/paths/projects.yaml new file mode 100644 index 00000000..19312f2f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects.yaml @@ -0,0 +1,63 @@ +get: + description: Returns a collection of projects that the current user is a member + of. + operationId: findProjects + parameters: + - $ref: '../components/parameters/ProjectName.yaml' + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/ProjectList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all projects + tags: + - Projects + x-equinix-metal-paginated-property: Projects +post: + description: Creates a new project for the user default organization. If the user + don't have an organization, a new one will be created. + operationId: createProject + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/ProjectCreateFromRootInput.yaml' + description: Project to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/Project.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id.yaml new file mode 100644 index 00000000..24a89814 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the project. + operationId: deleteProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the project + tags: + - Projects +get: + description: Returns a single project if the user has access + operationId: findProjectById + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a project + tags: + - Projects +put: + description: Updates the project. + operationId: updateProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/ProjectUpdateInput.yaml' + description: Project to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Project.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/api-keys.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/api-keys.yaml new file mode 100644 index 00000000..34630a7d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/api-keys.yaml @@ -0,0 +1,81 @@ +get: + description: Returns all API keys for a specific project. + operationId: findProjectAPIKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all API keys for the project. + tags: + - Authentication +post: + description: Creates an API key for a project. + operationId: createProjectAPIKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthTokenInput.yaml' + description: API Key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key for a project. + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/batches.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/batches.yaml new file mode 100644 index 00000000..017ac903 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/batches.yaml @@ -0,0 +1,40 @@ +get: + description: Returns all batches for the given project + operationId: findBatchesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BatchesList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all batches by project + tags: + - Batches diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-config.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-config.yaml new file mode 100644 index 00000000..1698a5b5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-config.yaml @@ -0,0 +1,47 @@ +get: + description: Returns a bgp config + operationId: findBgpConfigByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfig.yaml' + description: | + ok + + When BGP configuration is not enabled empty structure is returned. + When BGP configuration is disabled after being enabled BGP configuration data is returned with status disabled. + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: | + not found + + The project was not found. + summary: Retrieve a bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-configs.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-configs.yaml new file mode 100644 index 00000000..38957771 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp-configs.yaml @@ -0,0 +1,49 @@ +post: + description: Requests to enable bgp configuration for a project. + operationId: requestBgpConfig + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/BgpConfigRequestInput.yaml' + description: BGP config Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting bgp config + tags: + - BGP diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/bgp/sessions.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp/sessions.yaml new file mode 100644 index 00000000..5a7e9bcb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/bgp/sessions.yaml @@ -0,0 +1,33 @@ +get: + description: Provides a listing of available BGP sessions for the project. + operationId: findProjectBgpSessions + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BgpSessionList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all BGP sessions for project + tags: + - BGP diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/customdata.yaml new file mode 100644 index 00000000..3c665d13 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this project in json format + operationId: findProjectCustomdata + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml new file mode 100644 index 00000000..53a1b16d --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml @@ -0,0 +1,153 @@ +get: + description: Provides a collection of devices for a given project. + operationId: findProjectDevices + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/DeviceSearch.yaml' + - description: Filter by plan category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + - description: Filter by device facility + in: query + name: facility + schema: + type: string + - description: Filter by device metro + in: query + name: metro + schema: + type: string + - description: Filter by partial hostname + in: query + name: hostname + schema: + type: string + - description: Filter only reserved instances. When set to true, only include reserved instances. When set to false, only include on-demand instances. + in: query + name: reserved + schema: + type: boolean + - description: Filter by device tag + in: query + name: tag + schema: + type: string + - description: Filter by instance type (ondemand,spot,reserved) + in: query + name: type + schema: + type: string + - description: Filter only instances marked for termination. When set to true, only include instances that have a termination time. When set to false, only include instances that do not have a termination time. + in: query + name: has_termination_time + schema: + type: boolean + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/DeviceList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all devices of a project + tags: + - Devices + x-equinix-metal-paginated-property: Devices +post: + description: |- + Creates a new device and provisions it in the specified location. + + Device type-specific options are accepted. For example, `baremetal` devices accept `operating_system`, `hostname`, and `plan`. These parameters may not be accepted for other device types. The default device type is `baremetal`. + operationId: createDevice + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/DeviceCreateInMetroInput.yaml' + - $ref: '../../../components/schemas/DeviceCreateInFacilityInput.yaml' + description: Device to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Device.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a device + tags: + - Devices diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/devices/batch.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/devices/batch.yaml new file mode 100644 index 00000000..a0351123 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/devices/batch.yaml @@ -0,0 +1,53 @@ +post: + description: |- + Creates new devices in batch and provisions them in our datacenter. + operationId: createDeviceBatch + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/InstancesBatchCreateInput.yaml' + description: Batches to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/BatchesList.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a devices batch + tags: + - Batches diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml new file mode 100644 index 00000000..9c0119e2 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml @@ -0,0 +1,44 @@ +get: + description: Returns a list of events for a single project + operationId: findProjectEvents + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/EventList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project's events + tags: + - Events + x-equinix-metal-paginated-property: Events diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/facilities.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/facilities.yaml new file mode 100644 index 00000000..8c32b31b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/facilities.yaml @@ -0,0 +1,42 @@ +get: + deprecated: true + description: Returns a listing of available datacenters for the given project + operationId: findFacilitiesByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/FacilityList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all facilities visible by the project + tags: + - Facilities diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/firmware-sets.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/firmware-sets.yaml new file mode 100644 index 00000000..694e4798 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/firmware-sets.yaml @@ -0,0 +1,41 @@ +get: + tags: + - Firmware Sets + summary: Get Project's Firmware Sets + description: Returns all firmware sets associated with the project or organization. + operationId: getProjectFirmwareSets + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - name: page + in: query + description: page number to return + schema: + type: integer + - name: per_page + in: query + description: items returned per page. + schema: + type: integer + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '../../../components/schemas/FirmwareSetListResponse.yaml' + "401": + $ref: '../../../components/schemas/Error.yaml' + "404": + $ref: '../../../components/schemas/Error.yaml' + "500": + description: Internal Server Error + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/global-bgp-ranges.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/global-bgp-ranges.yaml new file mode 100644 index 00000000..1da5ddf5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/global-bgp-ranges.yaml @@ -0,0 +1,39 @@ +get: + description: Returns all global bgp ranges for a project + operationId: findGlobalBgpRanges + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/GlobalBgpRangeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all global bgp ranges + tags: + - BGP diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml new file mode 100644 index 00000000..beddc6fc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml @@ -0,0 +1,65 @@ +get: + description: Provides a collection of hardware reservations for a given project. + operationId: findProjectHardwareReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by facility code, plan name, project name, reservation short ID or device hostname + in: query + name: query + schema: + type: string + - description: Filter by hardware reservation state + in: query + name: state + schema: + enum: + - active + - spare + - need_of_service + type: string + - description: Filter hardware reservation that is provisionable + in: query + name: provisionable + schema: + enum: + - only + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/HardwareReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all hardware reservations for a given project + tags: + - HardwareReservations + x-equinix-metal-paginated-property: HardwareReservations diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/ips.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/ips.yaml new file mode 100644 index 00000000..93765eee --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/ips.yaml @@ -0,0 +1,128 @@ +get: + description: Provides a paginated list of IP reservations for a single project. + operationId: findIPReservations + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter project IP reservations by reservation type + in: query + name: types + schema: + items: + type: string + enum: + - global_ipv4 + - private_ipv4 + - public_ipv4 + - public_ipv6 + - vrf + type: array + style: form + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Items returned per page + in: query + name: per_page + schema: + default: 250 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/IPReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all ip reservations + tags: + - IPAddresses +post: + description: Request more IP space for a project in order to have additional IP + addresses to assign to devices. If the request is within the max quota, an IP + reservation will be created. If the project will exceed its IP quota, a request + will be submitted for review, and will return an IP Reservation with a `state` + of `pending`. You can automatically have the request fail with HTTP status 422 + instead of triggering the review process by providing the `fail_on_approval_required` + parameter set to `true` in the request. + operationId: requestIPReservation + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservationRequestInput.yaml' + - $ref: '../../../components/schemas/VrfIpReservationCreateInput.yaml' + description: IP Reservation Request to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/IPReservation.yaml' + - $ref: '../../../components/schemas/VrfIpReservation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Requesting IP reservations + tags: + - IPAddresses diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/licenses.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/licenses.yaml new file mode 100644 index 00000000..d70c4d49 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/licenses.yaml @@ -0,0 +1,97 @@ +get: + description: Provides a collection of licenses for a given project. + operationId: findProjectLicenses + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all licenses + tags: + - Licenses +post: + description: Creates a new license for the given project + operationId: createLicense + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/LicenseCreateInput.yaml' + description: License to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/License.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a License + tags: + - Licenses diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/plans.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/plans.yaml new file mode 100644 index 00000000..f7088cda --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/plans.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a listing of available plans for the given project + operationId: findPlansByProject + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/PlanList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all plans visible by the project + tags: + - Plans diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/spot-market-requests.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/spot-market-requests.yaml new file mode 100644 index 00000000..9452307b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/spot-market-requests.yaml @@ -0,0 +1,88 @@ +get: + description: View all spot market requests for a given project. + operationId: listSpotMarketRequests + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List spot market requests + tags: + - SpotMarket +post: + description: |- + Creates a new spot market request. + + Type-specific options (such as operating_system for baremetal devices) should be included in the main data structure alongside hostname and plan. + + The features attribute allows you to optionally specify what features your server should have. For example, if you require a server with a TPM chip, you may specify `{ "features": { "tpm": "required" } }` (or `{ "features": ["tpm"] }` in shorthand). + + The request will fail if there are no available servers matching your criteria. Alternatively, if you do not require a certain feature, but would prefer to be assigned a server with that feature if there are any available, you may specify that feature with a preferred value (see the example request below). + + The request will not fail if we have no servers with that feature in our inventory. + operationId: createSpotMarketRequest + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequestCreateInput.yaml' + description: Spot Market Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SpotMarketRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/ssh-keys.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/ssh-keys.yaml new file mode 100644 index 00000000..5aebe140 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/ssh-keys.yaml @@ -0,0 +1,74 @@ +get: + description: Returns a collection of the project's ssh keys. + operationId: findProjectSSHKeys + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Search by key, label, or fingerprint + in: query + name: query + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve a project's ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createProjectSSHKey + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKeyCreateInput.yaml' + description: ssh key to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the given project + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/transfers.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/transfers.yaml new file mode 100644 index 00000000..cf38cf5b --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/transfers.yaml @@ -0,0 +1,54 @@ +post: + deprecated: true + description: Organization owners can transfer their projects to other organizations. + operationId: createTransferRequest + parameters: + - description: UUID of the project to be transferred + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequestInput.yaml' + description: Transfer Request to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/TransferRequest.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a transfer request + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/usages.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/usages.yaml new file mode 100644 index 00000000..53d02794 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/usages.yaml @@ -0,0 +1,45 @@ +get: + description: Returns all usages for a project. + operationId: findProjectUsage + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Filter usages created after this date + in: query + name: created[after] + schema: + format: datetime + type: string + - description: Filter usages created before this date + in: query + name: created[before] + schema: + format: datetime + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/ProjectUsageList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all usages for project + tags: + - Usages diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/virtual-networks.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/virtual-networks.yaml new file mode 100644 index 00000000..d6c86c5f --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/virtual-networks.yaml @@ -0,0 +1,106 @@ +get: + description: Provides a list of virtual networks for a single project. + operationId: findVirtualNetworks + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Facility ID (uuid) or Facility Code + deprecated: true + in: query + name: facility + schema: + type: string + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all virtual networks + tags: + - VLANs +post: + description: Creates an virtual network. + operationId: createVirtualNetwork + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetworkCreateInput.yaml' + description: Virtual Network to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/VirtualNetwork.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/vrfs.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/vrfs.yaml new file mode 100644 index 00000000..426dd045 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/id/vrfs.yaml @@ -0,0 +1,88 @@ +get: + description: Returns the list of VRFs for a single project. + operationId: findVrfs + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - description: Filter by Metro ID (uuid) or Metro Code + in: query + name: metro + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRFs in the project + tags: + - VRFs +post: + description: Creates a new VRF in the specified project + operationId: createVrf + parameters: + - description: Project UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfCreateInput.yaml' + description: VRF to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Vrf.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a new VRF in the specified project + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml new file mode 100644 index 00000000..b9dda2bb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml @@ -0,0 +1,75 @@ +get: + description: List the connections belonging to the project + operationId: projectListInterconnections + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InterconnectionList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: List project connections + tags: + - Interconnections + x-equinix-metal-paginated-property: Interconnections +post: + description: Creates a new interconnection request + operationId: createProjectInterconnection + parameters: + - description: UUID of the project + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + $ref: '../../../components/requestBodies/InterconnectionCreateInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Interconnection.yaml' + description: created + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Request a new interconnection for the project's organization + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/invitations.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/invitations.yaml new file mode 100644 index 00000000..f645e882 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/invitations.yaml @@ -0,0 +1,90 @@ +get: + description: Returns all invitations in a project. + operationId: findProjectInvitations + parameters: + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/InvitationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project invitations + tags: + - Projects +post: + description: In order to add a user to a project, they must first be invited. + operationId: createProjectInvitation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + requestBody: + $ref: '../../../components/requestBodies/InvitationInput.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../../components/schemas/Invitation.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an invitation for a project + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/ips/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/ips/id/customdata.yaml new file mode 100644 index 00000000..701d7695 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/ips/id/customdata.yaml @@ -0,0 +1,43 @@ +get: + description: Provides the custom metadata stored for this IP Reservation in json + format + operationId: findIPReservationCustomdata + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Ip Reservation UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of an IP Reservation + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/memberships.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/memberships.yaml new file mode 100644 index 00000000..79362fa3 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/memberships.yaml @@ -0,0 +1,47 @@ +get: + description: Returns all memberships in a project. + operationId: findProjectMemberships + parameters: + - description: Search by member full name, id and email. + in: query + name: search + schema: + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MembershipList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve project memberships + tags: + - Projects diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml new file mode 100644 index 00000000..cd306e74 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml @@ -0,0 +1,92 @@ +get: + description: Return all metal gateways for a project + operationId: findMetalGatewaysByProject + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/MetalGatewayList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Returns all metal gateways for a project + tags: + - MetalGateways + x-equinix-metal-paginated-property: MetalGateways +post: + description: Create a metal gateway in a project + operationId: createMetalGateway + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGatewayCreateInput.yaml' + - $ref: '../../../components/schemas/VrfMetalGatewayCreateInput.yaml' + description: Metal Gateway to create + required: true + responses: + "201": + content: + application/json: + schema: + oneOf: + - $ref: '../../../components/schemas/MetalGateway.yaml' + - $ref: '../../../components/schemas/VrfMetalGateway.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a metal gateway + tags: + - MetalGateways diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations.yaml new file mode 100644 index 00000000..f3e16aa1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations.yaml @@ -0,0 +1,83 @@ +get: + description: Returns all reservations. + operationId: findSelfServiceReservations + parameters: + - $ref: '../../../../components/parameters/Page.yaml' + - $ref: '../../../../components/parameters/PerPage.yaml' + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + - description: Filter reservations by items category + in: query + name: categories + schema: + type: array + items: + type: string + enum: + - compute + - storage + - vmce + - legacy_gen + - current_gen + example: compute + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all reservations + tags: + - SelfServiceReservations +post: + description: Creates a reservation. + operationId: createSelfServiceReservation + parameters: + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '../../../../components/schemas/CreateSelfServiceReservationRequest.yaml' + description: reservation to create + required: true + responses: + "201": + content: + application/json: + schema: + $ref: '../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations/id.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations/id.yaml new file mode 100644 index 00000000..22fe23df --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/self-service/reservations/id.yaml @@ -0,0 +1,40 @@ +get: + description: Returns a reservation + operationId: findSelfServiceReservation + parameters: + - description: Reservation short_id + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Project UUID + in: path + name: project_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/SelfServiceReservationResponse.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a reservation + tags: + - SelfServiceReservations diff --git a/spec/services/metalv1/oas3.patched/paths/reset-password.yaml b/spec/services/metalv1/oas3.patched/paths/reset-password.yaml new file mode 100644 index 00000000..524c11a7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/reset-password.yaml @@ -0,0 +1,53 @@ +delete: + description: Resets current user password. + operationId: resetPassword + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/NewPassword.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Reset current user password + tags: + - PasswordResetTokens +post: + description: Creates a password reset token + operationId: createPasswordResetToken + parameters: + - description: Email of user to create password reset token + in: query + name: email + required: true + schema: + type: string + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a password reset token + tags: + - PasswordResetTokens diff --git a/spec/services/metalv1/oas3.patched/paths/routes/id.yaml b/spec/services/metalv1/oas3.patched/paths/routes/id.yaml new file mode 100644 index 00000000..c817958a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/routes/id.yaml @@ -0,0 +1,137 @@ +delete: + summary: Delete a VRF Route + description: Trigger the deletion of a VRF Route resource. The status of the route will update to 'deleting', and the route resource will remain accessible while background operations remove the route from the network. Once the route has been removed from the network, the resource will be fully deleted. + operationId: deleteVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +get: + summary: Retrieve a VRF Route + description: Returns a single VRF Route resource + operationId: findVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + tags: + - VRFs + +put: + summary: Update a VRF Route + description: Requests a VRF Route be redeployed across the network. Updating the prefix or next-hop address on a route is not currently supported. + operationId: updateVrfRouteById + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRouteUpdateInput.yaml' + required: true + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VrfRoute.yaml' + description: Accepted + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Unprocessable Entity + "429": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: Too Many Requests + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/routes/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/routes/id/events.yaml new file mode 100644 index 00000000..566282b1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/routes/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the VRF route events + operationId: findVrfRouteEvents + parameters: + - description: VRF Route UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve VRF route events + tags: + - Events diff --git a/spec/services/metalv1/oas3.patched/paths/spot-market-requests/id.yaml b/spec/services/metalv1/oas3.patched/paths/spot-market-requests/id.yaml new file mode 100644 index 00000000..4ef048ff --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/spot-market-requests/id.yaml @@ -0,0 +1,80 @@ +delete: + description: Deletes the spot market request. + operationId: deleteSpotMarketRequest + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - description: Terminate associated spot instances + in: query + name: force_termination + schema: + type: boolean + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the spot market request + tags: + - SpotMarket +get: + description: Returns a single spot market request + operationId: findSpotMarketRequestById + parameters: + - description: SpotMarketRequest UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SpotMarketRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a spot market request + tags: + - SpotMarket diff --git a/spec/services/metalv1/oas3.patched/paths/ssh-keys.yaml b/spec/services/metalv1/oas3.patched/paths/ssh-keys.yaml new file mode 100644 index 00000000..e45af1b4 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ssh-keys.yaml @@ -0,0 +1,55 @@ +get: + description: Returns a collection of the user’s ssh keys. + operationId: findSSHKeys + parameters: + - description: Search by key, label, or fingerprint + in: query + name: search + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKeyList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all ssh keys + tags: + - SSHKeys +post: + description: Creates a ssh key. + operationId: createSSHKey + requestBody: + $ref: '../components/requestBodies/SSHKeyCreateInput.yaml' + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/SSHKey.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a ssh key for the current user + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.patched/paths/ssh-keys/id.yaml b/spec/services/metalv1/oas3.patched/paths/ssh-keys/id.yaml new file mode 100644 index 00000000..5cc39162 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/ssh-keys/id.yaml @@ -0,0 +1,128 @@ +delete: + description: Deletes the ssh key. + operationId: deleteSSHKey + parameters: + - description: ssh key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the ssh key + tags: + - SSHKeys +get: + description: Returns a single ssh key if the user has access + operationId: findSSHKeyById + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a ssh key + tags: + - SSHKeys +put: + description: Updates the ssh key. + operationId: updateSSHKey + parameters: + - description: SSH Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKeyInput.yaml' + description: ssh key to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/SSHKey.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the ssh key + tags: + - SSHKeys diff --git a/spec/services/metalv1/oas3.patched/paths/support-requests.yaml b/spec/services/metalv1/oas3.patched/paths/support-requests.yaml new file mode 100644 index 00000000..45169cee --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/support-requests.yaml @@ -0,0 +1,40 @@ +post: + description: Support Ticket. + operationId: requestSuppert + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/SupportRequestInput.yaml' + description: Support Request to create + required: true + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create a support ticket + tags: + - SupportRequest diff --git a/spec/services/metalv1/oas3.patched/paths/transfers/id.yaml b/spec/services/metalv1/oas3.patched/paths/transfers/id.yaml new file mode 100644 index 00000000..e9ea5bdb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/transfers/id.yaml @@ -0,0 +1,110 @@ +delete: + description: Decline a transfer request. + operationId: declineTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Decline a transfer request + tags: + - TransferRequests +get: + description: Returns a single transfer request. + operationId: findTransferRequestById + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/TransferRequest.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: View a transfer request + tags: + - TransferRequests +put: + description: Accept a transfer request. + operationId: acceptTransferRequest + parameters: + - description: Transfer request UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Accept a transfer request + tags: + - TransferRequests diff --git a/spec/services/metalv1/oas3.patched/paths/user.yaml b/spec/services/metalv1/oas3.patched/paths/user.yaml new file mode 100644 index 00000000..bb9f08d1 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user.yaml @@ -0,0 +1,57 @@ +get: + description: Returns the user object for the currently logged-in user. + operationId: findCurrentUser + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve the current user + tags: + - Users +put: + description: Updates the currently logged-in user. + operationId: updateCurrentUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserUpdateInput.yaml' + description: User to update + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the current user + tags: + - Users diff --git a/spec/services/metalv1/oas3.patched/paths/user/api-keys.yaml b/spec/services/metalv1/oas3.patched/paths/user/api-keys.yaml new file mode 100644 index 00000000..06f1a274 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/api-keys.yaml @@ -0,0 +1,72 @@ +post: + description: Creates a API key for the current user. + operationId: createAPIKey + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenInput.yaml' + description: API key to create + required: true + parameters: + - $ref: '../../components/parameters/Include.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthToken.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an API key + tags: + - Authentication +get: + description: Returns all API keys for the current user. + operationId: findAPIKeys + parameters: + - description: Search by description + in: query + name: search + schema: + type: string + - $ref: '../../components/parameters/Include.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/AuthTokenList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all user API keys + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.patched/paths/user/api-keys/id.yaml b/spec/services/metalv1/oas3.patched/paths/user/api-keys/id.yaml new file mode 100644 index 00000000..59edb412 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/api-keys/id.yaml @@ -0,0 +1,29 @@ +delete: + description: Deletes the current user API key. + operationId: deleteUserAPIKey + parameters: + - description: API Key UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Delete the API key + tags: + - Authentication diff --git a/spec/services/metalv1/oas3.patched/paths/user/otp/app.yaml b/spec/services/metalv1/oas3.patched/paths/user/otp/app.yaml new file mode 100644 index 00000000..ac3f4be6 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/otp/app.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaApp + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication using authenticator app. + operationId: enableTfaApp + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using app + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.patched/paths/user/otp/recovery-codes.yaml b/spec/services/metalv1/oas3.patched/paths/user/otp/recovery-codes.yaml new file mode 100644 index 00000000..b0f88de7 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/otp/recovery-codes.yaml @@ -0,0 +1,62 @@ +get: + description: Returns my recovery codes. + operationId: findRecoveryCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Retrieve my recovery codes + tags: + - OTPs +post: + description: Generate a new set of recovery codes. + operationId: regenerateCodes + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/RecoveryCodeList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Generate new recovery codes + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.patched/paths/user/otp/sms.yaml b/spec/services/metalv1/oas3.patched/paths/user/otp/sms.yaml new file mode 100644 index 00000000..d7b17f74 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/otp/sms.yaml @@ -0,0 +1,36 @@ +delete: + description: Disables two factor authentication. + operationId: disableTfaSms + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Disable two factor authentication + tags: + - TwoFactorAuth +post: + description: Enables two factor authentication with sms. + operationId: enableTfaSms + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + summary: Enable two factor auth using sms + tags: + - TwoFactorAuth diff --git a/spec/services/metalv1/oas3.patched/paths/user/otp/sms/receive.yaml b/spec/services/metalv1/oas3.patched/paths/user/otp/sms/receive.yaml new file mode 100644 index 00000000..c2bea8dc --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/otp/sms/receive.yaml @@ -0,0 +1,33 @@ +post: + description: Sends an OTP to the user's mobile phone. + operationId: receiveCodes + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unprocessable entity + "500": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: internal server error + summary: Receive an OTP per sms + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.patched/paths/user/otp/verify/otp.yaml b/spec/services/metalv1/oas3.patched/paths/user/otp/verify/otp.yaml new file mode 100644 index 00000000..750dc153 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/user/otp/verify/otp.yaml @@ -0,0 +1,29 @@ +post: + description: It verifies the user once a valid OTP is provided. It gives back a + session token, essentially logging in the user. + operationId: findEnsureOtp + parameters: + - description: OTP + in: path + name: otp + required: true + schema: + type: string + responses: + "204": + description: no content + "400": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: bad request + "401": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: unauthorized + summary: Verify user by providing an OTP + tags: + - OTPs diff --git a/spec/services/metalv1/oas3.patched/paths/userdata/validate.yaml b/spec/services/metalv1/oas3.patched/paths/userdata/validate.yaml new file mode 100644 index 00000000..6a952f3c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/userdata/validate.yaml @@ -0,0 +1,27 @@ +post: + description: Validates user data (Userdata) + operationId: validateUserdata + parameters: + - description: Userdata to validate + in: query + name: userdata + schema: + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Validate user data + tags: + - Userdata diff --git a/spec/services/metalv1/oas3.patched/paths/users.yaml b/spec/services/metalv1/oas3.patched/paths/users.yaml new file mode 100644 index 00000000..6add348a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/users.yaml @@ -0,0 +1,64 @@ +get: + description: Returns a list of users that the are accessible to the current user + (all users in the current user’s projects, essentially). + operationId: findUsers + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + - $ref: '../components/parameters/Page.yaml' + - $ref: '../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../components/schemas/UserList.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + summary: Retrieve all users + tags: + - Users + x-equinix-metal-paginated-property: Users +post: + description: Creates a user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/UserCreateInput.yaml' + description: User to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + - $ref: '../components/parameters/Exclude.yaml' + responses: + "201": + content: + application/json: + schema: + $ref: '../components/schemas/User.yaml' + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + example: + errors: + - "Email address username@example.com has already been taken" + description: unprocessable entity + summary: Create a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.patched/paths/users/id.yaml b/spec/services/metalv1/oas3.patched/paths/users/id.yaml new file mode 100644 index 00000000..4e4c8a08 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/users/id.yaml @@ -0,0 +1,41 @@ +get: + description: Returns a single user if the user has access + operationId: findUserById + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/User.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.patched/paths/users/id/customdata.yaml b/spec/services/metalv1/oas3.patched/paths/users/id/customdata.yaml new file mode 100644 index 00000000..8ba9eabb --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/users/id/customdata.yaml @@ -0,0 +1,35 @@ +get: + description: Provides the custom metadata stored for this user in json format + operationId: findUserCustomdata + parameters: + - description: User UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve the custom metadata of a user + tags: + - Users diff --git a/spec/services/metalv1/oas3.patched/paths/verify-email.yaml b/spec/services/metalv1/oas3.patched/paths/verify-email.yaml new file mode 100644 index 00000000..a0d9e02c --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/verify-email.yaml @@ -0,0 +1,60 @@ +post: + description: Creates an email verification request + operationId: createValidationRequest + parameters: + - description: Email for verification request + in: query + name: login + required: true + schema: + type: string + - $ref: '../components/parameters/Include.yaml' + responses: + "201": + description: created + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Create an email verification request + tags: + - UserVerificationTokens +put: + description: Consumes an email verification token and verifies the user associated + with it. + operationId: consumeVerificationRequest + requestBody: + content: + application/json: + schema: + $ref: '../components/schemas/VerifyEmail.yaml' + description: Email to create + required: true + parameters: + - $ref: '../components/parameters/Include.yaml' + responses: + "200": + description: ok + "401": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unauthorized + "422": + content: + application/json: + schema: + $ref: '../components/schemas/Error.yaml' + description: unprocessable entity + summary: Verify a user using an email verification token + tags: + - UserVerificationTokens diff --git a/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id.yaml b/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id.yaml new file mode 100644 index 00000000..01a6b0a5 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id.yaml @@ -0,0 +1,118 @@ +delete: + description: Delete a virtual circuit from a Dedicated Port. + operationId: deleteVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete a virtual circuit + tags: + - Interconnections +get: + description: Get the details of a virtual circuit + operationId: getVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Get a virtual circuit + tags: + - Interconnections +put: + description: Update the details of a virtual circuit. + operationId: updateVirtualCircuit + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuitUpdateInput.yaml' + description: Updated Virtual Circuit details + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: ok + "202": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualCircuit.yaml' + description: accepted + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Update a virtual circuit + tags: + - Interconnections diff --git a/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id/events.yaml new file mode 100644 index 00000000..f255c449 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/virtual-circuits/id/events.yaml @@ -0,0 +1,43 @@ +get: + description: Returns a list of the virtual circuit events + operationId: findVirtualCircuitEvents + parameters: + - description: Virtual Circuit UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + - $ref: '../../../components/parameters/Page.yaml' + - $ref: '../../../components/parameters/PerPage.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/Event.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve virtual circuit events + tags: + - Events diff --git a/spec/services/metalv1/oas3.patched/paths/virtual-networks/id.yaml b/spec/services/metalv1/oas3.patched/paths/virtual-networks/id.yaml new file mode 100644 index 00000000..381d1a74 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/virtual-networks/id.yaml @@ -0,0 +1,94 @@ +delete: + description: Deletes a virtual network. + operationId: deleteVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Delete a virtual network + tags: + - VLANs +get: + description: Get a virtual network. + operationId: getVirtualNetwork + parameters: + - description: Virtual Network UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/VirtualNetwork.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Get a virtual network + tags: + - VLANs diff --git a/spec/services/metalv1/oas3.patched/paths/vrfs/id.yaml b/spec/services/metalv1/oas3.patched/paths/vrfs/id.yaml new file mode 100644 index 00000000..98e76b4a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/vrfs/id.yaml @@ -0,0 +1,130 @@ +delete: + description: Deletes the VRF + operationId: deleteVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + responses: + "204": + description: no content + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Delete the VRF + tags: + - VRFs +get: + description: Returns a single VRF resource + operationId: findVrfById + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + summary: Retrieve a VRF + tags: + - VRFs +put: + description: Updates the VRF. + operationId: updateVrf + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../components/parameters/Include.yaml' + - $ref: '../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../components/schemas/VrfUpdateInput.yaml' + description: VRF to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../components/schemas/Vrf.yaml' + description: ok + "401": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unauthorized + "403": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: not found + "422": + content: + application/json: + schema: + $ref: '../../components/schemas/Error.yaml' + description: unprocessable entity + summary: Update the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/vrfs/id/ips.yaml b/spec/services/metalv1/oas3.patched/paths/vrfs/id/ips.yaml new file mode 100644 index 00000000..1a36ebd9 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/vrfs/id/ips.yaml @@ -0,0 +1,53 @@ +get: + description: Returns the list of VRF IP Reservations for the VRF. + operationId: findVrfIpReservations + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfIpReservationList.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/vrfs/id/routes.yaml b/spec/services/metalv1/oas3.patched/paths/vrfs/id/routes.yaml new file mode 100644 index 00000000..35ad02f0 --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/vrfs/id/routes.yaml @@ -0,0 +1,92 @@ +post: + description: | + Create a route in a VRF. Currently only static default routes are supported. + + Notice: VRFs are a test feature currently under active development, and only available to certain users. Please contact Customer Success for more information. + operationId: createVrfRoute + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + format: uuid + type: string + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + requestBody: + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteCreateInput.yaml' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRoute.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + "422": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unprocessable entity + summary: Create a VRF route + tags: + - VRFs + +get: + description: Returns the list of routes for the VRF + operationId: getVrfRoutes + parameters: + - description: VRF UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - $ref: '../../../components/parameters/Include.yaml' + - $ref: '../../../components/parameters/Exclude.yaml' + responses: + "200": + content: + application/json: + schema: + $ref: '../../../components/schemas/VrfRouteList.yaml' + description: OK + "401": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Unauthorized + "404": + content: + application/json: + schema: + $ref: '../../../components/schemas/Error.yaml' + description: Not Found + summary: Retrieve all routes in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/oas3.patched/paths/vrfs/vrf_id/ips/id.yaml b/spec/services/metalv1/oas3.patched/paths/vrfs/vrf_id/ips/id.yaml new file mode 100644 index 00000000..98c2e06a --- /dev/null +++ b/spec/services/metalv1/oas3.patched/paths/vrfs/vrf_id/ips/id.yaml @@ -0,0 +1,60 @@ +get: + description: Returns the IP Reservation for the VRF. + operationId: findVrfIpReservation + parameters: + - description: VRF UUID + in: path + name: vrf_id + required: true + schema: + type: string + format: uuid + - description: IP UUID + in: path + name: id + required: true + schema: + type: string + format: uuid + - description: Nested attributes to include. Included objects will return their + full attributes. Attribute names can be dotted (up to 3 levels) to included + deeply nested objects. + in: query + name: include + schema: + items: + type: string + type: array + style: form + - description: Nested attributes to exclude. Excluded objects will return only the + href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply + nested objects. + in: query + name: exclude + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '../../../../components/schemas/VrfIpReservation.yaml' + description: ok + "403": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: forbidden + "404": + content: + application/json: + schema: + $ref: '../../../../components/schemas/Error.yaml' + description: not found + summary: Retrieve all VRF IP Reservations in the VRF + tags: + - VRFs diff --git a/spec/services/metalv1/patches/.keep b/spec/services/metalv1/patches/.keep new file mode 100644 index 00000000..e69de29b diff --git a/spec/services/metalv1/patches/20230224-device-models-instead-of-href.patch b/spec/services/metalv1/patches/20230224-device-models-instead-of-href.patch new file mode 100644 index 00000000..d0783945 --- /dev/null +++ b/spec/services/metalv1/patches/20230224-device-models-instead-of-href.patch @@ -0,0 +1,37 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml +index 4e0cc1c..f6981ef 100644 +--- a/spec/oas3.patched/components/schemas/Device.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/Device.yaml +@@ -21,7 +21,7 @@ properties: + facility: + $ref: './Facility.yaml' + hardware_reservation: +- $ref: './Href.yaml' ++ $ref: './HardwareReservation.yaml' + hostname: + type: string + href: +@@ -70,9 +70,7 @@ properties: + plan: + $ref: './Plan.yaml' + project: +- allOf: +- - $ref: './Href.yaml' +- - description: Full version of project object when included ++ $ref: './Project.yaml' + project_lite: + allOf: + - $ref: './Href.yaml' +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml +index d61b8f6..b962756 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/Project.yaml +@@ -10,6 +10,8 @@ properties: + items: + $ref: './Href.yaml' + type: array ++ href: ++ type: string + id: + format: uuid + type: string diff --git a/spec/services/metalv1/patches/20230324-remove-single-facility-input.patch b/spec/services/metalv1/patches/20230324-remove-single-facility-input.patch new file mode 100644 index 00000000..57ea7142 --- /dev/null +++ b/spec/services/metalv1/patches/20230324-remove-single-facility-input.patch @@ -0,0 +1,20 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml b/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml +index 3e60212..9c53880 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/FacilityInput.yaml +@@ -10,10 +10,7 @@ properties: + The API will accept either a single facility `{ "facility": "f1" }`, or it can be instructed to create the device in the best available datacenter `{ "facility": "any" }`. + + Additionally it is possible to set a prioritized location selection. For example `{ "facility": ["f3", "f2", "any"] }` can be used to prioritize `f3` and then `f2` before accepting `any` facility. If none of the facilities provided have availability for the requested device the request will fail. +- anyOf: +- - type: array +- items: +- type: string +- example: ["sv15"] +- - type: string +- example: "any" +\ No newline at end of file ++ type: array ++ items: ++ type: string ++ example: ["sv15"] diff --git a/spec/services/metalv1/patches/20230801-added-pro-created-at-in-virtual-network.patch b/spec/services/metalv1/patches/20230801-added-pro-created-at-in-virtual-network.patch new file mode 100644 index 00000000..29179c5e --- /dev/null +++ b/spec/services/metalv1/patches/20230801-added-pro-created-at-in-virtual-network.patch @@ -0,0 +1,14 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml +index cb0c698..bae14ae 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/VirtualNetwork.yaml +@@ -11,6 +11,9 @@ properties: + $ref: './Href.yaml' + href: + type: string ++ created_at: ++ format: date-time ++ type: string + id: + format: uuid + type: string diff --git a/spec/services/metalv1/patches/20230921-plan-drive-type.patch b/spec/services/metalv1/patches/20230921-plan-drive-type.patch new file mode 100644 index 00000000..6e599194 --- /dev/null +++ b/spec/services/metalv1/patches/20230921-plan-drive-type.patch @@ -0,0 +1,26 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml b/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml +index 0b5f1d5..c9602d0 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/Plan.yaml +@@ -94,10 +94,6 @@ properties: + type: integer + type: + type: string +- enum: +- - HDD +- - SSD +- - NVME + size: + type: string + example: 3.84TB +@@ -117,10 +113,6 @@ properties: + example: 2 + type: + type: string +- enum: +- - 1Gbps +- - 10Gbps +- - 25Gbps + features: + type: object + properties: diff --git a/spec/services/metalv1/patches/20230925-x-equinix-metal-paginated-property.patch b/spec/services/metalv1/patches/20230925-x-equinix-metal-paginated-property.patch new file mode 100644 index 00000000..d8032af8 --- /dev/null +++ b/spec/services/metalv1/patches/20230925-x-equinix-metal-paginated-property.patch @@ -0,0 +1,147 @@ +diff --git a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml +index 8d2121b..e797a39 100644 +--- a/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/connections/connection_id/events.yaml +@@ -41,3 +41,4 @@ get: + summary: Retrieve interconnection events + tags: + - Events ++ x-equinix-metal-paginated-property: Events +diff --git a/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml +index 62a179c..470b51e 100644 +--- a/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/devices/id/events.yaml +@@ -41,3 +41,4 @@ get: + summary: Retrieve device's events + tags: + - Events ++ x-equinix-metal-paginated-property: Events +diff --git a/spec/services/metalv1/oas3.patched/paths/events.yaml b/spec/services/metalv1/oas3.patched/paths/events.yaml +index 6e5042d..7efcc87 100644 +--- a/spec/services/metalv1/oas3.patched/paths/events.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/events.yaml +@@ -22,3 +22,4 @@ get: + summary: Retrieve current user's events + tags: + - Events ++ x-equinix-metal-paginated-property: Events +diff --git a/spec/services/metalv1/oas3.patched/paths/organizations.yaml b/spec/services/metalv1/oas3.patched/paths/organizations.yaml +index 0a21aaf..0a43328 100644 +--- a/spec/services/metalv1/oas3.patched/paths/organizations.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/organizations.yaml +@@ -41,6 +41,7 @@ get: + summary: Retrieve all organizations + tags: + - Organizations ++ x-equinix-metal-paginated-property: Organizations + post: + description: Creates an organization. + operationId: createOrganization +diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml +index 9309843..709f1c1 100644 +--- a/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/devices.yaml +@@ -83,3 +86,4 @@ get: + summary: Retrieve all devices of an organization + tags: + - Devices ++ x-equinix-metal-paginated-property: Devices +diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml +index cd713da..e184181 100644 +--- a/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/events.yaml +@@ -41,3 +41,4 @@ get: + summary: Retrieve organization's events + tags: + - Events ++ x-equinix-metal-paginated-property: Events +diff --git a/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml b/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml +index 004a17e..3ccaf57 100644 +--- a/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/organizations/id/projects.yaml +@@ -30,6 +30,7 @@ get: + summary: Retrieve all projects of an organization + tags: + - Organizations ++ x-equinix-metal-paginated-property: Projects + post: + description: Creates a new project for the organization + operationId: createOrganizationProject +diff --git a/spec/services/metalv1/oas3.patched/paths/projects.yaml b/spec/services/metalv1/oas3.patched/paths/projects.yaml +index e9c147a..19312f2 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects.yaml +@@ -24,6 +24,7 @@ get: + summary: Retrieve all projects + tags: + - Projects ++ x-equinix-metal-paginated-property: Projects + post: + description: Creates a new project for the user default organization. If the user + don't have an organization, a new one will be created. +diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml +index c939c98..836099e 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects/id/devices.yaml +@@ -83,6 +86,7 @@ get: + summary: Retrieve all devices of a project + tags: + - Devices ++ x-equinix-metal-paginated-property: Devices + post: + description: |- + Creates a new device and provisions it in the specified location. +diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml +index 233f1f9..9c0119e 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects/id/events.yaml +@@ -41,3 +41,4 @@ get: + summary: Retrieve project's events + tags: + - Events ++ x-equinix-metal-paginated-property: Events +diff --git a/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml b/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml +index 5d95c14..37d7935 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects/id/hardware-reservations.yaml +@@ -62,3 +63,4 @@ get: + summary: Retrieve all hardware reservations for a given project + tags: + - HardwareReservations ++ x-equinix-metal-paginated-property: HardwareReservations +diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml +index f00ac06..b9dda2b 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/connections.yaml +@@ -35,6 +35,7 @@ get: + summary: List project connections + tags: + - Interconnections ++ x-equinix-metal-paginated-property: Interconnections + post: + description: Creates a new interconnection request + operationId: createProjectInterconnection +diff --git a/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml b/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml +index 3ab78d3..cd306e7 100644 +--- a/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/projects/project_id/metal-gateways.yaml +@@ -35,6 +35,7 @@ get: + summary: Returns all metal gateways for a project + tags: + - MetalGateways ++ x-equinix-metal-paginated-property: MetalGateways + post: + description: Create a metal gateway in a project + operationId: createMetalGateway +diff --git a/spec/services/metalv1/oas3.patched/paths/users.yaml b/spec/services/metalv1/oas3.patched/paths/users.yaml +index ce1b579..b9e6977 100644 +--- a/spec/services/metalv1/oas3.patched/paths/users.yaml ++++ b/spec/services/metalv1/oas3.patched/paths/users.yaml +@@ -23,6 +23,7 @@ get: + summary: Retrieve all users + tags: + - Users ++ x-equinix-metal-paginated-property: Users + post: + description: Creates a user. + operationId: createUser diff --git a/spec/services/metalv1/patches/20230926-added-pro-type-in-ipassignments.patch b/spec/services/metalv1/patches/20230926-added-pro-type-in-ipassignments.patch new file mode 100644 index 00000000..67c330a5 --- /dev/null +++ b/spec/services/metalv1/patches/20230926-added-pro-type-in-ipassignments.patch @@ -0,0 +1,13 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml +index efce269..46f9abc 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/IPAssignment.yaml +@@ -54,4 +54,8 @@ properties: + Only set when this is a Metal Gateway Elastic IP Assignment. + + The IP address within the Metal Gateway to which requests to the Elastic IP are forwarded. ++ type: ++ type: string ++ enum: ++ - IPAssignment + type: object diff --git a/spec/services/metalv1/patches/20231206-remove-bgp-session.patch b/spec/services/metalv1/patches/20231206-remove-bgp-session.patch new file mode 100644 index 00000000..c4254708 --- /dev/null +++ b/spec/services/metalv1/patches/20231206-remove-bgp-session.patch @@ -0,0 +1,15 @@ +diff --git a/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml b/spec/oas3.patched/components/schemas/BgpSession.yaml +index db8baf8..50bcc22 100644 +--- a/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml ++++ b/spec/services/metalv1/oas3.patched/components/schemas/BgpSession.yaml +@@ -28,10 +28,6 @@ properties: + status will start with "unknown" and progress to "up" or "down" depending on + the connected device. Subsequent "unknown" values indicate a problem acquiring + status from the switch. ' +- enum: +- - unknown +- - up +- - down + type: string + updated_at: + format: date-time diff --git a/templates/services/metalv1/.keep b/templates/services/metalv1/.keep new file mode 100644 index 00000000..e69de29b diff --git a/templates/services/metalv1/api.mustache b/templates/services/metalv1/api.mustache new file mode 100644 index 00000000..3bcc75d2 --- /dev/null +++ b/templates/services/metalv1/api.mustache @@ -0,0 +1,473 @@ +{{>partial_header}} +package {{packageName}} + +{{#operations}} +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +{{#imports}} "{{import}}" +{{/imports}} +) + +{{#generateInterfaces}} + +type {{classname}} interface { + {{#operation}} + + /* + {{operationId}} {{{summary}}}{{^summary}}Method for {{operationId}}{{/summary}} + {{#notes}} + + {{{unescapedNotes}}} + {{/notes}} + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} + @return {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request + {{#isDeprecated}} + + Deprecated + {{/isDeprecated}} + */ + {{{nickname}}}(ctx context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request + + // {{nickname}}Execute executes the request{{#returnType}} + // @return {{{.}}}{{/returnType}} + {{#isDeprecated}} + // Deprecated + {{/isDeprecated}} + {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}{{^isResponseFile}}*{{/isResponseFile}}{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) + {{/operation}} +} +{{/generateInterfaces}} + +// {{classname}}Service {{classname}} service +type {{classname}}Service service +{{#operation}} + +type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request struct { + ctx context.Context{{#generateInterfaces}} + ApiService {{classname}} +{{/generateInterfaces}}{{^generateInterfaces}} + ApiService *{{classname}}Service +{{/generateInterfaces}} +{{#allParams}} + {{paramName}} {{^isPathParam}}{{^isFile}}*{{/isFile}}{{/isPathParam}}{{{dataType}}} +{{/allParams}} +} + +{{#allParams}} +{{^isPathParam}} +{{#description}} +// {{.}} +{{/description}} +{{#isDeprecated}} +// Deprecated +{{/isDeprecated}} +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request) {{vendorExtensions.x-export-param-name}}({{paramName}} {{{dataType}}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request { + r.{{paramName}} = {{^isFile}}&{{/isFile}}{{paramName}} + return r +} + +{{/isPathParam}} +{{/allParams}} +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request) Execute() ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}{{^isResponseFile}}*{{/isResponseFile}}{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) { + return r.ApiService.{{nickname}}Execute(r) +} + +/* +{{operationId}} {{{summary}}}{{^summary}}Method for {{operationId}}{{/summary}} +{{#notes}} + +{{{unescapedNotes}}} +{{/notes}} + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().{{#pathParams}} + @param {{paramName}}{{#description}} {{{.}}}{{/description}}{{/pathParams}} + @return {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request +{{#isDeprecated}} + +Deprecated +{{/isDeprecated}} +*/ +func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#pathParams}}, {{paramName}} {{{dataType}}}{{/pathParams}}) {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request { + return {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request{ + ApiService: a, + ctx: ctx, + {{#pathParams}} + {{paramName}}: {{paramName}}, + {{/pathParams}} + } +} + +// Execute executes the request{{#returnType}} +// @return {{{.}}}{{/returnType}} +{{#isDeprecated}} +// Deprecated +{{/isDeprecated}} +func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}{{^isResponseFile}}*{{/isResponseFile}}{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}*http.Response, error) { + var ( + localVarHTTPMethod = http.Method{{httpMethod}} + localVarPostBody interface{} + formFiles []formFile + {{#returnType}} + localVarReturnValue {{^isArray}}{{^returnTypeIsPrimitive}}{{^isResponseFile}}*{{/isResponseFile}}{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}} + {{/returnType}} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}") + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "{{{path}}}"{{#pathParams}} + localVarPath = strings.Replace(localVarPath, "{"+"{{{baseName}}}"+"}", url.PathEscape(parameterValueToString(r.{{paramName}}, "{{paramName}}")), -1){{/pathParams}} + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + {{#allParams}} + {{#required}} + {{^isPathParam}} + if r.{{paramName}} == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} is required and must be specified") + } + {{/isPathParam}} + {{#minItems}} + if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minItems}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minItems}} elements") + } + {{/minItems}} + {{#maxItems}} + if len({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxItems}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxItems}} elements") + } + {{/maxItems}} + {{#minLength}} + if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) < {{minLength}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have at least {{minLength}} elements") + } + {{/minLength}} + {{#maxLength}} + if strlen({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) > {{maxLength}} { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must have less than {{maxLength}} elements") + } + {{/maxLength}} + {{#minimum}} + {{#isString}} + {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) + if {{paramName}}Txt < {{minimum}} { + {{/isString}} + {{^isString}} + if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} < {{minimum}} { + {{/isString}} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be greater than {{minimum}}") + } + {{/minimum}} + {{#maximum}} + {{#isString}} + {{paramName}}Txt, err := atoi({{^isPathParam}}*{{/isPathParam}}r.{{paramName}}) + if {{paramName}}Txt > {{maximum}} { + {{/isString}} + {{^isString}} + if {{^isPathParam}}*{{/isPathParam}}r.{{paramName}} > {{maximum}} { + {{/isString}} + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, reportError("{{paramName}} must be less than {{maximum}}") + } + {{/maximum}} + {{/required}} + {{/allParams}} + + {{#queryParams}} + {{#required}} + {{#isCollectionFormatMulti}} + { + t := *r.{{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", s.Index(i).Interface(), "{{collectionFormat}}") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", t, "{{collectionFormat}}") + } + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") + {{/isCollectionFormatMulti}} + {{/required}} + {{^required}} + if r.{{paramName}} != nil { + {{#isCollectionFormatMulti}} + t := *r.{{paramName}} + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", s.Index(i).Interface(), "{{collectionFormat}}") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", t, "{{collectionFormat}}") + } + {{/isCollectionFormatMulti}} + {{^isCollectionFormatMulti}} + parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") + {{/isCollectionFormatMulti}} + } + {{/required}} + {{/queryParams}} + // to determine the Content-Type header +{{=<% %>=}} + localVarHTTPContentTypes := []string{<%#consumes%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/consumes%>} +<%={{ }}=%> + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header +{{=<% %>=}} + localVarHTTPHeaderAccepts := []string{<%#produces%>"<%&mediaType%>"<%^-last%>, <%/-last%><%/produces%>} +<%={{ }}=%> + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } +{{#headerParams}} + {{#required}} + parameterAddToHeaderOrQuery(localVarHeaderParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") + {{/required}} + {{^required}} + if r.{{paramName}} != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") + } + {{/required}} +{{/headerParams}} +{{#formParams}} +{{#isFile}} +{{#isArray}} + var {{paramName}}LocalVarFormFileName string + var {{paramName}}LocalVarFileName string + var {{paramName}}LocalVarFileBytes []byte + + {{paramName}}LocalVarFormFileName = "{{{baseName}}}" + {{paramName}}LocalVarFile := r.{{paramName}} + + if {{paramName}}LocalVarFile != nil { + // loop through the array to prepare multiple files upload + for _, {{paramName}}LocalVarFileValue := range {{paramName}}LocalVarFile { + fbs, _ := io.ReadAll({{paramName}}LocalVarFileValue) + + {{paramName}}LocalVarFileBytes = fbs + {{paramName}}LocalVarFileName = {{paramName}}LocalVarFileValue.Name() + {{paramName}}LocalVarFileValue.Close() + formFiles = append(formFiles, formFile{fileBytes: {{paramName}}LocalVarFileBytes, fileName: {{paramName}}LocalVarFileName, formFileName: {{paramName}}LocalVarFormFileName}) + } + } +{{/isArray}} +{{^isArray}} + var {{paramName}}LocalVarFormFileName string + var {{paramName}}LocalVarFileName string + var {{paramName}}LocalVarFileBytes []byte + + {{paramName}}LocalVarFormFileName = "{{{baseName}}}" + {{paramName}}LocalVarFile := r.{{paramName}} + + if {{paramName}}LocalVarFile != nil { + fbs, _ := io.ReadAll({{paramName}}LocalVarFile) + + {{paramName}}LocalVarFileBytes = fbs + {{paramName}}LocalVarFileName = {{paramName}}LocalVarFile.Name() + {{paramName}}LocalVarFile.Close() + formFiles = append(formFiles, formFile{fileBytes: {{paramName}}LocalVarFileBytes, fileName: {{paramName}}LocalVarFileName, formFileName: {{paramName}}LocalVarFormFileName}) + } +{{/isArray}} +{{/isFile}} +{{^isFile}} +{{#required}} + parameterAddToHeaderOrQuery(localVarFormParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") +{{/required}} +{{^required}} +{{#isModel}} + if r.{{paramName}} != nil { + paramJson, err := parameterToJson(*r.{{paramName}}) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + } + localVarFormParams.Add("{{{baseName}}}", paramJson) + } +{{/isModel}} +{{^isModel}} + if r.{{paramName}} != nil { + parameterAddToHeaderOrQuery(localVarFormParams, "{{{baseName}}}", r.{{paramName}}, "{{collectionFormat}}") + } +{{/isModel}} +{{/required}} +{{/isFile}} +{{/formParams}} +{{#bodyParams}} + // body params + localVarPostBody = r.{{paramName}} +{{/bodyParams}} +{{#authMethods}} +{{#isApiKey}} +{{^isKeyInCookie}} + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + {{#vendorExtensions.x-auth-id-alias}} + if apiKey, ok := auth["{{.}}"]; ok { + var key string + if prefix, ok := auth["{{name}}"]; ok && prefix.Prefix != "" { + key = prefix.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + {{/vendorExtensions.x-auth-id-alias}} + {{^vendorExtensions.x-auth-id-alias}} + if apiKey, ok := auth["{{name}}"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + {{/vendorExtensions.x-auth-id-alias}} + {{#isKeyInHeader}} + localVarHeaderParams["{{keyParamName}}"] = key + {{/isKeyInHeader}} + {{#isKeyInQuery}} + localVarQueryParams.Add("{{keyParamName}}", key) + {{/isKeyInQuery}} + } + } + } +{{/isKeyInCookie}} +{{/isApiKey}} +{{/authMethods}} + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + } + +{{#withCustomMiddlewareFunction}} + if a.client.cfg.ResponseMiddleware != nil { + err = a.client.cfg.ResponseMiddleware(localVarHTTPResponse, localVarBody) + if err != nil { + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, err + } + } + +{{/withCustomMiddlewareFunction}} + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + {{#responses}} + {{#dataType}} + {{^is1xx}} + {{^is2xx}} + {{#range}} + {{#is3xx}} + if localVarHTTPResponse.StatusCode >= 300 && localVarHTTPResponse.StatusCode < 400 { + {{/is3xx}} + {{#is4xx}} + if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode < 500 { + {{/is4xx}} + {{#is5xx}} + if localVarHTTPResponse.StatusCode >= 500 { + {{/is5xx}} + {{/range}} + {{^range}} + {{^wildcard}} + if localVarHTTPResponse.StatusCode == {{{code}}} { + {{/wildcard}} + {{/range}} + var v {{{dataType}}} + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + {{^-last}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + {{/-last}} + {{^wildcard}} + } + {{/wildcard}} + {{/is2xx}} + {{/is1xx}} + {{/dataType}} + {{/responses}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + + {{#returnType}} + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr + } + + {{/returnType}} + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, nil +} + +{{#vendorExtensions}} +{{#x-equinix-metal-paginated-property}} +// ExecuteWithPagination executes the request to fetch and return all pages of results as a single slice{{#returnType}} +// @return {{{.}}}{{/returnType}} +{{#isDeprecated}} +// Deprecated +{{/isDeprecated}} +func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/structPrefix}}{{operationId}}Request) ExecuteWithPagination() (*{{returnType}}, error) { + + var items {{returnType}} + + pageNumber := int32(1) + + for { + page, _, err := r.Page(pageNumber).Execute() + if err != nil { + return nil, err + } + + items.{{.}} = append(items.{{.}}, page.{{.}}...) + if page.Meta.GetLastPage() <= page.Meta.GetCurrentPage() { + break + } + pageNumber = page.Meta.GetCurrentPage() + 1 + } + + return &items, nil +} +{{/x-equinix-metal-paginated-property}} +{{/vendorExtensions}} + +{{/operation}} +{{/operations}} diff --git a/templates/services/metalv1/api_doc.mustache b/templates/services/metalv1/api_doc.mustache new file mode 100644 index 00000000..9b2811c1 --- /dev/null +++ b/templates/services/metalv1/api_doc.mustache @@ -0,0 +1,97 @@ +# {{invokerPackage}}\{{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{{operationId}}} + +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}(ctx{{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() + +{{{summary}}}{{#notes}} + +{{{unespacedNotes}}}{{/notes}} +{{#vendorExtensions}} +{{#x-equinix-metal-paginated-property}} +{{{operationId}}} is a paginated API operation. You can specify page number and per page parameters with `Execute`, or to fetch and return all pages of results as a single slice you can call `ExecuteWithPagination()`. `ExecuteWithPagination()`, while convenient, can significantly increase the overhead of API calls in terms of time, network utilization, and memory. Excludes can make the call more efficient by removing any unneeded nested fields that are included by default. If any of the requests fail, the list of results will be nil and the error returned will represent the failed request. +{{/x-equinix-metal-paginated-property}} +{{/vendorExtensions}} + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" +{{#vendorExtensions.x-go-import}} +{{{vendorExtensions.x-go-import}}} +{{/vendorExtensions.x-go-import}} + {{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" +) + +func main() { + {{#allParams}} + {{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + configuration := {{goImportAlias}}.NewConfiguration() + apiClient := {{goImportAlias}}.NewAPIClient(configuration) + {{#returnType}}resp, {{/returnType}}r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + {{#returnType}} + // response from `{{operationId}}`: {{{.}}} + fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp) + {{/returnType}} +} +``` + +### Path Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#pathParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/pathParams}}{{#pathParams}} +**{{paramName}}** | {{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/pathParams}} + +### Other Parameters + +Other parameters are passed through a pointer to a api{{{nickname}}}Request struct via the builder pattern +{{#allParams}}{{#-last}} + +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} +{{^isPathParam}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**[]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**map[string]{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{^isPrimitiveType}}{{^isFile}}[{{/isFile}}{{/isPrimitiveType}}**{{dataType}}**{{^isPrimitiveType}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}{{/isContainer}} | {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/isPathParam}}{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}} (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + +{{/operation}} +{{/operations}} diff --git a/templates/services/metalv1/api_test.mustache b/templates/services/metalv1/api_test.mustache new file mode 100644 index 00000000..57c9a45b --- /dev/null +++ b/templates/services/metalv1/api_test.mustache @@ -0,0 +1,64 @@ +/* +{{#appName}} +{{{.}}} +{{/appName}} + +Testing {{classname}}Service + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package {{packageName}} + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + {{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" +) + +func Test_{{packageName}}_{{classname}}Service(t *testing.T) { + + configuration := {{goImportAlias}}.NewConfiguration() + apiClient := {{goImportAlias}}.NewAPIClient(configuration) + +{{#operations}} +{{#operation}} + t.Run("Test {{classname}}Service {{{nickname}}}", func(t *testing.T) { + + {{^pathParams}} + t.Skip("skip test") // remove to run test + {{/pathParams}} + {{#pathParams}} + {{#-first}} + t.Skip("skip test") // remove to run test + + {{/-first}} + var {{paramName}} {{{dataType}}} + {{/pathParams}} + + {{#returnType}}resp, {{/returnType}}httpRes, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}).Execute() + + require.Nil(t, err) + {{#returnType}} + require.NotNil(t, resp) + {{/returnType}} + assert.Equal(t, 200, httpRes.StatusCode) +{{#vendorExtensions}} +{{#x-equinix-metal-paginated-property}} + + {{#returnType}}resp, {{/returnType}}err = apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}).ExecuteWithPagination() + require.Nil(t, err) + {{#returnType}} + require.NotNil(t, resp) + {{/returnType}} +{{/x-equinix-metal-paginated-property}} +{{/vendorExtensions}} + + }) + +{{/operation}} +{{/operations}} +} diff --git a/templates/services/metalv1/client.mustache b/templates/services/metalv1/client.mustache new file mode 100644 index 00000000..66b5a0b7 --- /dev/null +++ b/templates/services/metalv1/client.mustache @@ -0,0 +1,817 @@ +{{>partial_header}} +package {{packageName}} + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + {{#hasOAuthMethods}} + "golang.org/x/oauth2" + {{/hasOAuthMethods}} + {{#withAWSV4Signature}} + awsv4 "github.com/aws/aws-sdk-go/aws/signer/v4" + awscredentials "github.com/aws/aws-sdk-go/aws/credentials" + {{/withAWSV4Signature}} +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the {{appName}} API v{{version}} +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services +{{#apiInfo}} +{{#apis}} +{{#operations}} + + {{classname}} {{#generateInterfaces}}{{classname}}{{/generateInterfaces}}{{^generateInterfaces}}*{{classname}}Service{{/generateInterfaces}} +{{/operations}} +{{/apis}} +{{/apiInfo}} +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + +{{#apiInfo}} + // API Services +{{#apis}} +{{#operations}} + c.{{classname}} = (*{{classname}}Service)(&c.common) +{{/operations}} +{{/apis}} +{{/apiInfo}} + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + {{#hasOAuthMethods}} + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + {{/hasOAuthMethods}} + {{#hasHttpBasicMethods}} + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + {{/hasHttpBasicMethods}} + {{#hasHttpBearerMethods}} + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + {{/hasHttpBearerMethods}} + {{#withAWSV4Signature}} + // AWS Signature v4 Authentication + if auth, ok := ctx.Value(ContextAWSv4).(AWSv4); ok { + creds := awscredentials.NewStaticCredentials(auth.AccessKey, auth.SecretKey, auth.SessionToken) + signer := awsv4.NewSigner(creds) + var reader *strings.Reader + if body == nil { + reader = strings.NewReader("") + } else { + reader = strings.NewReader(body.String()) + } + + // Define default values for region and service to maintain backward compatibility + region := auth.Region + if region == "" { + region = "eu-west-2" + } + service := auth.Service + if service == "" { + service = "oapi" + } + + timestamp := time.Now() + _, err := signer.Sign(localVarRequest, reader, service, region, timestamp) + if err != nil { + return nil, err + } + } + {{/withAWSV4Signature}} + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } +{{#withCustomMiddlewareFunction}} + + if c.cfg.Middleware != nil { + c.cfg.Middleware(localVarRequest) + } + + if c.cfg.MiddlewareWithError != nil { + err = c.cfg.MiddlewareWithError(localVarRequest) + if err != nil { + return nil, err + } + } + +{{/withCustomMiddlewareFunction}} +{{#hasHttpSignatureMethods}} + if ctx != nil { + // HTTP Signature Authentication. All request headers must be set (including default headers) + // because the headers may be included in the signature. + if auth, ok := ctx.Value(ContextHttpSignatureAuth).(HttpSignatureAuth); ok { + err = SignRequest(ctx, localVarRequest, auth) + if err != nil { + return nil, err + } + } + } +{{/hasHttpSignatureMethods}} + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model is an instance of +// the Error component schema or when it implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + errorModel, ok := v.(*Error) + + if ok { + errs := []string{} + errs = append(errs, errorModel.GetErrors()...) + if errorModel.GetError() != "" { + errs = append(errs, errorModel.GetError()) + } + str = strings.Join(errs, ", ") + } else { + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} + +// dumpDeprecation logs headers defined by +// https://tools.ietf.org/html/rfc8594 +// copied from https://github.com/packngo +// for backwards compatibility +func dumpDeprecation(resp *http.Response) { + uri := "" + if resp.Request != nil { + uri = resp.Request.Method + " " + resp.Request.URL.Path + } + + deprecation := resp.Header.Get("Deprecation") + if deprecation != "" { + if deprecation == "true" { + deprecation = "" + } else { + deprecation = " on " + deprecation + } + log.Printf("WARNING: %q reported deprecation%s", uri, deprecation) + } + + sunset := resp.Header.Get("Sunset") + if sunset != "" { + log.Printf("WARNING: %q reported sunsetting on %s", uri, sunset) + } + + links := resp.Header.Values("Link") + + for _, s := range links { + for _, ss := range strings.Split(s, ",") { + if strings.Contains(ss, "rel=\"sunset\"") { + link := strings.Split(ss, ";")[0] + log.Printf("WARNING: See %s for sunset details", link) + } else if strings.Contains(ss, "rel=\"deprecation\"") { + link := strings.Split(ss, ";")[0] + log.Printf("WARNING: See %s for deprecation details", link) + } + } + } +}